Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.31 KB | None | 0 0
  1. maps={"@0"}
  2. admins={"Luckerfalse"}
  3. banned={}
  4.  
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAllShamanSkills(false)
  7.  
  8. function nextRound()
  9. tfm.exec.newGame(maps[math.random(#maps)])
  10. end
  11.  
  12. function unBan(p)
  13. for num,k in ipairs(banned) do
  14. if (p == banned[num]) then
  15. table.remove(banned, num)
  16. end
  17. end
  18. end
  19.  
  20. function showBanner(p)
  21. tempo=1;
  22. ui.addTextArea(1, "<BR><p align='center'><font face='Soopafresh' size='100' color='#000000'><BR>#test", p, 5+5, 0, 790, 400, 1, 1, 0.0, false)
  23. ui.addTextArea(2, "<BR><p align='center'><font face='Soopafresh' size='100' color='#000000'><BR>#test", p, 5-5, 0, 790, 400, 1, 1, 0.0, false)
  24. ui.addTextArea(3, "<BR><p align='center'><font face='Soopafresh' size='100' color='#000000'><BR>#test", p, 5, 0+5, 790, 400, 1, 1, 0.0, false)
  25. ui.addTextArea(4, "<BR><p align='center'><font face='Soopafresh' size='100' color='#000000'><BR>#test", p, 5, 0-5, 790, 400, 1, 1, 0.0, false)
  26. ui.addTextArea(5, "<BR><p align='center'><font face='Soopafresh' size='100'><BV><BR>#test", p, 5, 0, 790, 400, 1, 1, 0.0, false)
  27. end
  28. for p in pairs(tfm.get.room.playerList) do
  29. showBanner(p)
  30. end
  31.  
  32. ui.addTextArea(51, "<font color='#6a8ea1'>.", NIL, 779, 29, 15, NIL, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  33. ui.addTextArea(52, "<font color='#000000'>.", NIL, 781, 31, 15, NIL, 1, 1, 1.0, false)
  34. ui.addTextArea(50, "<p align='center'><B><a href='event:help'>?</B>", NIL, 780, 30, 15, NIL, 0x324650, 0x324650, 1.0, false)
  35.  
  36. function isAdmin(p)
  37. for _,player in pairs(admins) do
  38. if (player == p) then
  39. return true;
  40. end
  41. end
  42. return false;
  43. end
  44.  
  45. function unAdmin(p)
  46. for num,k in ipairs(admins) do
  47. if (p == admins[num]) then
  48. table.remove(admins, num)
  49. end
  50. end
  51. end
  52.  
  53. function eventNewPlayer(p)
  54. ui.addTextArea(51, "<font color='#6a8ea1'>.", p, 779, 29, 15, NIL, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  55. ui.addTextArea(52, "<font color='#000000'>.", p, 781, 31, 15, NIL, 1, 1, 1.0, false)
  56. ui.addTextArea(50, "<p align='center'><B><a href='event:help'>?</B>", p, 780, 30, 15, NIL, 0x324650, 0x324650, 1.0, false)
  57. showBanner(p)
  58. end
  59.  
  60. function isBanned(p)
  61. for _,player in pairs(banned) do
  62. if (player == p) then
  63. return true;
  64. end
  65. end
  66. return false;
  67. end
  68.  
  69. function showHelp(p)
  70. ui.addTextArea(51, "<font color='#6a8ea1'>.", p, 249, 114, 300, 150, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  71. ui.addTextArea(52, "<font color='#000000'>.", p, 251, 116, 300, 150, 1, 1, 1.0, false)
  72. ui.addTextArea(50, "<p align='center'><font size='16'><B>Introdução</B></font></p><BR> <B>•</B> Nada ainda.<BR> <B>•</B> ..... <B>..</B>.<BR> <B>•</B> Reporte bugs e sugestões ao <B>Luckerfalse</B>.<BR> <B>•</B> Favor ler as regras (próxima página). Se você infringir uma das regras, poderá ser morto ou até banido.", p, 250, 115, 300, 150, 0x324650, 0x324650, 1.0, false)
  73. ui.addTextArea(81, "<font color='#6a8ea1'>.", p, 249, 279, 20, 20, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  74. ui.addTextArea(82, "<font color='#000000'>.", p, 251, 281, 20, 20, 1, 1, 1.0, false)
  75. ui.addTextArea(80, "<p align='center'><B><font size='13'><a href='event:previous'>«", p, 250, 280, 20, 20, 0x324650, 0x324650, 1.0, false)
  76. ui.addTextArea(71, "<font color='#6a8ea1'>.", p, 529, 279, 20, 20, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  77. ui.addTextArea(72, "<font color='#000000'>.", p, 531, 281, 20, 20, 1, 1, 1.0, false)
  78. ui.addTextArea(70, "<p align='center'><B><font size='13'><a href='event:next'> »</B>", p, 530, 280, 20, 20, 0x324650, 0x324650, 1.0, false)
  79. ui.addTextArea(61, "<font color='#6a8ea1'>.", p, 284, 279, 230, 20, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  80. ui.addTextArea(62, "<font color='#000000'>.", p, 286, 281, 230, 20, 1, 1, 1.0, false)
  81. ui.addTextArea(60, "<p align='center'><B><font size='13'><a href='event:close'>Fechar</B>", p, 285, 280, 230, 20, 0x324650, 0x324650, 1.0, false)
  82. end
  83. function eventChatCommand(p, c)
  84. end
  85. if isAdmin(p) then
  86. if c:sub(0,5) == "admin" then
  87. for k,num in pairs(tfm.get.room.playerList) do
  88. if (k == c:sub(7)) then
  89. table.insert(admins, k)
  90. print("<V>"..k.."<J> agora é um admin.")
  91. end
  92. end
  93. elseif c:sub(0,7) == "unadmin" then
  94. for k,num in pairs(tfm.get.room.playerList) do
  95. if (k == c:sub(9)) then
  96. if k ~= "Luckerfalse" then
  97. unAdmin(k)
  98. print("<V>"..k.."<J> não é mais admin.")
  99. end
  100. end
  101. end
  102. elseif c:sub(0,3) == "ban" then
  103. for k,num in pairs(tfm.get.room.playerList) do
  104. if (k == c:sub(5)) then
  105. if k ~= "Luckerfalse" then
  106. table.insert(banned, k)
  107. print("<V>"..k.."<J> foi banido.")
  108. end
  109. end
  110. end
  111. elseif c:sub(0,5) == "unban" then
  112. for num,k in ipairs(banned) do
  113. if (k == c:sub(7)) then
  114. unBan(k)
  115. ui.removeTextArea(0, k)
  116. print("<V>"..k.."<J> foi desbanido.")
  117. end
  118. end
  119. end
  120. end
  121. if c == "help" then
  122. showHelp(p)
  123. elseif c == "die" or c == "mort" then
  124. tfm.exec.killPlayer(p)
  125. end
  126. system.disableChatCommandDisplay(c, true)
  127.  
  128. function eventPlayerDied(p)
  129. notAlive(p)
  130. vivo=vivo-1
  131. end
  132. function eventLoop(ct, tr)
  133. for p,_ in pairs(tfm.get.room.playerList) do
  134. if isBanned(p) then
  135. ui.addTextArea(0, "<font color='#6976917'>.", p, -1000, -1000, 2800, 2400, 6976917, 6976917, 1.0, true)
  136. tfm.exec.killPlayer(p)
  137. tfm.exec.setPlayerScore(p, 0)
  138. end
  139. end
  140. if vivo == 0 or tr <= 0 then
  141. for k in pairs(tfm.get.room.playerList) do
  142. if isAlive(k) then
  143. tfm.exec.setPlayerScore(k, 10, true)
  144. end
  145. end
  146. nextRound()
  147. end
  148. if tempo == 6 then
  149. for i=1,5 do
  150. ui.removeTextArea(i)
  151. end
  152. end
  153. tempo=tempo+1;
  154. tfm.exec.setNameColor("Luckerfalse", 0xEB1D51)
  155. end
  156.  
  157. function eventTextAreaCallback(id, p, link)
  158. if link == "help" then
  159. showHelp(p)
  160. elseif link == "next" then
  161. ui.removeTextArea(71, p)
  162. ui.removeTextArea(72, p)
  163. ui.removeTextArea(id, p)
  164. ui.addTextArea(80, "<p align='center'><B><font size='13'><a href='event:help'>«", p, 250, 280, 20, 20, 0x324650, 0x324650, 1.0, false)
  165. ui.addTextArea(80, "<p align='center'><B><font size='13'><a href='event:help'>«", p, 250, 280, 20, 20, 0x324650, 0x324650, 1.0, false)
  166. ui.updateTextArea(50, "<p align='center'><font size='16'><B>Regras</B></font></p><BR><B> • </B>test;<BR><B> • </B>test;<BR><B> • </B>test;<BR><B> • </B>test;<BR><B> • </B>test;<BR><B> • </B>test.", p)
  167. elseif link == "previous" then
  168. ui.removeTextArea(81, p)
  169. ui.removeTextArea(82, p)
  170. ui.removeTextArea(id, p)
  171. ui.addTextArea(70, "<p align='center'><B><font size='13'><a href='event:help'> »</B>", p, 530, 280, 20, 20, 0x324650, 0x324650, 1.0, false)
  172. ui.updateTextArea(50, "<p align='center'><font size='16'><B>Comandos</B></font></p><BR><font color='#00FF00'> *</font><B>!admin [Jogador]</B> o transforma em admin.<BR><font color='#00FF00'> *</font><B>!unadmin [Jogador]</B> desadmin o jogador.<BR><font color='#00FF00'> *</font><B>!ban [Jogador]</B> bani o jogador.<BR><font color='#00FF00'> *</font><B>!unban [Jogador]</B> desbani o jogador.<BR> <B>!help</B> mostra estas páginas.<BR> <B>!mort</B> comete suicídio.<BR> <B>!die</B> comete suicídio.<BR><p align='right'><font size='9' color='#00FF00'><BR>*<G>Admins", p)
  173. elseif link == "close" then
  174. ui.addTextArea(51, "<font color='#000000'>.", p, 779, 29, 15, NIL, 0x6a8ea1, 0x6a8ea1, 1.0, false)
  175. ui.addTextArea(52, "<font color='#000000'>.", p, 781, 31, 15, NIL, 1, 1, 1.0, false)
  176. ui.addTextArea(50, "<p align='center'><B><a href='event:help'>?</B>", p, 780, 30, 15, NIL, 0x324650, 0x324650, 1.0, false)
  177. ui.removeTextArea(81, p)
  178. ui.removeTextArea(82, p)
  179. ui.removeTextArea(80, p)
  180. ui.removeTextArea(71, p)
  181. ui.removeTextArea(72, p)
  182. ui.removeTextArea(70, p)
  183. ui.removeTextArea(61, p)
  184. ui.removeTextArea(62, p)
  185. ui.removeTextArea(60, p)
  186. end
  187. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement