Advertisement
alditojeje

Untitled

Dec 6th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.95 KB | None | 0 0
  1. --[[
  2. __ __ __ ___ __ _ __ __ ____
  3. / / / / / / / _ | / / | | / / _/_/ / __/
  4. / /__/ /_/ / / __ | / / | |/ / _/_/ _\ \
  5. /____/\____/ /_/ |_| / / |___/ /_/ /___/
  6. /_/
  7. _____ _ _ _ _
  8. |_ _| | || | | | | |
  9. | | _ __ ___ | || | ___ __ _ _ __ __| | ___ | | ___
  10. | | | '__| / _ \ | || | / _ \ / _` || '_ \ / _` | / _ \ | | / _ \
  11. | | | | | (_) || || || __/| (_| || | | || (_| || (_) || || (_) |
  12. \_/ |_| \___/ |_||_| \___| \__,_||_| |_| \__,_| \___/ |_| \___/
  13. V4.9
  14. -----------------------------------------------------------------------------------]]
  15. local ADMINISTRADOR = "Zubzzeroh" -- Cambia tu nombre para ser administrador
  16. -----------------------------------------------------------------------------------]]
  17. --[[
  18. Comandos:
  19. !saltar - Para cambiar de mapa
  20. !puntos - Para cambiar el puntaje, ej: !puntos team1 5
  21. !np @codigo - Para poner cualquier mapa
  22. !pausa - Para pausar el juego
  23. !team - Para asignar jugadores a un equipo, ej: !team1 Trolleandolo
  24. !d NUMERO - Asigna el puntaje para ganar, ej: !d 20
  25. !añadir team nick - Añade un jugador a el equipo especificado, ej: !añadir team4 Trolleandolo
  26. !reset - Resetea el juego
  27. !quitar NOMBRE - saca a un jugador del juego
  28. !puntaje - para ver el puntaje [SOLO EN MODO DEATHMATCH]
  29. --------------------------------------------------------------------
  30. ]]
  31. -----------------------------------------------------------------------------------
  32. local WINS = 15 -- Puntaje para ganar.
  33. ------------------------------------------------------------------------------------
  34. --[[
  35. MEJORAS DE LA VERSIÓN
  36. [BOTÓN REVANCHA EN DEATHMATCH Y TEAMS]
  37. [SE QUITÓ UN BUG]
  38. [SE AÑADIERON MAPAS DE BOOTCAMP]
  39. [SE REDUJERON LAS PROBABILIDADES DE BUG]
  40. [SE AÑADIÓ MODO 2 TEAMS AL AZAR]
  41. ]]
  42.  
  43. system.disableChatCommandDisplay("np", true)
  44. system.disableChatCommandDisplay("pause", true)
  45. system.disableChatCommandDisplay("saltar", true)
  46. system.disableChatCommandDisplay("puntaje", true)
  47. tfm.exec.disablePhysicalConsumables()
  48. tfm.exec.disableAutoShaman()
  49. tfm.exec.disableAutoNewGame()
  50. tfm.exec.disableAutoTimeLeft()
  51. local teams = {
  52. [1] = {},
  53. [2] = {},
  54. [3] = {},
  55. [4] = {},
  56. [5] = {},
  57. [6] = {},
  58. [7] = {},
  59. [8] = {},
  60. }
  61. local points = {
  62. [1] = 0,
  63. [2] = 0,
  64. [3] = 0,
  65. [4] = 0,
  66. [5] = 0,
  67. [6] = 0,
  68. [7] = 0,
  69. [8] = 0,
  70. }
  71. local equipos = {}
  72. local puntos = {}
  73. local modob = "racing"
  74. local modo = "bootcamp"
  75. local modo2 = "Deathmatch"
  76. local modo2b = "normal"
  77. local tiempo = 60
  78. tonumber(tiempo)
  79. local isfirst = false
  80. local gameRunning = false
  81. local winTime = false
  82. local playersInGame = {}
  83. local distanciax = 30
  84. local distanciay = 80
  85. local textarealugar = 300
  86. local textareaid = 0
  87. local mapasmix = {203664,375455,394132,173816,171776,199210,562897,172951,171148,166430,169076,330933,179488,172621,168754,159145,163596,152733,410040,158909,261814,195453,281985,191205,159932,2176211,586901,285589,257324,236768,303151,270924,1324259,1225867,563436,424604,523270,172547,2693587,168204,2693344,193662,1788490,305680,149451,176253,342035,2466489,292808,176615,438333,394125,162482,304861,458528,159298,184648,268915,329318,373105,261298,302080,449496,159187,176710,161023,366260,1852910,201172,549759,257715,397478,261298,177652,408643,447805,155606,176619,460961,455271,172512,320607,166271,299942,150664,186066,152260,155628,166805,178297,313138,167903,223947,191177,185873,113156,156720,163159,197229,204647,163531,232675,216173,166361,169059,271411,277824,306365,172520,157098,225744,608368,215933,266398,343875,327354,331344,333002,223174,332130,254785,295487,184817,159691,235717,169228,191203,503679,506032,2747525,192255,208056,171480,182681,219956,270143,2887929,247329,250610,2118599,445133,149853,212903,220737,397296,2617003,629731,329627,221767,422655,417816,164931,245152,371072,2458243,214788,274963,2439335,269534,8679,321268,398041,5591416,5650343,5650250,161730,4273207,4091580,5650303,5172709,5650469,214660,3579335,4003729,508451,314205,156510,5545443,606723,3946626,332467,1665516,1614563,3679884,414899,1531388,905496,3834905,3821104,1851411,3816991,2331474,313245,266854,193588,2141379,3738767,232791,285752,278506,406266,1976857,301315,180469,3693822,280896,403698,259604,418022,323366,594883,477603,437860,590641,3688419,3682405,645288,419374,664949,704015,398942,195720,314159,613985,3683383,3683201,3680223,3680221,363625,1693705,319524,3667358,1718723,1490438,3630433,3620542,3617674,3556489,3548406,3548376,3408247,2953315,2883986,2683170,2645615,2536577,2453022,2372538,2287914,2286056,2223685,2150335,2150335,2101747,2018511,2007205,1975684,1964752,1964700,1956555,1923785,1862800,1716949,1674534,1658171,1659639,1657360,1657021,1654105,1651658,1643157,1634741,1632706,1622737,1619934,1618110,1613550,1612796,1612436,1608638,6212895,1602654,1601492,1586439,1588884,1573997,1567620,1542618,1539791,1513407,1509474,1503393,1487161,1450554,1425101,1394120,1393405,1373000,1371239,1368222,1359797,1358446,1352534,1346440,1321664,1321417,1281981,1255130,1222899,1214182,1195842,1143815,1132357,1058681,979179,829657,813156,798953,749102,737841,627609,624721,608459,616373,594049,606719,586688,580031,564033,558790,551126,545493,536235,528428,511275,508106,501711,496945,496091,483924,472665,472379,447556,445133,444490,441047,438154,436447,436107,431373,430145,429822,428517,427300,425806,424795,422361,421302,420956,420806,418658,418600,416142,412316,410813,412211,410565,410532,410230,407457,407455,407230,407165,406982,406881,406486,405295,403910,401995,401945,401778,397938,397812,397296,396861,396645,391625,387270,387180,386046,385295,386029,379745,378826,379866,364998,359055,352885,352710,350251,344952,340069,339896,339643,337774,323600,319841,317754,309029,308711,308435,306213,292348,278916,277784,275514,270819,1017676,160762,2089069,234039,267187,263163,262144,330590,403698,396105,6538564,396105,419735,6547536,355658,6607378,191716,292348,6456247,5326916,6077025,356722,2564883,1450554,494706,254291,1503393,6467947,6263285,2953315,6114281,412752,4038817,5461992,319841,359901,191716,452016,1450554,397296,250610,499684,5848412,238791,2283,232274,1716693,330590,459349,6583596,455167,6460747,251459,244888,5755208,240973,235501,235034,234039,233398,232274,230510,216735,216439,216505,214037,212542,211565,198715,193936,191716,186604,180274,176263,178657,146801,145020,3154,2283,5382692,5249500,4412890,5163891,789128,2245005,2030343,5712914,372401,5087373,4953687,2369254,4853690,226069,422509,5436200,732880,4038817,400866,3730656,3985806,355658,5175727,5699298,5588646,3921436,3639993,3984750,508796,1985019,4734427,1703617,289068,197219,333666,6077025,5710586,322321,331572,4741601,158128,6310411,6312498,6310396,6312188,6473912,6389619,6854536,6854539,6312173,6315208,6312203,6310370,6310383,6853060,6310440,6547670,7062105,6545742,6985344,960547}
  88. local mapasbootcamp= {203664,375455,394132,173816,562897,171148,166430,169076,330933,168754,159145,163596,152733,410040,158909,261814,281985,2176211,270924,1324259,1225867,563436,424604,172547,168204,2693344,193662,305680,149451,2466489,292808,438333,394125,162482,304861,458528,159298,184648,268915,329318,261298,302080,449496,159187,176710,161023,366260,1852910,201172,549759,257715,397478,261298,177652,408643,447805,155606,176619,460961,455271,172512,320607,166271,299942,150664,186066,152260,155628,166805,178297,313138,167903,223947,191177,185873,113156,156720,163159,197229,204647,163531,232675,216173,166361,169059,271411,277824,306365,172520,157098,225744,608368,215933,266398,343875,327354,331344,333002,223174,332130,254785,295487,184817,159691,235717,169228,191203,503679,506032,2747525,192255,208056,171480,182681,219956,270143,2887929,2789121,492399,314743,6924913,2918822,232469,397469,280949,176729,292668,242291,294478,2669415,354984,514311,814311,295465,2239788,187478,212322,249760,476706,298424,263819,175280,3920916,330841,554154,439092,232678,395216,399364,4000008,543010,571683,3958217,329571,6680648,3603631,272402,3161324,2682583,371579,2961800,3734998,2719419,255943,313214}
  89. local mapasracing = {'#7'}
  90. local maps = mapasracing
  91. local equipoc= {}
  92. local colors = {
  93. [1] = "e54427",
  94. [2] = "0a98db",
  95. [3] = "00ff00",
  96. [4] = "ffff00",
  97. [5] = "f27d0c",
  98. [6] = "000099",
  99. [7] = "000001",
  100. [8] = "7c5ead",
  101. }
  102. local queue = {}
  103. local nteam = 1
  104. local azar = {}
  105. local posicion = {}
  106. local modoazar = ""
  107. local numeroposicion = 1
  108. local totales = 0
  109. local totales2 = 0
  110. local jugando = {}
  111. local totaljugando = 1
  112. local jugandoposicion = {}
  113. function newMap()
  114. local mapcode = maps[math.random(#maps)]
  115. if #queue > 0 then
  116. mapcode = queue[1]
  117. table.remove(queue, 1)
  118. end
  119. tfm.exec.newGame(mapcode)
  120. for player, data in pairs(tfm.get.room.playerList) do
  121. if not playersInGame[player] then
  122. tfm.exec.killPlayer(player)
  123. end
  124. end
  125. tfm.exec.setGameTime(tiempo)
  126. if modo2b == "Deathmatch" then
  127. borrarScoreDeathmatch()
  128. end
  129. end
  130.  
  131. --- MUDA TEU NOME AQUI VVVVVV ---
  132. function main()
  133. system.bindMouse('Zubzzeroh', true)
  134. end
  135.  
  136. function eventMouse(name, mx, my)
  137. tfm.exec.movePlayer(name, mx, my)
  138. end
  139.  
  140. main()
  141.  
  142. function modoalazar()
  143. ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  144. ui.addTextArea(37, "<p align='center'><V>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  145. ui.addTextArea(2, "", nil, 142, 71, 516, 290, 0x0E1417, 0x0E1417, 1, true)
  146. ui.addTextArea(4, "", nil, 231, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  147. ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 232, 80, 140, 20, 0x324650, 0x324650, 1, true)
  148. ui.addTextArea(6, "", nil, 399, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  149. ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 400, 80, 140, 20, 0x324650, 0x324650, 1, true)
  150. for i=8, 11 do
  151. ui.removeTextArea(i)
  152. end
  153. ui.addTextArea(40, "", nil, 231, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  154. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 232, 121, 138, 198, 0x324650, 0x324650, 1, true)
  155. for i=32, 35 do
  156. ui.removeTextArea(i)
  157. end
  158. ui.addTextArea(36, "", nil, 399, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  159. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 400, 121, 138, 198, 0x324650, 0x324650, 1, true)
  160. ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 320, 197, 140, 200, 0, 0, 0, true)
  161. ui.addTextArea(15, "", nil, 367, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  162. ui.addTextArea(16, "<p align='center'><V>VS", nil, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  163. ui.addTextArea(42, "", ADMINISTRADOR, 600, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  164. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", ADMINISTRADOR, 601, 82, 38, 18, 0x324650, 0x324650, 1, true)
  165. ui.addTextArea(45, "", ADMINISTRADOR, 600, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  166. ui.addTextArea(46, "<p align='center'><V><a href='event:reset'>Reset", ADMINISTRADOR, 601, 140, 50, 18, 0x324650, 0x324650, 1, true)
  167. ui.addTextArea(47, "", ADMINISTRADOR, 600, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  168. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  169. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  170. ui.addTextArea(57, "", ADMINISTRADOR, 600, 207, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  171. ui.addTextArea(58, "<p align='center'><V><a href='event:volver'><font size='10'>4 Teams", ADMINISTRADOR, 601, 208, 55, 23, 0x324650, 0x324650, 1, true)
  172. ui.removeTextArea(59)
  173. ui.removeTextArea(60)
  174. ui.removeTextArea(53)
  175. ui.removeTextArea(51)
  176. ui.removeTextArea(54)
  177. ui.addTextArea(56, "<p align='center'><V><a href='event:azart'><font size='12'>Azar", ADMINISTRADOR, 601, 246, 55, 18, 0x324650, 0x324650, 1, true)
  178.  
  179.  
  180. verificarmodo2()
  181. end
  182. function eventPlayerWon(player)
  183. if not isfirst then
  184. isfirst = true
  185. tfm.exec.setGameTime(3)
  186. if modo2b == "Deathmatch" then
  187. if puntos[player] >= WINS - 1 then
  188. gameRunning = false
  189. winTime = os.time()
  190. ui.addTextArea(29, string.format("<p align='center'><font size='37' color='#000000'>%s ganó\nLos otros son perdedores xdxdxd", player), nil, 3, 168, 800, 500, 0, 0, 0, true)
  191. ui.addTextArea(30, string.format("<p align='center'><font size='37'><font color='#cecece'><font color='#ff0000'>%s </font>ganó\nLos otros son perdedores xdxdxd", player), nil, 1, 170, 800, 500, 0, 0, 0, true)
  192. ui.addTextArea(16, "<p align='center'><font color='#225066' size='18' face='Tw Cen MT Condensed'><a href='event:iniciarJogo'>DE NUEVO", ADMINISTRADOR, 350, 270, 100, 20, 0xFFFFFF, 0xFFFFFF, 1, true)
  193. end
  194. tfm.exec.setGameTime(3)
  195. puntos[player] = puntos[player]+1
  196. equipoc[player] = "0x115b17"
  197. displayScoreDeathmatch()
  198. end
  199. if modo2b == "normal" then
  200. if table.contains(teams[1], player) then
  201. tfm.exec.setGameTime(3)
  202. points[1] = points[1]+1
  203. elseif table.contains(teams[2], player) then
  204. tfm.exec.setGameTime(3)
  205. points[2] = points[2]+1
  206. elseif table.contains(teams[3], player) then
  207. tfm.exec.setGameTime(3)
  208. points[3] = points[3]+1
  209. elseif table.contains(teams[4], player) then
  210. tfm.exec.setGameTime(3)
  211. points[4] = points[4]+1
  212. elseif table.contains(teams[5], player) then
  213. tfm.exec.setGameTime(3)
  214. points[5] = points[5]+1
  215. elseif table.contains(teams[6], player) then
  216. tfm.exec.setGameTime(3)
  217. points[6] = points[6]+1
  218. elseif table.contains(teams[7], player) then
  219. tfm.exec.setGameTime(3)
  220. points[7] = points[7]+1
  221. elseif table.contains(teams[8], player) then
  222. tfm.exec.setGameTime(3)
  223. points[8] = points[8]+1
  224. else
  225. isfirst = false
  226. end
  227. winner = false
  228. if points[1] >= WINS then
  229. winner = 1
  230. elseif points[2] >= WINS then
  231. winner = 2
  232. elseif points[3] >= WINS then
  233. winner = 3
  234. elseif points[4] >= WINS then
  235. winner = 4
  236. elseif points[5] >= WINS then
  237. winner = 5
  238. elseif points[6] >= WINS then
  239. winner = 6
  240. elseif points[7] >= WINS then
  241. winner = 7
  242. elseif points[8] >= WINS then
  243. winner = 8
  244. end
  245. if winner then
  246. gameRunning = false
  247. winTime = os.time()
  248. local names = {
  249. "Rojo",
  250. "Azul",
  251. "Verde",
  252. "Amarillo",
  253. "Naranja",
  254. "Azul",
  255. "Negro",
  256. "Violeta",
  257. }
  258. ui.addTextArea(26, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó", names[winner]), nil, 0, 171, 800, 500, 0, 0, 0, true)
  259. ui.addTextArea(27, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó", names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  260. ui.addTextArea(28, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó", names[winner]), nil, 2, 169, 800, 500, 0, 0, 0, true)
  261. ui.addTextArea(29, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó", names[winner]), nil, 3, 168, 800, 500, 0, 0, 0, true)
  262. ui.addTextArea(30, string.format("<p align='center'><font size='37'><font color='#cecece'>El equipo <font color='#%s'>%s</font> Ganó", colors[winner], names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  263. ui.addTextArea(16, "<p align='center'><font color='#225066' size='18' face='Tw Cen MT Condensed'><a href='event:iniciarJogo'>REVANCHA", ADMINISTRADOR, 350, 270, 100, 20, 0xFFFFFF, 0xFFFFFF, 1, true)
  264. end
  265. displayScore()
  266. end
  267. end
  268. end
  269. function eventLoop(elapsed, remain)
  270. if gameRunning then
  271. remain = remain/1000
  272. if remain < 0 then
  273. remain = 100
  274. newMap()
  275. end
  276. else
  277. if winTime then
  278. if winTime > os.time()-30000 then
  279. else
  280. winTime = false
  281. ui.removeTextArea(26)
  282. ui.removeTextArea(27)
  283. ui.removeTextArea(28)
  284. ui.removeTextArea(29)
  285. ui.removeTextArea(30)
  286. displayTeams()
  287. teams = {
  288. [1] = {},
  289. [2] = {},
  290. [3] = {},
  291. [4] = {},
  292. [5] = {},
  293. [6] = {},
  294. [7] = {},
  295. [8] = {},
  296. }
  297. points = {
  298. [1] = {},
  299. [2] = {},
  300. [3] = {},
  301. [4] = {},
  302. [5] = {},
  303. [6] = {},
  304. [7] = {},
  305. [8] = {},
  306. }
  307. playersInGame = {}
  308. end
  309. end
  310. end
  311. end
  312. function string.title(s)
  313. return string.gsub(s, "%a", function(c)
  314. return string.upper(c)
  315. end, 1)
  316. end
  317. function resetmostrarjugadoresdeathmatch()
  318. distanciax = 30
  319. distanciay = 80
  320. textarealugar = 302
  321. textareaid = 0
  322. end
  323. function eventChatCommand(player, command)
  324. if modo2b == "Deathmatch" then
  325. args = string.split(command, " ")
  326. if args[1] == "puntaje" then
  327. resetmostrarjugadoresdeathmatch()
  328. ui.addTextArea(300, "<p align='center'><V><a href='event:cerrarpuntaje'>X", player, 30, 50, 30, 16, 0x324650, 0x324650, 1, true)
  329. ui.addTextArea(301, string.format("<p align='center'><V>Deathmatch a %s puntos",WINS), player, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
  330. for k,players in pairs(tfm.get.room.playerList) do
  331. if puntos[k] then
  332. equipos[k] = k
  333. playersInGame[k] = true
  334. if textareaid >= 32 then
  335. else
  336. ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), player, distanciax, distanciay, 140, 18, 0x324650, 0x000000, 1, true)
  337. distanciay = distanciay + 37
  338. textareaid = textareaid + 1
  339. textarealugar = textarealugar + 1
  340. if textareaid == 8 then
  341. distanciax = distanciax + 190
  342. distanciay = 80
  343. textareaid = 0
  344. end
  345. end
  346. end
  347. end
  348. end
  349. end
  350. if player:lower() == ADMINISTRADOR:lower() then
  351. args = string.split(command, " ")
  352. if args[1] == "team1" then
  353. if modo2b == "normal" then
  354. table.remove(args, 1)
  355. teams[1] = {}
  356. points[1] = 0
  357. for index, player in pairs(args) do
  358. player = string.title(player)
  359. table.insert(teams[1], player)
  360. playersInGame[player] = true
  361. end
  362. if modoazar == "true" then
  363. modoalazar()
  364. else
  365. displayTeams()
  366. end
  367. end
  368. elseif args[1] == "team2" and modo2b == "normal" then
  369. table.remove(args, 1)
  370. teams[2] = {}
  371. points[2] = 0
  372. for index, player in pairs(args) do
  373. player = string.title(player)
  374. table.insert(teams[2], player)
  375. playersInGame[player] = true
  376. end
  377. if modoazar == "true" then
  378. modoalazar()
  379. else
  380. displayTeams()
  381. end
  382. elseif args[1] == "team3" and modo2b == "normal" then
  383. table.remove(args, 1)
  384. teams[3] = {}
  385. points[3] = 0
  386. for index, player in pairs(args) do
  387. player = string.title(player)
  388. table.insert(teams[3], player)
  389. playersInGame[player] = true
  390. end
  391. if modoazar == "true" then
  392. modoalazar()
  393. else
  394. displayTeams()
  395. end
  396. elseif args[1] == "team4" and modo2b == "normal" then
  397. table.remove(args, 1)
  398. teams[4] = {}
  399. points[4] = 0
  400. for index, player in pairs(args) do
  401. player = string.title(player)
  402. table.insert(teams[4], player)
  403. playersInGame[player] = true
  404. end
  405. if modoazar == "true" then
  406. modoalazar()
  407. else
  408. displayTeams()
  409. end
  410. elseif args[1] == "team5" and modo2b == "normal" then
  411. table.remove(args, 1)
  412. teams[5] = {}
  413. points[5] = 0
  414. for index, player in pairs(args) do
  415. player = string.title(player)
  416. table.insert(teams[5], player)
  417. playersInGame[player] = true
  418. end
  419. if modoazar == "true" then
  420. modoalazar()
  421. else
  422. displayTeams()
  423. end
  424.  
  425. elseif args[1] == "team6" and modo2b == "normal" then
  426. table.remove(args, 1)
  427. teams[6] = {}
  428. points[6] = 0
  429. for index, player in pairs(args) do
  430. player = string.title(player)
  431. table.insert(teams[6], player)
  432. playersInGame[player] = true
  433. end
  434. if modoazar == "true" then
  435. modoalazar()
  436. else
  437. displayTeams()
  438. end
  439.  
  440. elseif args[1] == "team7" and modo2b == "normal" then
  441. table.remove(args, 1)
  442. teams[7] = {}
  443. points[7] = 0
  444. for index, player in pairs(args) do
  445. player = string.title(player)
  446. table.insert(teams[7], player)
  447. playersInGame[player] = true
  448. end
  449. if modoazar == "true" then
  450. modoalazar()
  451. else
  452. displayTeams()
  453. end
  454. elseif args[1] == "team8" and modo2b == "normal" then
  455. table.remove(args, 1)
  456. teams[8] = {}
  457. points[8] = 0
  458. for index, player in pairs(args) do
  459. player = string.title(player)
  460. table.insert(teams[8], player)
  461. playersInGame[player] = true
  462. end
  463. if modoazar == "true" then
  464. modoalazar()
  465. else
  466. displayTeams()
  467. end
  468. elseif args[1] == "saltar" then
  469. newMap()
  470. elseif args[1] == "np" then
  471. if args[2] then
  472. table.insert(queue, args[2])
  473. end
  474. elseif args[1] == "d" then
  475. if args[2] then
  476. WINS = tonumber(args[2])
  477. displayScore()
  478. end
  479. elseif args[1] == "añadir" and modo2b == "Deathmatch" then
  480. if args[2] then
  481. table.remove(args, 1)
  482. for index, player in pairs(args) do
  483. equipos[player] = player
  484. puntos[player] = 0
  485. playersInGame[player] = true
  486. end
  487. end
  488. elseif args[1] == "añadir" and modo2b == "normal" then
  489. if args[2] and args[3] then
  490. if args[2] == "team1" and modo2b == "normal" then
  491. table.remove(args, 1)
  492. table.remove(args, 1)
  493. for index, player in pairs(args) do
  494. player = string.title(player)
  495. table.insert(teams[1], player)
  496. playersInGame[player] = true
  497. end
  498. end
  499. if args[2] == "team2" and modo2b == "normal" then
  500. table.remove(args, 1)
  501. table.remove(args, 1)
  502. for index, player in pairs(args, 3) do
  503. player = string.title(player)
  504. table.insert(teams[2], player)
  505. playersInGame[player] = true
  506. end
  507. end
  508. if args[2] == "team3" and modo2b == "normal" then
  509. table.remove(args, 1)
  510. table.remove(args, 1)
  511. for index, player in pairs(args) do
  512. player = string.title(player)
  513. table.insert(teams[3], player)
  514. playersInGame[player] = true
  515. end
  516. end
  517. if args[2] == "team4" and modo2b == "normal" then
  518. table.remove(args, 1)
  519. table.remove(args, 1)
  520. for index, player in pairs(args) do
  521. player = string.title(player)
  522. table.insert(teams[4], player)
  523. playersInGame[player] = true
  524. end
  525. end
  526. if args[2] == "team5" and modo2b == "normal" then
  527. table.remove(args, 1)
  528. table.remove(args, 1)
  529. for index, player in pairs(args) do
  530. player = string.title(player)
  531. table.insert(teams[5], player)
  532. playersInGame[player] = true
  533. end
  534. end
  535. if args[2] == "team6" and modo2b == "normal" then
  536. table.remove(args, 1)
  537. table.remove(args, 1)
  538. for index, player in pairs(args) do
  539. player = string.title(player)
  540. table.insert(teams[6], player)
  541. playersInGame[player] = true
  542. end
  543. end
  544. if args[2] == "team7" and modo2b == "normal" then
  545. table.remove(args, 1)
  546. table.remove(args, 1)
  547. for index, player in pairs(args) do
  548. player = string.title(player)
  549. table.insert(teams[7], player)
  550. playersInGame[player] = true
  551. end
  552. end
  553. if args[2] == "team8" and modo2b == "normal" then
  554. table.remove(args, 1)
  555. table.remove(args, 1)
  556. for index, player in pairs(args) do
  557. player = string.title(player)
  558. table.insert(teams[8], player)
  559. playersInGame[player] = true
  560. end
  561. end
  562. end
  563. elseif args[1] == "quitar" then
  564. if args[2] then
  565. for index, player in pairs(args) do
  566. player = string.title(player)
  567. playersInGame[player] = false
  568. end
  569. end
  570. elseif args[1] == "reset" then
  571. teams[1] = {}
  572. points[1] = 0
  573. teams[2] = {}
  574. points[2] = 0
  575. teams[3] = {}
  576. points[3] = 0
  577. teams[4] = {}
  578. points[4] = 0
  579. teams[5] = {}
  580. points[5] = 0
  581. teams[6] = {}
  582. points[6] = 0
  583. teams[7] = {}
  584. points[7] = 0
  585. teams[8] = {}
  586. points[8] = 0
  587. equipos = {}
  588. puntos = {}
  589. modob = "racing"
  590. modo = "bootcamp"
  591. modo2 = "Deathmatch"
  592. modo2b = "normal"
  593. displayTeams()
  594.  
  595.  
  596. elseif args[1] == "puntos" and modo2b == "normal" then
  597. if args[2] and args[3] then
  598. local team = tonumber(args[2]:match("team(%d+)") or 0)
  599. if team > 0 and team < 5 then
  600. local newScore = tonumber(args[3]) or points[team]
  601. points[team] = newScore
  602. displayScore()
  603. end
  604. end
  605. elseif args[1] == "pausa" then
  606. gameRunning = not gameRunning
  607. if not gameRunning then
  608. ui.addTextArea(90, "", nil, 235, 200, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  609. ui.addTextArea(91, "<p align='center'><V> Juego pausado ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
  610. tfm.exec.disableAutoTimeLeft(true)
  611. else
  612. ui.removeTextArea(90)
  613. ui.removeTextArea(91)
  614. tfm.exec.disableAutoTimeLeft(false)
  615. end
  616. end
  617. end
  618. end
  619. function eventNewGame()
  620. if gameRunning then
  621. if modo2b == "normal" then
  622. isfirst = false
  623. for i, p in pairs(teams[1]) do
  624. tfm.exec.setNameColor(p, "0x"..colors[1])
  625. end
  626. for i, p in pairs(teams[2]) do
  627. tfm.exec.setNameColor(p, "0x"..colors[2])
  628. end
  629. for i, p in pairs(teams[3]) do
  630. tfm.exec.setNameColor(p, "0x"..colors[3])
  631. end
  632. for i, p in pairs(teams[4]) do
  633. tfm.exec.setNameColor(p, "0x"..colors[4])
  634. end
  635. for i, p in pairs(teams[5]) do
  636. tfm.exec.setNameColor(p, "0x"..colors[5])
  637. end
  638. for i, p in pairs(teams[6]) do
  639. tfm.exec.setNameColor(p, "0x"..colors[6])
  640. end
  641. for i, p in pairs(teams[7]) do
  642. tfm.exec.setNameColor(p, "0x"..colors[7])
  643. end
  644. for i, p in pairs(teams[8]) do
  645. tfm.exec.setNameColor(p, "0x"..colors[8])
  646. end
  647. displayScore()
  648. end
  649. if modo2b == "Deathmatch" then
  650. isfirst = false
  651. for k,players in pairs(tfm.get.room.playerList) do
  652. tfm.exec.setNameColor(k, "0xff0000")
  653. equipoc[k] = "0x324650"
  654. end
  655. displayScore()
  656. end
  657. end
  658. end
  659. function displayScore()
  660. if modo2b == "normal" then
  661. if modoazar == "true" then
  662. ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> x <font color='#%s'>%s <N> / <font color='#111111'>%s", colors[1], points[1], colors[2], points[2], WINS), nil, 0, 22, 800, 30, 0, 0, 0, true)
  663. end
  664. if modoazar == "false" then
  665. ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> x <font color='#%s'>%s <N> x <font color='#%s'>%s <N> x <font color='#%s'>%s <N> x <font color='#%s'>%s <N> x <font color='#%s'>%s <N> x <font color='#%s'>%s <N> x <font color='#%s'>%s <N> / <font color='#111111'>%s", colors[1], points[1], colors[2], points[2], colors[3], points[3], colors[4], points[4], colors[5], points[5], colors[6], points[6], colors[7], points[7], colors[8], points[8], WINS), nil, 0, 22, 800, 30, 0, 0, 0, true)
  666. end
  667. end
  668. end
  669. function displayScoreDeathmatch()
  670. resetmostrarjugadoresdeathmatch()
  671. ui.addTextArea(300, string.format("<p align='center'><V>Deathmatch a %s puntos",WINS), nil, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
  672. for k,players in pairs(tfm.get.room.playerList) do
  673. if puntos[k] then
  674. equipos[k] = k
  675. playersInGame[k] = true
  676. if textareaid >= 32 then
  677. else
  678. ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), nil, distanciax, distanciay, 140, 18, equipoc[k], 0x000000, 1, true)
  679. distanciay = distanciay + 37
  680. textareaid = textareaid + 1
  681. textarealugar = textarealugar + 1
  682. if textareaid == 8 then
  683. distanciax = distanciax + 190
  684. distanciay = 80
  685. textareaid = 0
  686. end
  687. end
  688. end
  689. end
  690. end
  691. function borrarScoreDeathmatch()
  692. for i = 300, 334 do
  693. ui.removeTextArea(i)
  694. end
  695. end
  696. function displayTeams()
  697. borrarScoreDeathmatch()
  698. modoazar = "false"
  699. ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  700. ui.addTextArea(37, "<p align='center'><V>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  701. ui.addTextArea(2, "", nil, 0, 71, 800, 295, 0x0E1417, 0x0E1417, 1, true)
  702. ui.addTextArea(4, "", nil, 57, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  703. ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 58, 80, 140, 20, 0x324650, 0x324650, 1, true)
  704. ui.addTextArea(6, "", nil, 227, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  705. ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 228, 80, 140, 20, 0x324650, 0x324650, 1, true)
  706. ui.addTextArea(8, "", nil, 417, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  707. ui.addTextArea(9, "<p align='center'><V>Team 3", nil, 418, 80, 140, 20, 0x324650, 0x324650, 1, true)
  708. ui.addTextArea(10, "", nil, 587, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  709. ui.addTextArea(11, "<p align='center'><V>Team 4", nil, 588, 80, 140, 20, 0x324650, 0x324650, 1, true)
  710. ui.addTextArea(73, "", nil, 57, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  711. ui.addTextArea(68, "<p align='center'><V>Team 5", nil, 58, 230, 140, 20, 0x324650, 0x324650, 1, true)
  712. ui.addTextArea(69, "", nil, 227, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  713. ui.addTextArea(70, "<p align='center'><V>Team 6", nil, 228, 230, 140, 20, 0x324650, 0x324650, 1, true)
  714. ui.addTextArea(71, "", nil, 417, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  715. ui.addTextArea(72, "<p align='center'><V>Team 7", nil, 418, 230, 140, 20, 0x324650, 0x324650, 1, true)
  716. ui.addTextArea(77, "", nil, 587, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  717. ui.addTextArea(74, "<p align='center'><V>Team 8", nil, 588, 230, 140, 20, 0x324650, 0x324650, 1, true)
  718. ui.addTextArea(12, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
  719. ui.addTextArea(39, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
  720. ui.addTextArea(40, "", nil, 59, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  721. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 90, 0x324650, 0x324650, 1, true)
  722. ui.addTextArea(32, "", nil, 419, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  723. ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 90, 0x324650, 0x324650, 1, true)
  724. ui.addTextArea(34, "", nil, 589, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  725. ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 90, 0x324650, 0x324650, 1, true)
  726. ui.addTextArea(36, "", nil, 229, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  727. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 90, 0x324650, 0x324650, 1, true)
  728. ui.addTextArea(76, "", nil, 59, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  729. ui.addTextArea(62, "<p align='center'><font color='#"..colors[5].."'>"..table.concat(teams[5], "\n"), nil, 60, 270, 138, 90, 0x324650, 0x324650, 1, true)
  730. ui.addTextArea(63, "", nil, 419, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  731. ui.addTextArea(64, "<p align='center'><font color='#"..colors[7].."'>"..table.concat(teams[7], "\n"), nil, 420, 270, 138, 90, 0x324650, 0x324650, 1, true)
  732. ui.addTextArea(65, "", nil, 589, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  733. ui.addTextArea(66, "<p align='center'><font color='#"..colors[8].."'>"..table.concat(teams[8], "\n"), nil, 590, 270, 138, 90, 0x324650, 0x324650, 1, true)
  734. ui.addTextArea(67, "", nil, 229, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  735. ui.addTextArea(75, "<p align='center'><font color='#"..colors[6].."'>"..table.concat(teams[6], "\n"), nil, 230, 270, 138, 90, 0x324650, 0x324650, 1, true)
  736. ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 325, 206, 140, 200, 0, 0, 0, true)
  737. ui.addTextArea(15, "", nil, 374, 211, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  738. ui.addTextArea(16, "<p align='center'><V>VS", nil, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
  739. ui.addTextArea(42, "", ADMINISTRADOR, 749, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  740. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", ADMINISTRADOR, 750, 82, 38, 18, 0x324650, 0x324650, 1, true)
  741. ui.addTextArea(45, "", ADMINISTRADOR, 744, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  742. ui.addTextArea(46, "<p align='center'><V><a href='event:reset'>Reset", ADMINISTRADOR, 745, 140, 50, 18, 0x324650, 0x324650, 1, true)
  743. ui.addTextArea(47, "", ADMINISTRADOR, 741, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  744. ui.addTextArea(54, "", ADMINISTRADOR, 741, 209, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  745. if modo2 == "Deathmatch" then
  746. ui.addTextArea(51, "<p align='center'><V><a href='event:Deathmatch'><font size='8'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
  747. end
  748. verificarmodo()
  749. ui.addTextArea(53, "", ADMINISTRADOR, 741, 245, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  750. ui.addTextArea(56, "<p align='center'><V><a href='event:llenar'><font size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
  751. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
  752. ui.addTextArea(57, "", ADMINISTRADOR, 741, 281, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  753. ui.addTextArea(58, "<p align='center'><V><a href='event:azart'><font size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
  754. ui.addTextArea(59, "<p align='center'><V><a href='event:azart'><font size='12'>teams", ADMINISTRADOR, 742, 290, 55, 23, 0x000000, 0x000000, 1, true)
  755. ui.addTextArea(60, "<p align='center'><V><a href='event:azart'><font size='12'>Azar 2", ADMINISTRADOR, 742, 278, 55, 23, 0x000000, 0x000000, 1, true)
  756. end
  757. function verificarmodo()
  758. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  759. if modo2 == "normal" then
  760. ui.addTextArea(51, "<p align='center'><V><a href='event:normal'><font size='8'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
  761. end
  762. if modo == "bootcamp" then
  763. ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  764. end
  765. if modo == "racing" then
  766. ui.addTextArea(48, "<p align='center'><V><a href='event:racing'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  767. end
  768. if modo == "mix" then
  769. ui.addTextArea(48, "<p align='center'><V><a href='event:mix'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  770. end
  771. end
  772. function contarjugadores()
  773. local players=0
  774. function eventNewPlayer(name)--Cuando un jugador entre a la sala...
  775. players=players+1--Sumamos 1 a nuestra tabla
  776. end
  777. function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
  778. players=players-1--Restamos 1 a nuestra tabla
  779. end
  780. for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
  781. eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
  782. end
  783. end
  784. function eventTextAreaCallback(id, player, callback)
  785. if callback == 'iniciarJogo' then
  786. gameRunning = true
  787. for i = 1, 20 do
  788. ui.removeTextArea(i)
  789. end
  790. for i = 26, 77 do
  791. ui.removeTextArea(i)
  792. end
  793. borrarScoreDeathmatch()
  794. newMap()
  795. if modo2b == "normal" then
  796. points[1] = 0
  797. points[2] = 0
  798. points[3] = 0
  799. points[4] = 0
  800. points[5] = 0
  801. points[6] = 0
  802. points[7] = 0
  803. points[8] = 0
  804. displayScore()
  805. end
  806. if modo2b == "Deathmatch" then
  807. for k,v in pairs(tfm.get.room.playerList) do
  808. puntos[k] = 0
  809. end
  810. end
  811. end
  812. if callback == 'salir' then
  813. tfm.system.exit()
  814. end
  815.  
  816. if callback == 'llenar' then
  817. nteam = 1
  818. azar = {}
  819. playersInGame = {}
  820.  
  821. teams = {
  822. [1] = {},
  823. [2] = {},
  824. [3] = {},
  825. [4] = {},
  826. [5] = {},
  827. [6] = {},
  828. [7] = {},
  829. [8] = {},
  830. }
  831. contarjugadores()
  832. for k,players in pairs(tfm.get.room.playerList) do
  833. if nteam > 8 then
  834. nteam = 1
  835. end
  836. table.insert(teams[nteam], k)
  837. playersInGame[k] = true
  838. nteam = nteam + 1
  839. displayTeams()
  840. end
  841. end
  842.  
  843.  
  844.  
  845. if callback == 'reset' then
  846. teams[1] = {}
  847. points[1] = 0
  848. teams[2] = {}
  849. points[2] = 0
  850. teams[3] = {}
  851. points[3] = 0
  852. teams[4] = {}
  853. points[4] = 0
  854. teams[5] = {}
  855. points[5] = 0
  856. teams[6] = {}
  857. points[6] = 0
  858. teams[7] = {}
  859. points[7] = 0
  860. teams[8] = {}
  861. points[8] = 0
  862. equipos = {}
  863. puntos = {}
  864. modob = "racing"
  865. modo = "bootcamp"
  866. modo2 = "Deathmatch"
  867. modo2b = "normal"
  868. displayTeams()
  869.  
  870. end
  871. if callback == 'bootcamp' then
  872. tiempo = 150
  873. modob = "bootcamp"
  874. modo = "mix"
  875. verificarmodo()
  876. maps = mapasbootcamp
  877. end
  878. if callback == 'racing' then
  879.  
  880. tiempo = 60
  881. modob = "racing"
  882. modo = "bootcamp"
  883. verificarmodo()
  884. maps = mapasracing
  885. end
  886. if callback == 'mix' then
  887. tiempo = 90
  888. modob = "mix"
  889. modo = "racing"
  890. verificarmodo()
  891. maps = mapasmix
  892. end
  893. if callback == 'Deathmatch' then
  894. modo2b = "Deathmatch"
  895. modo2 = "normal"
  896. displayTeams()
  897. for i = 4, 15 do
  898. ui.removeTextArea(i)
  899. end
  900. for i = 31, 36 do
  901. ui.removeTextArea(i)
  902. end
  903. for i = 39, 40 do
  904. ui.removeTextArea(i)
  905. end
  906. ui.removeTextArea(53)
  907. ui.removeTextArea(56)
  908. contarjugadores()
  909. for k,players in pairs(tfm.get.room.playerList) do
  910. equipos[k] = k
  911. puntos[k] = 0
  912. equipoc[k] = "0x324650"
  913. playersInGame[k] = true
  914. if textareaid >= 32 then
  915. else
  916. ui.addTextArea(textarealugar, "<p align='center'><V>"..k, nil, distanciax, distanciay, 140, 18, 0x324650, 0x324650, 1, true)
  917. distanciay = distanciay + 37
  918. textareaid = textareaid + 1
  919. textarealugar = textarealugar + 1
  920. if textareaid == 8 then
  921. distanciax = distanciax + 190
  922. distanciay = 80
  923. textareaid = 0
  924. end
  925. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  926. end
  927. end
  928. end
  929. if callback == 'normal' then
  930. modo2b = "normal"
  931. modo2 = "Deathmatch"
  932. resetmostrarjugadoresdeathmatch()
  933. displayTeams()
  934. end
  935. if callback == 'cerrarpuntaje' then
  936. borrarScoreDeathmatch()
  937. end
  938. if callback == 'azart' then
  939. totales = 0
  940. totales2 = 0
  941. jugando = {}
  942. totaljugando = 1
  943. jugandoposicion = {}
  944. playersInGame = {}
  945. teams[1] = {}
  946. teams[2] = {}
  947. teams[3] = {}
  948. teams[4] = {}
  949. teams[5] = {}
  950. teams[6] = {}
  951. teams[7] = {}
  952. teams[8] = {}
  953. alazar()
  954. borrarScoreDeathmatch()
  955. modoazar = "true"
  956. modoalazar()
  957. end
  958. if callback == 'volver' then
  959. totales = 0
  960. totales2 = 0
  961. jugando = {}
  962. totaljugando = 1
  963. jugandoposicion = {}
  964. playersInGame = {}
  965. teams[1] = {}
  966. teams[2] = {}
  967. teams[3] = {}
  968. teams[4] = {}
  969. teams[5] = {}
  970. teams[6] = {}
  971. teams[7] = {}
  972. teams[8] = {}
  973. displayTeams()
  974. end
  975. if callback == 'bootcamp2' then
  976. tiempo = 150
  977. modob = "bootcamp"
  978. modo = "mix"
  979. verificarmodo2()
  980. maps = mapasbootcamp
  981. end
  982. if callback == 'racing2' then
  983.  
  984. tiempo = 60
  985. modob = "racing"
  986. modo = "bootcamp"
  987. verificarmodo2()
  988. maps = mapasracing
  989. end
  990. if callback == 'mix2' then
  991. tiempo = 90
  992. modob = "mix"
  993. modo = "racing"
  994. verificarmodo2()
  995. maps = mapasmix
  996. end
  997. end
  998. function alazar()
  999. t = 0
  1000. for k,v in pairs(tfm.get.room.playerList) do
  1001. if t == 1 then
  1002. table.insert(teams[2], k)
  1003. playersInGame[k] = true
  1004. t = 0
  1005. elseif t == 0 then
  1006. table.insert(teams[1], k)
  1007. playersInGame[k] = true
  1008. t = 1
  1009. end
  1010. end
  1011. end
  1012.  
  1013. function verificarmodo2()
  1014. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  1015. if modo == "bootcamp" then
  1016. ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1017. end
  1018. if modo == "racing" then
  1019. ui.addTextArea(48, "<p align='center'><V><a href='event:racing2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1020. end
  1021. if modo == "mix" then
  1022. ui.addTextArea(48, "<p align='center'><V><a href='event:mix2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1023. end
  1024. end
  1025. function string.split(s, pattern, n)
  1026. local st = {}
  1027. for sb in string.gmatch(s, "[^"..pattern.."]+") do
  1028. if not n or n > -1 then
  1029. table.insert(st,sb)
  1030. else
  1031. st[#st] = st[#st]..pattern..sb
  1032. end
  1033. n = n and n-1 or false
  1034. end
  1035. return st
  1036. end
  1037. function table.contains(tableT, element)
  1038. for _, value in pairs(tableT) do
  1039. if value == element then
  1040. return true
  1041. end
  1042. end
  1043. return false
  1044. end
  1045. function eventPlayerDied()
  1046. local alive = 0
  1047. for k,v in pairs(tfm.get.room.playerList) do
  1048. if not v.isDead then
  1049. alive = alive+1
  1050. end
  1051. end
  1052. if alive == 0 then
  1053. newMap()
  1054. end
  1055. end
  1056. displayTeams()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement