Re: !afk command for lua [message #412816 is a reply to message #412814] |
Tue, 01 December 2009 05:17 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma:
|
General (3 Stars) |
|
|
jnz wrote on Tue, 01 December 2009 07:14 |
"Daniel" | A better AFK command would be this...
function OnChat(PlayerId, Type, Message, Target)
local command = string.lower(string.match(Message, "%S+"))
if command == "!afk" then
local pName = Get_Player_Name_By_ID(PlayerId)
Console_Input(string.format("kick %d", PlayerId))
Console_Input(string.format("allow %s", pName))
Console_Input(string.format("msg %s has been kicked for: AFK", pName))
end
return 1
end
|
|
Yes, use that!
|
|
|