Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.32 KB | None | 0 0
  1. --[[
  2. __ __ __ ___ __ _ __ __ ____
  3. / / / / / / / _ | / / | | / / _/_/ / __/
  4. / /__/ /_/ / / __ | / / | |/ / _/_/ _\ \
  5. /____/\____/ /_/ |_| / / |___/ /_/ /___/
  6. /_/
  7. _____ _ _ _ _
  8. |_ _| | || | | | | |
  9. | | _ __ ___ | || | ___ __ _ _ __ __| | ___ | | ___
  10. | | | '__| / _ \ | || | / _ \ / _` || '_ \ / _` | / _ \ | | / _ \
  11. | | | | | (_) || || || __/| (_| || | | || (_| || (_) || || (_) |
  12. \_/ |_| \___/ |_||_| \___| \__,_||_| |_| \__,_| \___/ |_| \___/
  13. TRADUZIDO BY: CAUADOMAL
  14. -------------------------------------------------------------------
  15. Nome do administrador "L3v3#6066"
  16. -------------------------------------------------------------------
  17. Comandos:
  18. !prox - Para pular de mapa
  19. !pontos - Para trocar de pontos do time, ex: !pontos team1 5
  20. !np @codigo - Para por qualquer mapa
  21. !pausa - Para pausar o jogo
  22. !time - Para atribuir jogadores a uma equipe, ex: !time Trolleandolo
  23. !d NUMERO - poe a pontuação para ganhar, ex: !d 20
  24. !adicionar team nick - Adicione um jogador à equipe especifica ex:!adicionar team4 Trolleandolo
  25. !resetar - resetara o jogo
  26. !expulsar TEAM nome - expulsa um jogador de algum time
  27. !ponto - para ver a pontuação [Somente no modo Sozinho]
  28. --------------------------------------------------------------------
  29. ]]
  30. -----------------------------------------------------------------------------------
  31. -----------------------------------------------------------------------------------
  32. local Admin = "Gowther#6862" -- Poe seu nome para ser o ADMINISTRADOR
  33. -----------------------------------------------------------------------------------
  34. -----------------------------------------------------------------------------------
  35. local WINS = 20 -- Pontuação para ganhar.
  36. ------------------------------------------------------------------------------------
  37. system.disableChatCommandDisplay("np", true)
  38. system.disableChatCommandDisplay("pause", true)
  39. system.disableChatCommandDisplay("saltar", true)
  40. system.disableChatCommandDisplay("puntaje", true)
  41. tfm.exec.disablePhysicalConsumables()
  42. tfm.exec.disableAutoShaman()
  43. tfm.exec.disableAutoNewGame()
  44. tfm.exec.disableAutoTimeLeft()
  45. local teams = {
  46. [1] = {},
  47. [2] = {},
  48. [3] = {},
  49. [4] = {},
  50. }
  51. local points = {
  52. [1] = 0,
  53. [2] = 0,
  54. [3] = 0,
  55. [4] = 0,
  56. }
  57. local equipos = {}
  58. local puntos = {}
  59. local modob = "racing"
  60. local modo = "Bootcamp"
  61. local modo2 = "Sozinho"
  62. local modo2b = "normal"
  63. local tiempo = 180
  64. tonumber(tiempo)
  65. local isfirst = true
  66. local gameRunning = false
  67. local winTime = false
  68. local playersInGame = {}
  69. local distanciax = 30
  70. local distanciay = 80
  71. local textarealugar = 300
  72. local textareaid = 0
  73. local mapasmix = {7102662,157805,157004,156720,6640846,151655,150651,149422,124000,203664,375455,394132,170514,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,186066,152260,155628,166805,178297,313138,167903,223947,191177,113156,150664,157203,163159,197229,204647,163531,232675,216173,166361,169059,271411,277824,306365,172520,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}
  74. local mapasBootcamp= {157960,157805,157004,156720,153996,151655,150651,149422,124000,203664,375455,394132,170514,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,186066,152260,155628,166805,178297,313138,167903,223947,191177,113156,150664,157203,163159,197229,204647,163531,232675,216173,166361,169059,271411,277824,306365,172520}
  75. local mapasracing = {7643135,7643145,7643995,7643992,7644002,7644004,7643999,7643998,7643978,7643996,7643989,7643991,7643987,7643985,7643982,7643983,7643984,7643977,7643975,7643336,7643347,7643334,7643236,7643331,7643210,7643239,7643237,7643227,7643234,7643226,7643225,7643222,7643223,7643208,7643221,7643220,7643217,7643216,7643204,7643207,7643206,7643203,7643205,7643144,7643143,7643200,7643199,7643197,7643140,7643196,7643195,7643139,7643194,7643191,7643214,7643213,7643218,7643138,7643231,7643232,7643233,7643212,7643230,7643229,7643219,7643190,7643187,7643350,7643186,7643137}
  76. local maps = mapasracing
  77. local equipoc= {}
  78. local colors = {
  79. [1] = "FFFFFF",
  80. [2] = "0000FF",
  81. [3] = "FEFF00",
  82. [4] = "FF0000",
  83. }
  84. local queue = {}
  85. local nteam = 1
  86. local Sair = {}
  87. local posicion = {}
  88. local numeroposicion = 1
  89. function newMap()
  90. local mapcode = maps[math.random(#maps)]
  91. if #queue > 0 then
  92. mapcode = queue[1]
  93. table.remove(queue, 1)
  94. end
  95. tfm.exec.newGame(mapcode)
  96. for player, data in pairs(tfm.get.room.playerList) do
  97. if not playersInGame[player] then
  98. tfm.exec.killPlayer(player)
  99. end
  100. end
  101. tfm.exec.setGameTime(tiempo)
  102. borrarScoreSozinho()
  103. end
  104. function eventPlayerWon(player)
  105. if not isfirst then
  106. isfirst = true
  107. tfm.exec.setGameTime(3)
  108. if modo2b == "Sozinho" then
  109. if puntos[player] >= WINS - 1 then
  110. gameRunning = false
  111. winTime = os.time()
  112. 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)
  113. 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)
  114. end
  115. tfm.exec.setGameTime(3)
  116. for i = 0, 3 do
  117. defaultEffect(9, {13}, math.random(800), math.random(400), 20)
  118. end
  119. puntos[player] = puntos[player]+1
  120. equipoc[player] = "0x115b17"
  121. displayScoreSozinho()
  122. end
  123. if modo2b == "normal" then
  124. if table.contains(teams[1], player) then
  125. tfm.exec.setGameTime(3)
  126. for i = 0, 3 do
  127. defaultEffect(9, {13}, math.random(800), math.random(400), 20)
  128. end
  129. points[1] = points[1]+1
  130. elseif table.contains(teams[2], player) then
  131. tfm.exec.setGameTime(3)
  132. for i = 0, 3 do
  133. defaultEffect(9, {9}, math.random(800), math.random(400), 20)
  134. end
  135. points[2] = points[2]+1
  136. elseif table.contains(teams[3], player) then
  137. tfm.exec.setGameTime(3)
  138. for i = 0, 3 do
  139. defaultEffect(9, {9}, math.random(800), math.random(400), 20)
  140. end
  141. points[3] = points[3]+1
  142. elseif table.contains(teams[4], player) then
  143. tfm.exec.setGameTime(3)
  144. for i = 0, 3 do
  145. defaultEffect(9, {9}, math.random(800), math.random(400), 20)
  146. end
  147. points[4] = points[4]+1
  148. else
  149. isfirst = false
  150. end
  151. winner = false
  152. if points[1] >= WINS then
  153. winner = 1
  154. elseif points[2] >= WINS then
  155. winner = 2
  156. elseif points[3] >= WINS then
  157. winner = 3
  158. elseif points[4] >= WINS then
  159. winner = 4
  160. end
  161. if winner then
  162. gameRunning = false
  163. winTime = os.time()
  164. local names = {
  165. "Time filters",
  166. "Time nofilter",
  167. "Time regedit",
  168. "Time teclado gamer",
  169. }
  170. ui.addTextArea(26, string.format("<p align='center'><font size='37' color='#000000'GJ para o Time Branco ganharam o x1", names[winner]), nil, 0, 171, 800, 500, 0, 0, 0, true)
  171. ui.addTextArea(27, string.format("<p align='center'><font size='37' color='#000000'>GJ para o %s ganharam o x1", names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  172. ui.addTextArea(28, string.format("<p align='center'><font size='37' color='#000000'>GJ para o %s ganharam o x1", names[winner]), nil, 2, 169, 800, 500, 0, 0, 0, true)
  173. ui.addTextArea(29, string.format("<p align='center'><font size='37' color='#000000'>GJ para o %s ganharam o x1", names[winner]), nil, 3, 168, 800, 500, 0, 0, 0, true)
  174. ui.addTextArea(30, string.format("<p align='center'><font size='37'><font color='#cecece'>GJ para o <font color='#%s'>%s</font> ganharam o x1", colors[winner], names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  175. end
  176. displayScore()
  177. end
  178. end
  179. end
  180. function eventLoop(elapsed, remain)
  181. if gameRunning then
  182. remain = remain/1000
  183. if remain < 0 then
  184. remain = 100
  185. newMap()
  186. end
  187. else
  188. if winTime then
  189. if winTime > os.time()-30000 then
  190. for i = 0, 2 do
  191. defaultEffect(9, {11, 9, 0, 13}, math.random(800), math.random(400), 80)
  192. end
  193. else
  194. winTime = false
  195. ui.removeTextArea(26)
  196. ui.removeTextArea(27)
  197. ui.removeTextArea(28)
  198. ui.removeTextArea(29)
  199. ui.removeTextArea(30)
  200. displayTeams()
  201. teams = {
  202. [1] = {},
  203. [2] = {},
  204. [3] = {},
  205. [4] = {},
  206. }
  207. points = {
  208. [1] = 0,
  209. [2] = 0,
  210. [3] = 0,
  211. [4] = 0,
  212. }
  213. playersInGame = {}
  214. end
  215. end
  216. end
  217. end
  218. function string.title(s)
  219. return string.gsub(s, "%a", function(c)
  220. return string.upper(c)
  221. end, 1)
  222. end
  223. function resetarmostrarjugadoresSozinho()
  224. distanciax = 30
  225. distanciay = 80
  226. textarealugar = 302
  227. textareaid = 0
  228. end
  229. function eventChatCommand(player, command)
  230. if modo2b == "Sozinho" then
  231. args = string.split(command, " ")
  232. if args[1] == "puntaje" then
  233. resetarmostrarjugadoresSozinho()
  234. ui.addTextArea(300, "<p align='center'><V><a href='event:cerrarpuntaje'>X", player, 30, 50, 30, 16, FF0000, FF0000, 1, true)
  235. ui.addTextArea(301, string.format("<p align='center'><V>Sozinho a %s puntos",WINS), player, 80, 45, 180, 18, FF0000, FF0000, 1, true)
  236. for k,players in pairs(tfm.get.room.playerList) do
  237. if puntos[k] then
  238. equipos[k] = k
  239. playersInGame[k] = true
  240. if textareaid >= 32 then
  241. else
  242. ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), player, distanciax, distanciay, 140, 18, FF0000, FF0000, 1, true)
  243. distanciay = distanciay + 37
  244. textareaid = textareaid + 1
  245. textarealugar = textarealugar + 1
  246. if textareaid == 8 then
  247. distanciax = distanciax + 190
  248. distanciay = 80
  249. textareaid = 0
  250. end
  251. end
  252. end
  253. end
  254. end
  255. end
  256. if player:lower() == Admin:lower() then
  257. args = string.split(command, " ")
  258. if args[1] == "team1" then
  259. if modo2b == "normal" then
  260. table.remove(args, 1)
  261. teams[1] = {}
  262. points[1] = 0
  263. for index, player in pairs(args) do
  264. player = string.title(player)
  265. table.insert(teams[1], player)
  266. playersInGame[player] = true
  267. end
  268. displayTeams()
  269. end
  270. elseif args[1] == "team2" and modo2b == "normal" then
  271. table.remove(args, 1)
  272. teams[2] = {}
  273. points[2] = 0
  274. for index, player in pairs(args) do
  275. player = string.title(player)
  276. table.insert(teams[2], player)
  277. playersInGame[player] = true
  278. end
  279. displayTeams()
  280. elseif args[1] == "team3" and modo2b == "normal" then
  281. table.remove(args, 1)
  282. teams[3] = {}
  283. points[3] = 0
  284. for index, player in pairs(args) do
  285. player = string.title(player)
  286. table.insert(teams[3], player)
  287. playersInGame[player] = true
  288. end
  289. displayTeams()
  290. elseif args[1] == "team4" and modo2b == "normal" then
  291. table.remove(args, 1)
  292. teams[4] = {}
  293. points[4] = 0
  294. for index, player in pairs(args) do
  295. player = string.title(player)
  296. table.insert(teams[4], player)
  297. playersInGame[player] = true
  298. end
  299. displayTeams()
  300. elseif args[1] == "prox" then
  301. newMap()
  302. elseif args[1] == "np" then
  303. if args[2] then
  304. table.insert(queue, args[2])
  305. end
  306. elseif args[1] == "d" then
  307. if args[2] then
  308. WINS = tonumber(args[2])
  309. displayScore()
  310. end
  311. elseif args[1] == "adicionar" and modo2b == "Sozinho" then
  312. if args[2] then
  313. table.remove(args, 1)
  314. for index, player in pairs(args) do
  315. equipos[player] = player
  316. puntos[player] = 0
  317. playersInGame[player] = true
  318. end
  319. end
  320. elseif args[1] == "adicionar" and modo2b == "normal" then
  321. if args[2] and args[3] then
  322. if args[2] == "team1" and modo2b == "normal" then
  323. table.remove(args, 1)
  324. table.remove(args, 1)
  325. for index, player in pairs(args) do
  326. player = string.title(player)
  327. table.insert(teams[1], player)
  328. playersInGame[player] = true
  329. end
  330. end
  331. if args[2] == "team2" and modo2b == "normal" then
  332. table.remove(args, 1)
  333. table.remove(args, 1)
  334. for index, player in pairs(args, 3) do
  335. player = string.title(player)
  336. table.insert(teams[2], player)
  337. playersInGame[player] = true
  338. end
  339. end
  340. if args[2] == "team3" and modo2b == "normal" then
  341. table.remove(args, 1)
  342. table.remove(args, 1)
  343. for index, player in pairs(args) do
  344. player = string.title(player)
  345. table.insert(teams[3], player)
  346. playersInGame[player] = true
  347. end
  348. end
  349. if args[2] == "team4" and modo2b == "normal" then
  350. table.remove(args, 1)
  351. table.remove(args, 1)
  352. for index, player in pairs(args) do
  353. player = string.title(player)
  354. table.insert(teams[4], player)
  355. playersInGame[player] = true
  356. end
  357. end
  358. end
  359. elseif args[1] == "expulsar" then
  360. if args[2] then
  361. for index, player in pairs(args) do
  362. player = string.title(player)
  363. playersInGame[player] = false
  364. end
  365. end
  366. elseif args[1] == "resetar" then
  367. teams[1] = {}
  368. points[1] = 0
  369. teams[2] = {}
  370. points[2] = 0
  371. teams[3] = {}
  372. points[3] = 0
  373. teams[4] = {}
  374. points[4] = 0
  375. displayTeams()
  376. elseif args[1] == "pontos" and modo2b == "normal" then
  377. if args[2] and args[3] then
  378. local team = tonumber(args[2]:match("team(%d+)") or 0)
  379. if team > 0 and team < 5 then
  380. local newScore = tonumber(args[3]) or points[team]
  381. points[team] = newScore
  382. displayScore()
  383. end
  384. end
  385. elseif args[1] == "pausa" then
  386. gameRunning = not gameRunning
  387. if not gameRunning then
  388. ui.addTextArea(90, "", nil, 235, 200, 302, 22, FF0000, FF0000, 1, true)
  389. ui.addTextArea(91, "<p align='center'><V> Juego pausado ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
  390. tfm.exec.disableAutoTimeLeft(true)
  391. else
  392. ui.removeTextArea(90)
  393. ui.removeTextArea(91)
  394. tfm.exec.disableAutoTimeLeft(false)
  395. end
  396. end
  397. end
  398. end
  399. function eventNewGame()
  400. tfm.exec.setUIMapName("<font color='#D91F42'>L3V3 BURLAS</font>")
  401. if modo2b == "normal" then
  402. if gameRunning then
  403. isfirst = false
  404. for i, p in pairs(teams[1]) do
  405. tfm.exec.setNameColor(p, "0x"..colors[1])
  406. end
  407. for i, p in pairs(teams[2]) do
  408. tfm.exec.setNameColor(p, "0x"..colors[2])
  409. end
  410. for i, p in pairs(teams[3]) do
  411. tfm.exec.setNameColor(p, "0x"..colors[3])
  412. end
  413. for i, p in pairs(teams[4]) do
  414. tfm.exec.setNameColor(p, "0x"..colors[4])
  415. end
  416. displayScore()
  417. end
  418. end
  419. if modo2b == "Sozinho" then
  420. if gameRunning then
  421. isfirst = false
  422. for k,players in pairs(tfm.get.room.playerList) do
  423. tfm.exec.setNameColor(k, "FF0000")
  424. equipoc[k] = "FF0000"
  425. end
  426. displayScore()
  427. end
  428. end
  429. end
  430. function displayScore()
  431. if modo2b == "normal" then
  432. 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> / <font color='FF0000'>%s", colors[1], points[1], colors[2], points[2], colors[3], points[3], colors[4], points[4], WINS), nil, 0, 22, 800, 30, 0, 0, 0, true)
  433. end
  434. end
  435. function displayScoreSozinho()
  436. resetarmostrarjugadoresSozinho()
  437. ui.addTextArea(300, string.format("<p align='center'><V>Sozinho a %s puntos",WINS), nil, 80, 45, 180, 18, FF0000, FF0000, 1, true)
  438. for k,players in pairs(tfm.get.room.playerList) do
  439. if puntos[k] then
  440. equipos[k] = k
  441. playersInGame[k] = true
  442. if textareaid >= 32 then
  443. else
  444. ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), nil, distanciax, distanciay, 140, 18, equipoc[k], FF0000, 1, true)
  445. distanciay = distanciay + 37
  446. textareaid = textareaid + 1
  447. textarealugar = textarealugar + 1
  448. if textareaid == 8 then
  449. distanciax = distanciax + 190
  450. distanciay = 80
  451. textareaid = 0
  452. end
  453. end
  454. end
  455. end
  456. end
  457. function borrarScoreSozinho()
  458. for i = 300, 340 do
  459. ui.removeTextArea(i)
  460. end
  461. end
  462. function displayTeams()
  463. ui.addTextArea(38, "", nil, 235, 30, 302, 22, FF0000, FF0000, 1, true)
  464. ui.addTextArea(37, "<p align='center'><V>Admin: "..Admin, nil, 235, 30, 300, 20, FF0000, FF0000, 1, true)
  465. --ui.addTextArea(1, "", nil, 400, 69, 400, 260, FF0000, FF0000, 1, true)
  466. ui.addTextArea(2, "", nil, 0, 71, 800, 290, FF0000, FF0000, 1, true)
  467. --ui.addTextArea(3, "", nil, 331, 70, 400, 260, FF0000, FF0000, 1, true)
  468. ui.addTextArea(4, "", nil, 57, 79, 142, 22, FF0000, FF0000, 1, true)
  469. ui.addTextArea(5, "<p align='center'><V>Time 1", nil, 58, 80, 140, 20, FF0000, FF0000, 1, true)
  470. ui.addTextArea(6, "", nil, 227, 79, 142, 22, FF0000, FF0000, 1, true)
  471. ui.addTextArea(7, "<p align='center'><V>Time 2", nil, 228, 80, 140, 20, FF0000, FF0000, 1, true)
  472. ui.addTextArea(8, "", nil, 417, 79, 142, 22, FF0000, FF0000, 1, true)
  473. ui.addTextArea(9, "<p align='center'><V>Time 3", nil, 418, 80, 140, 20, FF0000, FF0000, 1, true)
  474. ui.addTextArea(10, "", nil, 587, 79, 142, 22, FF0000, FF0000, 1, true)
  475. ui.addTextArea(11, "<p align='center'><V>Time 4", nil, 588, 80, 140, 20, FF0000, FF0000, 1, true)
  476. ui.addTextArea(12, "<p align='center'><font color='#FF0000'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
  477. ui.addTextArea(39, "<p align='center'><font color='#FF0000'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
  478. ui.addTextArea(40, "", nil, 59, 120, 140, 200, FF0000, FF0000, 1, true)
  479. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 198, FF0000, FF0000, 1, true)
  480. ui.addTextArea(32, "", nil, 419, 120, 140, 200, FF0000, FF0000, 1, true)
  481. ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 198, FF0000, FF0000, 1, true)
  482. ui.addTextArea(34, "", nil, 589, 120, 140, 200, FF0000, FF0000, 1, true)
  483. ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 198, FF0000, FF0000, 1, true)
  484. ui.addTextArea(36, "", nil, 229, 120, 140, 200, FF0000, FF0000, 1, true)
  485. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 198, FF0000, FF0000, 1, true)
  486. ui.addTextArea(14, "<p align='center'><font color='#FF0000'>____ ____</font>", nil, 325, 197, 140, 200, 0, 0, 0, true)
  487. ui.addTextArea(15, "", nil, 374, 202, 40, 20, FF0000, FF0000, 1, true)
  488. ui.addTextArea(16, "<p align='center'><V>VS", nil, 375, 203, 38, 18, FF0000, FF0000, 1, true)
  489. ui.addTextArea(42, "", Admin, 749, 81, 40, 20, FF0000, FF0000, 1, true)
  490. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", Admin, 750, 82, 38, 18, FF0000, FF0000, 1, true)
  491. ui.addTextArea(45, "", Admin, 744, 139, 52, 20, FF0000, FF0000, 1, true)
  492. ui.addTextArea(46, "<p align='center'><V><a href='event:resetar'>resetar", Admin, 745, 140, 50, 18, FF0000, FF0000, 1, true)
  493. ui.addTextArea(47, "", Admin, 741, 173, 57, 20, FF0000, FF0000, 1, true)
  494. ui.addTextArea(54, "", Admin, 741, 209, 57, 20, FF0000, FF0000, 1, true)
  495. if modo2 == "Sozinho" then
  496. ui.addTextArea(51, "<p align='center'><V><a href='event:Sozinho'><font size='12'>"..modo2, Admin, 742, 210, 55, 18, FF0000, FF0000, 1, true)
  497. end
  498. verificarmodo()
  499. ui.addTextArea(53, "", Admin, 741, 245, 57, 20, FF0000, FF0000, 1, true)
  500. ui.addTextArea(52, "<p align='center'><V><a href='event:Sair'><font size='12'>Sair", Admin, 742, 246, 55, 18, FF0000, FF0000, 1, true)
  501. ui.addTextArea(55, "", Admin, 741, 279, 57, 20, FF0000, FF0000, 1, true)
  502. ui.addTextArea(56, "<p align='center'><V><a href='event:Times'><font size='12'>Times", Admin, 742, 280, 55, 18, FF0000, FF0000, 1, true)
  503. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'><font size='12'>GO", Admin, 375, 203, 38, 18, FF0000, FF0000, 1, true)
  504. end
  505. function verificarmodo()
  506. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, FF0000, FF0000, 1, true)
  507. if modo2 == "normal" then
  508. ui.addTextArea(51, "<p align='center'><V><a href='event:normal'><font size='8'>"..modo2, Admin, 742, 210, 55, 18, FF0000, FF0000, 1, true)
  509. end
  510. if modo == "Bootcamp" then
  511. ui.addTextArea(48, "<p align='center'><V><a href='event:Bootcamp'><font size='9'>"..modo, Admin, 742, 174, 55, 18, FF0000, FF0000, 1, true)
  512. end
  513. if modo == "racing" then
  514. ui.addTextArea(48, "<p align='center'><V><a href='event:racing'><font size='9'>"..modo, Admin, 742, 174, 55, 18, FF0000, FF0000, 1, true)
  515. end
  516. if modo == "mix" then
  517. ui.addTextArea(48, "<p align='center'><V><a href='event:mix'><font size='9'>"..modo, Admin, 742, 174, 55, 18, FF0000, FF0000, 1, true)
  518. end
  519. end
  520. function contarjugadores()
  521. local players=0
  522. function eventNewPlayer(name)--Cuando un jugador entre a la sala...
  523. players=players+1--Sumamos 1 a nuestra tabla
  524. end
  525. function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
  526. players=players-1--Restamos 1 a nuestra tabla
  527. end
  528. for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
  529. eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
  530. end
  531. end
  532. function eventTextAreaCallback(id, player, callback)
  533. if callback == 'iniciarJogo' then
  534. gameRunning = true
  535. for i = 1, 20 do
  536. ui.removeTextArea(i)
  537. end
  538. for i = 31, 56 do
  539. ui.removeTextArea(i)
  540. end
  541. borrarScoreSozinho()
  542. defaultEffect(9, {9}, 400, 212, 80)
  543. newMap()
  544. end
  545. if callback == 'salir' then
  546. tfm.system.exit()
  547. end
  548.  
  549. if callback == 'Times' then
  550. nteam = 1
  551. Sair = {}
  552. playersInGame = {}
  553.  
  554. teams = {
  555. [1] = {},
  556. [2] = {},
  557. [3] = {},
  558. [4] = {},
  559. }
  560. contarjugadores()
  561. for k,players in pairs(tfm.get.room.playerList) do
  562. if nteam > 4 then
  563. nteam = 1
  564. end
  565. table.insert(teams[nteam], k)
  566. playersInGame[k] = true
  567. nteam = nteam + 1
  568. displayTeams()
  569. end
  570. end
  571.  
  572. if callback == 'Sair' then
  573. nteam = 1
  574. Sair = {}
  575. playersInGame = {}
  576.  
  577. teams = {
  578. [1] = {},
  579. [2] = {},
  580. [3] = {},
  581. [4] = {},
  582. }
  583. contarjugadores()
  584.  
  585. for k,players in pairs(tfm.get.room.playerList) do
  586. Sair[k] = k
  587. playersInGame[k] = true
  588. end
  589.  
  590. for k,players in pairs(tfm.get.room.playerList) do
  591. if nteam > 4 then
  592. nteam = 1
  593. end
  594. if Sair[k] == k then
  595. jugador = Sair[math.random(#Sair)]
  596. table.insert(teams[players], jugador)
  597. Sair[k] = ""
  598. nteam = nteam + 1
  599. displayTeams()
  600. end
  601. end
  602.  
  603. end
  604.  
  605. if callback == 'resetar' then
  606. teams[1] = {}
  607. points[1] = 0
  608. teams[2] = {}
  609. points[2] = 0
  610. teams[3] = {}
  611. points[3] = 0
  612. teams[4] = {}
  613. points[4] = 0
  614. displayTeams()
  615. end
  616. if callback == 'Bootcamp' then
  617. tiempo = 150
  618. modob = "Bootcamp"
  619. modo = "mix"
  620. verificarmodo()
  621. maps = mapasBootcamp
  622. end
  623. if callback == 'racing' then
  624.  
  625. tiempo = 60
  626. modob = "racing"
  627. modo = "Bootcamp"
  628. verificarmodo()
  629. maps = mapasracing
  630. end
  631. if callback == 'mix' then
  632. tiempo = 90
  633. modob = "mix"
  634. modo = "racing"
  635. verificarmodo()
  636. maps = mapasmix
  637. end
  638. if callback == 'Sozinho' then
  639. modo2b = "Sozinho"
  640. modo2 = "normal"
  641. displayTeams()
  642. for i = 4, 15 do
  643. ui.removeTextArea(i)
  644. end
  645. for i = 31, 36 do
  646. ui.removeTextArea(i)
  647. end
  648. for i = 39, 40 do
  649. ui.removeTextArea(i)
  650. end
  651. contarjugadores()
  652. for k,players in pairs(tfm.get.room.playerList) do
  653. equipos[k] = k
  654. puntos[k] = 0
  655. equipoc[k] = "0x324650"
  656. playersInGame[k] = true
  657. if textareaid >= 32 then
  658. else
  659. ui.addTextArea(textarealugar, "<p align='center'><V>"..k, nil, distanciax, distanciay, 140, 18, FF0000, FF0000, 1, true)
  660. distanciay = distanciay + 37
  661. textareaid = textareaid + 1
  662. textarealugar = textarealugar + 1
  663. if textareaid == 8 then
  664. distanciax = distanciax + 190
  665. distanciay = 80
  666. textareaid = 0
  667. end
  668. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", Admin, 375, 203, 38, 18, FF0000, FF0000, 1, true)
  669. end
  670. end
  671. end
  672. if callback == 'normal' then
  673. modo2b = "normal"
  674. modo2 = "Sozinho"
  675. resetarmostrarjugadoresSozinho()
  676. displayTeams()
  677. end
  678. if callback == 'cerrarpuntaje' then
  679. borrarScoreSozinho()
  680. end
  681. end
  682. function string.split(s, pattern, n)
  683. local st = {}
  684. for sb in string.gmatch(s, "[^"..pattern.."]+") do
  685. if not n or n > -1 then
  686. table.insert(st,sb)
  687. else
  688. st[#st] = st[#st]..pattern..sb
  689. end
  690. n = n and n-1 or false
  691. end
  692. return st
  693. end
  694. function table.contains(tableT, element)
  695. for _, value in pairs(tableT) do
  696. if value == element then
  697. return true
  698. end
  699. end
  700. return false
  701. end
  702. defaultEffect=function(id,p,x,y,rand)
  703. local minDist = 1
  704. local outerBorder = 20
  705. local maxDist = 30
  706. local totalParticles = rand and 40 or (id == -1 and 35 or 75)
  707. for i = 1, totalParticles do
  708. if rand then
  709. id = p[math.random(#p)]
  710. end
  711. local dist = math.min(math.random(minDist, maxDist), outerBorder)
  712. local angle = math.random(0, 360)
  713. local r = math.rad(angle)
  714. local dx = math.cos(r)
  715. local dy = math.sin(r)
  716. local vx = dist * dx / 10
  717. local vy = dist * dy / 10
  718. local ax = -vx / dist / 15
  719. local ay = (-vy / dist / 15) + 0.05
  720. if id == -1 then
  721. tfm.exec.displayParticle(9, x + dx, y + dy, vx, vy, ax, ay, nil)
  722. tfm.exec.displayParticle(1, x + dx, y + dy, vx, vy, ax, ay, nil)
  723. else
  724. tfm.exec.displayParticle(id, x + dx, y + dy, vx, vy, ax, ay, nil)
  725. end
  726. end
  727. end
  728. displayTeams()
  729. function eventPlayerDied()
  730. local alive = 0
  731. for k,v in pairs(tfm.get.room.playerList) do
  732. if not v.isDead then
  733. alive = alive+1
  734. end
  735. end
  736. if alive == 0 then
  737. newMap()
  738. end
  739. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement