im trying to make a system thats let admins kick players via the chat
function Kick(ply, text)
local Array = string.Explode( " ", text );
if Array[1] == "/kick" & ply:IsAdmin() then
for k , t in ipairs(player.GetAll()) do
if string.find(string.lower(t:Nick()) , string.lower(Array[2])) then
t:Kick(Array[3])
WriteToLog( ply.GetName() .." kicked: ".. Kick:GetName() );
else
ply:PrintMessage( HUD_PRINTTALK, "Player name wasnt valid!");
end
end
return false
end
end
if you wana kick someone you should type /kick <player name> <reason>
I get a error dont remember what it stood.
Please help!