Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » !afk command for lua
Re: !afk command for lua [message #412830 is a reply to message #412769] Tue, 01 December 2009 09:58 Go to previous messageGo to previous message
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. Wink

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


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem with lua scripts
Next Topic: !spy command help
Goto Forum:
  


Current Time: Sun Dec 29 18:12:27 MST 2024

Total time taken to generate the page: 0.00761 seconds