Advertisement
blackwolfsden

Eluna GW command editor

Jan 20th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. function Editcomm(eventid, player, msg)-- thank you foereaper for all the help getting this right
  2. local ChatPrefix = "set"
  3. local k = 0
  4. local ChatCache = {}
  5.  
  6. for word in string.gmatch(msg, "[%w_]+") do
  7. k = k+1
  8. ChatCache[k] = word
  9. end
  10.  
  11. if (ChatCache[1] == ChatPrefix) then
  12.  
  13. for i = 1, #GWHELP do
  14.  
  15. if(ChatCache[2]==tostring(GWHELP[i].command))then
  16.  
  17. if(i<=16)and(i>=2)and(player:GetGuildRank()==0)then
  18. PreparedStatements(3, ChatCache[2], ChatCache[3], player:GetGuildName())
  19. player:SendBroadcastMessage("guild cmd "..ChatCache[2].." set to "..ChatCache[3]..".")
  20. return false;
  21. end
  22.  
  23. if(i>=17)and(i<=35)and(i~=26)and(player:GetGMRank()==GWCOMM["SERVER"].GM_admin)then
  24. PreparedStatements(3, ChatCache[2], ChatCache[3], Server)
  25. player:SendBroadcastMessage("GM cmd "..ChatCache[2].." set to "..ChatCache[3]..".")
  26. return false;
  27. end
  28. end
  29. end
  30. player:SendBroadcastMessage("err...")
  31. return false;
  32. end
  33. end
  34.  
  35. RegisterPlayerEvent(21, Editcomm)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement