Advertisement
Guest User

[LUA HELPERS ES] #Chat #Adm,Mp,Mod,etc

a guest
May 29th, 2015
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1. admins = {Nickname = true}
  2. mods = {}
  3. mapcrews = {}
  4. baneados = {}
  5. chat = {}
  6.  
  7. function eventLoop()
  8. for a in pairs(tfm.get.room.playerList) do
  9. tfm.exec.setNameColor(a, 0x009D9D)
  10. end
  11. for a in pairs(baneados) do
  12. tfm.exec.setNameColor(a, 0x664800)
  13. end
  14. for a in pairs(admins) do
  15. tfm.exec.setNameColor(a, 0xEB1D51)
  16. end
  17. for a in pairs(mods) do
  18. tfm.exec.setNameColor(a, 0xBADB2F)
  19. end
  20. for a in pairs(mapcrews) do
  21. tfm.exec.setNameColor(a, 0x2F7FCC)
  22. end
  23. end
  24.  
  25. function eventPlayerRespawn(n)
  26. if baneados[n] then
  27. tfm.exec.killPlayer(n)
  28. end
  29. end
  30.  
  31. function eventChatCommand(n, cmd)
  32. if baneados[n] then
  33. return
  34. end
  35. if admins[n] then
  36. if cmd:sub(0,3) == "ban" and tfm.get.room.playerList[cmd:sub(5)] then
  37. if cmd:sub(5)==n then
  38. else
  39. baneados[cmd:sub(5)]=true
  40. table.insert(chat, "\n<V>[•]<N> "..n.." ha baneado a "..cmd:sub(5)..".")
  41. for b in pairs(baneados) do
  42. tfm.exec.killPlayer(b)
  43. end
  44. end
  45. end
  46. for a in pairs(admins, mods, mapcrews) do
  47. if cmd:sub(0,5) == "admin" then
  48. admins[cmd:sub(0,7)]=true
  49. table.insert(chat, "\n<V>[•]<N> "..n.." ha agregado a <r>"..cmd:sub(7).."</r> al equipo de Administradores.")
  50. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", a, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  51. end
  52. if cmd:sub(0,3) == "mod" then
  53. mods[cmd:sub(0,5)]=true
  54. table.insert(chat, "\n<V>[•]<N> "..n.." ha agregado a <j>"..cmd:sub(5).."</j> al equipo de Moderadores.")
  55. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", a, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  56. end
  57. if cmd:sub(0,2) == "mc" then
  58. mapcrews[cmd:sub(0,4)]=true
  59. table.insert(chat, "\n<V>[•]<N> "..n.." ha agregado a <bv>"..cmd:sub(4).."</bv> al equipo de MapCrews.")
  60. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", a, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  61. end
  62. end
  63. end
  64. if admins[n] or mods[n] or mapcrews[n] then
  65. if cmd == "chat" then
  66. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", n, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  67. end
  68. if cmd:sub(0,3) == "mes" then
  69. if admins[n] then
  70. table.insert(chat, "\n<V>[<font color='#EB1D51'>"..n.."</font>]<N> "..cmd:sub(5))
  71. end
  72. if mods[n] then
  73. table.insert(chat, "\n<V>[<font color='#BADB2F'>"..n.."</font>]<N> "..cmd:sub(5))
  74. end
  75. if mapcrews[n] then
  76. table.insert(chat, "\n<V>[<font color='#2F7FCC'>"..n.."</font>]<N> "..cmd:sub(5))
  77. end
  78. for a in pairs(admins) do
  79. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", a, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  80. end
  81. for a in pairs(mods) do
  82. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", a, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  83. end
  84. for a in pairs(mapcrews) do
  85. ui.addTextArea(0, "<V>[•]<N> Bienvenido al chat del staff. Escribe !mes <vp>[Mensaje]</vp> para hablar"..table.concat(chat).."\n<a href='event:cerrarchat'>X</a>", a, 5, 20, 0, 0, 0x000001, 0x000001, 0.6, true)
  86. end
  87. end
  88. end
  89. end
  90.  
  91. function eventTextAreaCallback(id, n, cb)
  92. if cb=="cerrarchat" then
  93. ui.removeTextArea(0, n)
  94. end
  95. end
  96.  
  97. system.disableChatCommandDisplay("admin")
  98. system.disableChatCommandDisplay("mod")
  99. system.disableChatCommandDisplay("mc")
  100. system.disableChatCommandDisplay("chat")
  101. system.disableChatCommandDisplay("mes")
  102. system.disableChatCommandDisplay("ban")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement