Working kick function(in ASpam.lua)
function Spammer_Kick( ply )
if ply.warn >= Warn_Player then
ply:PrintMessage(HUD_PRINTTALK, "If you continue to Spam, you will be kicked!")
Warn_Left = Max_Warn - ply.warn
game.ConsoleCommand( "ulx asay Player " ..ply:Nick().. " is spamming, and has a warn level of " ..ply.warn.. ". Kicking them after " ..Warn_Left.. " more warnings \n")
end
if ply.warn >= Max_Warn then
if SPropProtection then
SPropProtection.DRemove( ply:SteamID(), ply:Nick() )
end
if UPS then
UPS.deleteAll( ply:UniqueID(), true )
end
game.ConsoleCommand("kickid "..ply:UserID().." \"Spamming!\" \n")
end
end