Re: !afk command for lua [message #412830 is a reply to message #412769] |
Tue, 01 December 2009 09:58 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma:
|
General (1 Star) |
|
|
"Zack" |
"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
|
oh, and this would be nice.
function OnChat(PlayerId, Type, Message, Target)
local command = string.lower(string.match(Message, "%S+"))
if command == "!lagfix" 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: Lag Fixed", pName))
end
return 1
end
|
|
|
|