Advertisement
HackinMauro

Untitled

Mar 19th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.01 KB | None | 0 0
  1. commands = {"c", "try", "ng", "bonus"}
  2. for i,command in ipairs(commands) do system.
  3.     disableChatCommandDisplay(command,true)
  4. end
  5.  
  6. votos = 0
  7.  
  8. tfm.exec.setGameTime(1800)
  9. tfm.exec.setUIMapName(" ''COMPLÉTALO EN ...'' <font color = '#FFFFFF'>Comenzará en breves segundos... ")
  10. tfm.exec.disablePhysicalConsumables()
  11.  
  12. local admins = {"Hackinnzkt#0000", "Roroneo#0000", "Sebah#8993", "Juanfmlal#0000", "Twiisa#0000", "Hackinzkt#0000"}
  13. local trys = 0
  14. local timer = 20
  15. function isAdmin (playerName)
  16. for _,adminName in pairs(admins) do
  17. if playerName == adminName then return true end
  18. end
  19. return false
  20. end
  21.  
  22.  
  23. function eventChatCommand (playerName, command)
  24.  
  25. if command:sub(1,14) == "COMPLÉTALO EN" then
  26.   if isAdmin (playerName) then
  27.      tfm.exec.disableAutoShaman(true)
  28.      tfm.exec.disableAutoNewGame(true)
  29.      tfm.exec.newGame(command:sub(17,24))
  30.      tfm.exec.disableAfkDeath(true)
  31.      tfm.exec.newGame(command:sub(17,24))
  32.      tfm.exec.disableAutoTimeLeft(true)
  33.      tfm.exec.setGameTime(1800)
  34. ui.removeTextArea(1, nil)
  35. ui.removeTextArea(2, nil)
  36. ui.removeTextArea(4, nil)
  37. ui.removeTextArea(5, nil)
  38. ui.removeTextArea(877,nil)
  39. ui.removeTextArea(876,nil)
  40. ui.removeTextArea(878,nil)
  41. ui.removeTextArea(879,nil)
  42. ui.removeTextArea(6,nil)
  43.  ui.addTextArea(3, "<p align='center'><font size='15' color='0xFFFFF'>COMPLÉTALO EN <font color='#CFD500'>"..command:sub(16).."</font></font>",nil,368, 369, 399, 23, 0x000000, 0xC4CE19,0.6, true)
  44.  ui.addTextArea(21, "<p align='center'><font size='19' color='0xFFFFF'><a href='event:close'>»</a></font>",name, 777, 365, 20, 25,0,0xC4CE19, 0.4,false)
  45.       tfm.exec.setUIMapName(" ''COMPLÉTALO EN ...'' - ManageR:<font color='#D900FF'> "..playerName.."</font> ")
  46. votos = 0
  47. trys = 0
  48. autoreset = command:sub(17,24)
  49. manager = playerName
  50. mapInfo = command:sub(16)
  51. end
  52. end
  53.  
  54. if command:sub(1,3) == "try" then
  55.  if isAdmin (playerName) then
  56.    if trys >= 5 then
  57.  
  58. ui.addPopup(1,5,"<p align='center'><font color='#ff0606'>ERROR:\n</font> No puedes dar más de 5 trys o sobrepasar un bonus try..</p>",playerName,300,200,200);
  59. else
  60. trys = trys + 1
  61. managerTry = playerName
  62. maxtrys = command:sub(5)
  63. ui.addTextArea(2, "<p align='center'><font size='20' color='0xFFFFF'>Try "..trys.."<font color  = '#CFD500'>/"..command:sub(5).."</font>",nil, 0, 20, 800, 25, 0, 0, 0, true)
  64. ui.removeTextArea(5, nil)
  65. ui.removeTextArea(1, nil)
  66. tfm.exec.newGame(autoreset)
  67. tfm.exec.setUIMapName(" ''COMPLÉTALO EN ...'' - ManageR:<font color='#D900FF'> "..managerTry.."</font> ")
  68. print("<rose>ManageR: "..managerTry.." Usó el comando: !try</font>")
  69. end
  70.  end
  71.   end
  72. if command == "bonus" then
  73. ui.addTextArea(876, "", nil, 322, 258, 168, 39, 0x324650, 0xF8FF00, 0.5, true)
  74. ui.addTextArea(877, "<p align='center'><font size='14'>VOTACIÓN POPULAR</font>\n\n ¿Te gustaría un try más? (Bonus Try)\n\n Votacion:<font color='#C3D42A'> "..votos.."</font>/8", nil, 322, 163, 169, 88, 0x2E3744, 0xC3D42A, 1, true)
  75. ui.addTextArea(878, "<p align='center'><a href='event:si'>Sí</a>", nil, 336, 268, 39, 19, 0x262C34, 0x000000, 1, true)
  76. ui.addTextArea(879, "<p align='center'><p align='center'><a href='event:no'>No</a>", nil, 433, 268, 39, 19, 0x262C34, 0x000000, 1, true)
  77. end
  78.  
  79. if command == "c" then
  80.  if isAdmin (playerName) then
  81. tfm.exec.setGameTime(500)
  82. timer = 20
  83. ui.removeTextArea(2, nil)
  84. ui.removeTextArea(5, nil)
  85. ui.removeTextArea(20,name)
  86. ui.addTextArea(3, "<p align='center'><font size='15' color='0xFFFFF'>COMPLÉTALO EN <font color='#CFD500'>"..mapInfo.."</font></font>",name, 368, 369, 399, 23, 0x000000, 0xC4CE19,0.6, true)
  87. ui.addTextArea(21, "<p align='center'><font size='19' color='0xFFFFF'><a href='event:close'>»</a></font>",name, 777, 365, 20, 25,0,0xC4CE19, 0.4,false)
  88. end
  89.  end
  90.  
  91. if command == "ng" then
  92.  if isAdmin (playerName) then
  93. ui.addTextArea(5, "<p align='center'><font size='25' color='#CC0000'>¡NADIE GANA!</font>",nil, 0, 20, 800, 60, 0, 0, 0, true)
  94. ui.removeTextArea(1, nil)
  95. ui.removeTextArea(2, nil)
  96. ui.removeTextArea(3, nil)
  97. ui.removeTextArea(4, nil)
  98. end
  99.  end
  100.  
  101. if command == "info" then
  102. ui.addTextArea(2000, "<br><p align='center'><font size='20'><b><font face='Soopafresh'>Información sobre                             COMPLÉTALO EN ...</b><br></font><font size = '11'>\n <font color='#FFFFFF'>Es una modalidad para aumentar tu rango. Si completas un mapa en el tiempo dado, podrás aumentar de rango.</font> \n \n <font color='#FFD600'> Calentamiento:</font>  Antes de empezar un mapa tendrás un tiempo de calentamiento para que puedas inspeccionar el mapa o aprendértelo. \n \n <font color='#FFD600'> Try:</font> Es el número de intentos u oportunidades que tendrás para completar el mapa en el tiempo indicado. \n \n   <font color='#FFFFFF'> (Las milésimas no cuentan) ", playerName, 254, 50, 290, 280, 0x313131, 0x000000, 1, true)
  103. ui.addTextArea(2001, "<a href='event:x'>X</a>", playerName, 530, 50, 15, 15, 0xE30000, 0x000000, 0.5, true)
  104.  
  105.  
  106. end
  107.     end
  108.  
  109. function startGame()
  110.  bonusTime = 10000
  111.   tfm.exec.newGame(autoreset)
  112.    tfm.exec.setGameTime(1800)
  113. ui.removeTextArea(4, nil)
  114. ui.removeTextArea(1, nil)
  115. ui.removeTextArea(877,nil)
  116. ui.removeTextArea(876,nil)
  117. ui.removeTextArea(878,nil)
  118. ui.removeTextArea(879,nil)
  119. ui.removeTextArea(6,nil)
  120. votos = 0
  121.  
  122. tfm.exec.setUIMapName(" ''COMPLÉTALO EN ...'' - ManageR:<font color='#D900FF'> "..manager.." </font> ")
  123.  
  124. -- ManageRColors
  125. tfm.exec.setNameColor("Hackinnzkt",0xFCF903)
  126. tfm.exec.setNameColor("Roroneo",0xD500FF)
  127. tfm.exec.setNameColor("Sebah#8993",0xD500FF)
  128. tfm.exec.setNameColor("Juanfmlal",0xD500FF)
  129. tfm.exec.setNameColor("Twiisa",0xD500FF)
  130. end
  131.  
  132. function eventLoop (time, remaining)
  133. if remaining <= 500000 then
  134. ui.addTextArea(1, "<p align='center'><font size='12px' color='#FFFFFF'>CALENTAMIENTO: <font color='#CFD500'>"..math.floor(timer).."s</font>", nil, 2, 25,794, 20, 0x292929, 0x292929, 0.8,false)
  135. timer = timer - 0.5
  136.  if remaining <= 479000 then
  137. ui.addTextArea(1, "<p align='center'><font size='12px' color='#FFFFFF'>CALENTAMIENTO: <font color='#CFD500'>0s</font>", nil, 2, 25,794, 20, 0x910000, 0x910000, 0.8,false)
  138.    if remaining <= 477000 then
  139. ui.removeTextArea(1, nil)
  140. ui.removeTextArea(3, nil)
  141. ui.removeTextArea(22, nil)
  142. ui.removeTextArea(21, nil)
  143. ui.addTextArea(20, "<p align='center'><font size='19' color='0xFFFFF'><a href='event:show'>«</a></font>",name, 777, 365, 20, 25,0,0xC4CE19, 0.2,false)
  144. --math.floor(
  145. startGame()
  146. end
  147.   end
  148.     end
  149.  
  150. if bonusTime >= 1 then
  151.     bonusTime=bonusTime-1
  152.  elseif bonusTime <= 0 then
  153. tfm.exec.newGame(autoreset)
  154. ui.addTextArea(2, "<p align='center'><font color  = '#CFD500' size='20'>BONUS TRY!!!</font>",nil, 0, 20, 800, 25, 0, 0, 0, true)
  155.  
  156. bonusTime = 10000
  157. end
  158. if bonusTime <= 4 then
  159. ui.addTextArea(6, "        Iniciando...", nil, 341, 268, 150, 25, 0x324650, 0x000000, 0, true)
  160.  end
  161. end
  162.  
  163. function eventPlayerWon(playerName, timeElapsed, timeElapsedSinceRespawn)
  164. ui.addTextArea(4, "<p align='center'><font size='14' color='#4AC400'>Tu time: "..(timeElapsedSinceRespawn/100).."s</font>",playerName, 650, 345, 140, 19, 0, 0, 0.2, true)
  165. tfm.exec.respawnPlayer(playerName)
  166. end
  167.  
  168. function eventPlayerDied(playerName)
  169. tfm.exec.respawnPlayer(playerName)
  170. end
  171.  
  172. function eventPlayerRespawn(playerName)
  173. -- ManageRColors
  174. tfm.exec.setNameColor("Hackinnzkt",0xFCF903)
  175. tfm.exec.setNameColor("Roroneo",0xD500FF)
  176. tfm.exec.setNameColor("Sebah#8993",0xD500FF)
  177. tfm.exec.setNameColor("Juanfmlal",0xD500FF)
  178. tfm.exec.setNameColor("Twiisa",0xD500FF)
  179. end
  180.  
  181. bonusTime = 10000
  182.  
  183. function eventTextAreaCallback(id, name, cb)
  184. if cb == "show" then
  185.  
  186. ui.addTextArea(3, "<p align='center'><font size='15' color='0xFFFFF'>COMPLÉTALO EN <font color='#CFD500'>"..mapInfo.."</font></font>",name, 368, 369, 399, 23, 0x000000, 0xC4CE19,0.6, true)
  187. ui.addTextArea(21, "<p align='center'><font size='19' color='0xFFFFF'><a href='event:close'>»</a></font>",name, 777, 365, 20, 25,0,0xC4CE19, 0.4,false)
  188. ui.removeTextArea(20,name)
  189. end
  190.  
  191. if cb == "close" then
  192. ui.removeTextArea(22,name)
  193. ui.removeTextArea(3,name)
  194. ui.removeTextArea(20,name)
  195. ui.removeTextArea(21,name)
  196. ui.addTextArea(20, "<p align='center'><font size='19' color='0xFFFFF'><a href='event:show'>«</a></font>",name, 777, 365, 20, 25,0,0xC4CE19, 0.2,false)
  197. end
  198. if cb == "x" then
  199. ui.removeTextArea(2000,name)
  200. ui.removeTextArea(2001,name)
  201.  
  202. end
  203.  
  204.  
  205. if cb == "si" then
  206.  if votos >=7 then
  207. votos = votos + 1
  208. ui.addTextArea(877, "<p align='center'><font size='14'>VOTACIÓN POPULAR</font>\n\n ¿Te gustaría un try más? (Bonus Try)\n\n Votacion:<font color='#C3D42A'> "..votos.."</font>/8", nil, 322, 163, 169, 88, 0x2E3744, 0xC3D42A, 1, true)
  209. ui.addTextArea(6, "Preparando bonus try...", nil, 341, 268, 150, 25, 0x324650, 0x000000, 0, true)
  210. bonusTime = 10
  211. ui.removeTextArea(878,nil)
  212. ui.removeTextArea(879,nil)
  213. elseif votos >=7 and bonusTime <= 0 then
  214. tfm.exec.newGame(autoreset)
  215. ui.removeTextArea(877,nil)
  216. ui.removeTextArea(876,nil)
  217. ui.removeTextArea(878,nil)
  218. ui.removeTextArea(879,nil)
  219. ui.removeTextArea(6,nil)
  220. ui.removeTextArea(5, nil)
  221. ui.addTextArea(2, "<p align='center'><font color  = '#CFD500' size='20'>BONUS TRY!!!</font>",nil, 0, 20, 800, 25, 0, 0, 0, true)
  222. else
  223.  
  224. votos = votos + 1
  225. print(" <font color ='#C3D42A'>"..name.."</font> votó por: Sí ")
  226. ui.addTextArea(877, "<p align='center'><font size='14'>VOTACIÓN POPULAR</font>\n\n ¿Te gustaría un try más? (Bonus Try)\n\n Votacion:<font color='#C3D42A'> "..votos.."</font>/8", nil, 322, 163, 169, 88, 0x2E3744, 0xC3D42A, 1, true)
  227. ui.addTextArea(6, "Esperando resultados...", name, 341, 268, 150, 25, 0x324650, 0x000000, 0, true)
  228. ui.removeTextArea(878,name)
  229. ui.removeTextArea(879,name)
  230. end
  231.   end
  232. if cb == "no" then
  233. print(" <font color ='#C3D42A'>"..name.."</font> votó por: No ")
  234. ui.addTextArea(6, "Esperando resultados...", name, 341, 268, 150, 25, 0x324650, 0x000000, 0, true)
  235. ui.removeTextArea(878,name)
  236. ui.removeTextArea(879,name)
  237. end
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245. if cb == "no" then
  246. print(" <font color ='#C3D42A'>"..name.."</font> votó por: No ")
  247. ui.addTextArea(6, "Esperando resultados...", name, 341, 268, 150, 25, 0x324650, 0x000000, 0, true)
  248. ui.removeTextArea(878,name)
  249. ui.removeTextArea(879,name)
  250. end
  251.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement