Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- -----------------------------------------------------------------------------------]]
- local ADMINISTRADOR = "+Lknx#0000" --
- -----------------------------------------------------------------------------------]]
- --[[
- Comandos:
- !saltar - Para cambiar de mapa
- !puntos - Para cambiar el puntaje, ej: !puntos team1 5
- !np @codigo - Para poner cualquier mapa
- !pausar - Para pausar el juego
- !team - Para asignar jugadores a un equipo, ej: !team1 Kmo#7926
- !resultado NUMERO - Asigna el puntaje para ganar, ej: !d 20
- !añadir team nick - Añade un jugador a el equipo especificado, ej: !añadir team4 Kmo#7926
- !reiniciar - Resetea el juego
- !quitar NOMBRE - saca a un jugador del juego
- !puntaje - para ver el puntaje [SOLO EN MODO DEATHMATCH]
- --------------------------------------------------------------------
- ]]
- -----------------------------------------------------------------------------------
- local WINS = 20 -- Puntaje para ganar.
- ------------------------------------------------------------------------------------
- --[[
- ]]
- system.disableChatCommandDisplay("np", true)
- system.disableChatCommandDisplay("pausar", true)
- system.disableChatCommandDisplay("saltar", true)
- system.disableChatCommandDisplay("puntaje", true)
- system.disableChatCommandDisplay("team1", true)
- system.disableChatCommandDisplay("team2", true)
- system.disableChatCommandDisplay("team3", true)
- system.disableChatCommandDisplay("team4", true)
- system.disableChatCommandDisplay("team5", true)
- system.disableChatCommandDisplay("team6", true)
- system.disableChatCommandDisplay("team7", true)
- system.disableChatCommandDisplay("team8", true)
- system.disableChatCommandDisplay("reiniciar", true)
- system.disableChatCommandDisplay("resultado", true)
- system.disableChatCommandDisplay("añadir", true)
- system.disableChatCommandDisplay("quitar", true)
- system.disableChatCommandDisplay("puntos", true)
- tfm.exec.disablePhysicalConsumables()
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoTimeLeft()
- local teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- local points = {
- [1] = 0,
- [2] = 0,
- [3] = 0,
- [4] = 0,
- [5] = 0,
- [6] = 0,
- [7] = 0,
- [8] = 0,
- }
- local equipos = {}
- local puntos = {}
- local maxPlayers = 200
- local modob = "racing"
- local modo = "bootcamp"
- local modo2 = "Deathmatch"
- local modo2b = "burlas"
- local tiempo = 120
- tonumber(tiempo)
- local isfirst = false
- local gameRunning = false
- local winTime = false
- local playersInGame = {}
- local distanciax = 30
- local distanciay = 80
- local textarealugar = 300
- local textareaid = 0
- 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}
- 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}
- local mapasracing =
- {7650244,7650262,7650264,7650266,7650267,7650268,7650271,7650273,7650274,7650278,7650279,7650280,7650281,7650282,7650283,7650286,7650289,7650291,7650292,7650293,7650295,7650297,7650298,7650300,7650303,7650304,7650306,7650307,7650309,7650310,7650311,7650314,7650316,7650317,7650320,7650321,7650323,7650325,7650327,7650329,7650331,7650333,7650335,7650336,7650338,7650339,7650341,7650342,7650344,7650347,7650349,7650350,7650352,7650354,7650356,7650359,7650360,7650361,7650362,7650363,7650366,7650367,7650370,7650371,7650372,7650374,7650375,7650377,7650378,7650379,7650380,7650381,7650384,7650385}
- local maps = mapasracing
- local equipoc= {}
- local colors = {
- [1] = "FF0000",
- [2] = "003AFF",
- [3] = "00FF04",
- [4] = "FF9E00",
- [5] = "FBFF00",
- [6] = "AE00FF",
- [7] = "FF0097",
- [8] = "060606",
- }
- local queue = {}
- local nteam = 1
- local azar = {}
- local posicion = {}
- local modoazar = ""
- local numeroposicion = 1
- local totales = 0
- local totales2 = 0
- local jugando = {}
- local totaljugando = 1
- local jugandoposicion = {}
- function newMap()
- local mapcode = maps[math.random(#maps)]
- if #queue > 0 then
- mapcode = queue[1]
- table.remove(queue, 1)
- end
- ui.removeTextArea(100, nil)
- tfm.exec.newGame(mapcode)
- tfm.exec.setUIMapName("")
- for player, data in pairs(tfm.get.room.playerList) do
- if not playersInGame[player] then
- tfm.exec.killPlayer(player)
- end
- end
- tfm.exec.setGameTime(tiempo)
- if modo2b == "Deathmatch" then
- borrarScoreDeathmatch()
- end
- end
- function modoalazar()
- ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(37, "<p align='center'><font face='Century Gothic'><font size='12'>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(2, "", nil, 142, 71, 516, 290, 0x0E1417, 0x0E1417, 1, true)
- ui.addTextArea(4, "", nil, 231, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(5, "<p align='center'><font face='Century Gothic'><font size='11'>Equipo 1", nil, 232, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(6, "", nil, 399, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(7, "<p align='center'><font face='Century Gothic'><font size='11'>Equipo 2", nil, 400, 80, 140, 20, 0x324650, 0x324650, 1, true)
- for i=8, 11 do
- ui.removeTextArea(i)
- end
- ui.addTextArea(40, "", nil, 231, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 232, 121, 138, 198, 0x324650, 0x324650, 1, true)
- for i=32, 35 do
- ui.removeTextArea(i)
- end
- ui.addTextArea(36, "", nil, 399, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 400, 121, 138, 198, 0x324650, 0x324650, 1, true)
- ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 320, 197, 140, 200, 0, 0, 0, true)
- ui.addTextArea(15, "", nil, 367, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'>VS", nil, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(42, "", ADMINISTRADOR, 600, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(41, "<p align='center'><font face='Century Gothic'><a href='event:salir'>X", ADMINISTRADOR, 601, 82, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(45, "", ADMINISTRADOR, 600, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(46, "<p align='center'><font face='Century Gothic'><a href='event:reset'>Reiniciar", ADMINISTRADOR, 601, 140, 50, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(47, "", ADMINISTRADOR, 600, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'><a href='event:iniciarJogo'>Iniciar", ADMINISTRADOR, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(57, "", ADMINISTRADOR, 600, 207, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(58, "<p align='center'><font face='Century Gothic'><a href='event:volver'><font size='11'>8 Teams", ADMINISTRADOR, 601, 208, 55, 23, 0x324650, 0x324650, 1, true)
- ui.removeTextArea(59)
- ui.removeTextArea(60)
- ui.removeTextArea(53)
- ui.removeTextArea(51)
- ui.removeTextArea(54)
- ui.addTextArea(56, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>Azar", ADMINISTRADOR, 601, 246, 55, 18, 0x324650, 0x324650, 1, true)
- verificarmodo2()
- end
- function eventPlayerWon(player)
- if not isfirst then
- isfirst = true
- tfm.exec.setGameTime(3)
- if modo2b == "Deathmatch" then
- if puntos[player] >= WINS - 1 then
- gameRunning = false
- winTime = os.time()
- ui.addTextArea(29, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>%s ganó", player), nil, 3, 168, 800, 500, 0, 0, 0, true)
- ui.addTextArea(30, string.format("<p align='center'><font face='Century Gothic'><font size='37'><font color='#cecece'><font color='#ff0000'>%s </font>ganó", player), nil, 1, 170, 800, 500, 0, 0, 0, true)
- ui.addTextArea(16, "<p align='center'><font color='#225066' size='18' face='Impact'><a href='event:iniciarJogo'>DE NUEVO", ADMINISTRADOR, 350, 270, 100, 20, 0xFFFFFF, 0xFFFFFF, 1, true)
- end
- tfm.exec.setGameTime(3)
- puntos[player] = puntos[player]+1
- equipoc[player] = "0x115b17"
- displayScoreDeathmatch()
- end
- if modo2b == "burlas" then
- if table.contains(teams[1], player) then
- tfm.exec.setGameTime(3)
- points[1] = points[1]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#FF0000'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'><font face='Century Gothic'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[2], player) then
- tfm.exec.setGameTime(3)
- points[2] = points[2]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#003AFF'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[3], player) then
- tfm.exec.setGameTime(3)
- points[3] = points[3]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#00FF04'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[4], player) then
- tfm.exec.setGameTime(3)
- points[4] = points[4]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#FF9E00'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[5], player) then
- tfm.exec.setGameTime(3)
- points[5] = points[5]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#FBFF00'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[6], player) then
- tfm.exec.setGameTime(3)
- points[6] = points[6]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#AE00FF'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[7], player) then
- tfm.exec.setGameTime(3)
- points[7] = points[7]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#FF0097'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- elseif table.contains(teams[8], player) then
- tfm.exec.setGameTime(3)
- points[8] = points[8]+1
- ui.addTextArea(100, "<p align='center'><font size='20' color='#060606'><font face='Century Gothic'>¡" ..player .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
- else
- isfirst = false
- end
- winner = false
- if points[1] >= WINS then
- winner = 1
- elseif points[2] >= WINS then
- winner = 2
- elseif points[3] >= WINS then
- winner = 3
- elseif points[4] >= WINS then
- winner = 4
- elseif points[5] >= WINS then
- winner = 5
- elseif points[6] >= WINS then
- winner = 6
- elseif points[7] >= WINS then
- winner = 7
- elseif points[8] >= WINS then
- winner = 8
- end
- if winner then
- gameRunning = false
- winTime = os.time()
- local names = {
- "rojo",
- "azul",
- "verde",
- "naranja",
- "amarillo",
- "morado",
- "rosado",
- "negro",
- }
- ui.addTextArea(26, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 0, 171, 800, 500, 0, 0, 0, true)
- ui.addTextArea(27, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
- ui.addTextArea(28, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 2, 169, 800, 500, 0, 0, 0, true)
- ui.addTextArea(29, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 3, 168, 800, 500, 0, 0, 0, true)
- ui.addTextArea(30, string.format("<p align='center'><font face='Century Gothic'><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)
- ui.addTextArea(16, "<p align='center'><font color='#225066' size='15' face='Century Gothic'><a href='event:iniciarJogo'>REVANCHA", ADMINISTRADOR, 350, 270, 100, 20, 0xFFFFFF, 0xFFFFFF, 1, true)
- end
- displayScore()
- end
- end
- end
- function eventLoop(elapsed, remain)
- if gameRunning then
- remain = remain/1000
- if remain < 0 then
- remain = 100
- newMap()
- end
- else
- if winTime then
- if winTime > os.time()-30000 then
- else
- winTime = false
- ui.removeTextArea(26)
- ui.removeTextArea(27)
- ui.removeTextArea(28)
- ui.removeTextArea(29)
- ui.removeTextArea(30)
- displayTeams()
- teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- points = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- playersInGame = {}
- end
- end
- end
- end
- function string.title(s)
- return string.gsub(s, "%a", function(c)
- return string.upper(c)
- end, 1)
- end
- function resetmostrarjugadoresdeathmatch()
- distanciax = 30
- distanciay = 80
- textarealugar = 302
- textareaid = 0
- end
- function eventChatCommand(player, command)
- if modo2b == "Deathmatch" then
- args = string.split(command, " ")
- if args[1] == "puntaje" then
- resetmostrarjugadoresdeathmatch()
- ui.addTextArea(300, "<p align='center'><V><a href='event:cerrarpuntaje'>X", player, 30, 50, 30, 16, 0x324650, 0x324650, 1, true)
- ui.addTextArea(301, string.format("<p align='center'><V>Todos a %s puntos",WINS), player, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
- for k,players in pairs(tfm.get.room.playerList) do
- if puntos[k] then
- equipos[k] = k
- playersInGame[k] = true
- if textareaid >= 32 then
- else
- ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), player, distanciax, distanciay, 140, 18, 0x324650, 0x000000, 1, true)
- distanciay = distanciay + 37
- textareaid = textareaid + 1
- textarealugar = textarealugar + 1
- if textareaid == 8 then
- distanciax = distanciax + 190
- distanciay = 80
- textareaid = 0
- end
- end
- end
- end
- end
- end
- if player:lower() == ADMINISTRADOR:lower() then
- args = string.split(command, " ")
- if args[1] == "team1" then
- if modo2b == "burlas" then
- table.remove(args, 1)
- teams[1] = {}
- points[1] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[1], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- end
- elseif args[1] == "team2" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[2] = {}
- points[2] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[2], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team3" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[3] = {}
- points[3] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[3], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team4" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[4] = {}
- points[4] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[4], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team5" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[5] = {}
- points[5] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[5], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team6" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[6] = {}
- points[6] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[6], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team7" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[7] = {}
- points[7] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[7], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team8" and modo2b == "burlas" then
- table.remove(args, 1)
- teams[8] = {}
- points[8] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[8], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "saltar" then
- newMap()
- elseif args[1] == "np" then
- if args[2] then
- table.insert(queue, args[2])
- end
- elseif args[1] == "resultado" then
- if args[2] then
- WINS = tonumber(args[2])
- displayScore()
- end
- elseif args[1] == "añadir" and modo2b == "Deathmatch" then
- if args[2] then
- table.remove(args, 1)
- for index, player in pairs(args) do
- equipos[player] = player
- puntos[player] = 0
- playersInGame[player] = true
- end
- end
- elseif args[1] == "añadir" and modo2b == "burlas" then
- if args[2] and args[3] then
- if args[2] == "team1" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[1], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team2" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args, 3) do
- player = string.title(player)
- table.insert(teams[2], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team3" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[3], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team4" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[4], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team5" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[5], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team6" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[6], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team7" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[7], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team8" and modo2b == "burlas" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[8], player)
- playersInGame[player] = true
- end
- end
- end
- elseif args[1] == "quitar" then
- if args[2] then
- for index, player in pairs(args) do
- player = string.title(player)
- playersInGame[player] = false
- end
- end
- elseif args[1] == "reiniciar" then
- teams[1] = {}
- points[1] = 0
- teams[2] = {}
- points[2] = 0
- teams[3] = {}
- points[3] = 0
- teams[4] = {}
- points[4] = 0
- teams[5] = {}
- points[5] = 0
- teams[6] = {}
- points[6] = 0
- teams[7] = {}
- points[7] = 0
- teams[8] = {}
- points[8] = 0
- equipos = {}
- puntos = {}
- modob = "racing"
- modo = "bootcamp"
- modo2 = "Deathmatch"
- modo2b = "burlas"
- displayTeams()
- elseif args[1] == "puntos" and modo2b == "burlas" then
- if args[2] and args[3] then
- local team = tonumber(args[2]:match("team(%d+)") or 0)
- if team > 0 and team < 5 then
- local newScore = tonumber(args[3]) or points[team]
- points[team] = newScore
- displayScore()
- end
- end
- elseif args[1] == "pausar" then
- gameRunning = not gameRunning
- if not gameRunning then
- ui.addTextArea(90, "", nil, 235, 200, 302, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(91, "<p align='center'><font face='Century Gothic'> El juego ha sido pausado ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
- tfm.exec.disableAutoTimeLeft(true)
- else
- ui.removeTextArea(90)
- ui.removeTextArea(91)
- tfm.exec.disableAutoTimeLeft(false)
- end
- end
- end
- end
- function eventNewGame()
- if gameRunning then
- tfm.exec.setUIMapName("")
- if modo2b == "burlas" then
- isfirst = false
- for i, p in pairs(teams[1]) do
- tfm.exec.setNameColor(p, "0x"..colors[1])
- end
- for i, p in pairs(teams[2]) do
- tfm.exec.setNameColor(p, "0x"..colors[2])
- end
- for i, p in pairs(teams[3]) do
- tfm.exec.setNameColor(p, "0x"..colors[3])
- end
- for i, p in pairs(teams[4]) do
- tfm.exec.setNameColor(p, "0x"..colors[4])
- end
- for i, p in pairs(teams[5]) do
- tfm.exec.setNameColor(p, "0x"..colors[5])
- end
- for i, p in pairs(teams[6]) do
- tfm.exec.setNameColor(p, "0x"..colors[6])
- end
- for i, p in pairs(teams[7]) do
- tfm.exec.setNameColor(p, "0x"..colors[7])
- end
- for i, p in pairs(teams[8]) do
- tfm.exec.setNameColor(p, "0x"..colors[8])
- end
- displayScore()
- end
- if modo2b == "Deathmatch" then
- isfirst = false
- for k,players in pairs(tfm.get.room.playerList) do
- tfm.exec.setNameColor(k, "0xff0000")
- equipoc[k] = "0x324650"
- end
- displayScore()
- end
- end
- end
- function displayScore()
- if modo2b == "burlas" then
- if modoazar == "true" then
- ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> - <font color='#%s'>%s <N> (Ganar) <font color='#111111'>%s", colors[1], points[1], colors[2], points[2], WINS), nil, 0, 22, 800, 30, 0, 0, 0, true)
- end
- if modoazar == "false" then
- ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> (Ganar) <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)
- end
- end
- end
- function displayScoreDeathmatch()
- resetmostrarjugadoresdeathmatch()
- ui.addTextArea(300, string.format("<p align='center'><font face='Century Gothic'>Competitivo a %s puntos",WINS), nil, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
- for k,players in pairs(tfm.get.room.playerList) do
- if puntos[k] then
- equipos[k] = k
- playersInGame[k] = true
- if textareaid >= 32 then
- else
- ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), nil, distanciax, distanciay, 140, 18, equipoc[k], 0x000000, 1, true)
- distanciay = distanciay + 37
- textareaid = textareaid + 1
- textarealugar = textarealugar + 1
- if textareaid == 8 then
- distanciax = distanciax + 190
- distanciay = 80
- textareaid = 0
- end
- end
- end
- end
- end
- function borrarScoreDeathmatch()
- for i = 300, 334 do
- ui.removeTextArea(i)
- end
- end
- system.bindMouse("+Lknx#0000", true)
- function eventMouse(name, x, y)
- tfm.exec.movePlayer(name,x,y,false,0,0,true)
- end
- function displayTeams()
- borrarScoreDeathmatch()
- modoazar = "false"
- ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(37, "<p align='center'><font face='Century Gothic'><font size='12'>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(2, "", nil, 0, 71, 800, 295, 0x0E1417, 0x0E1417, 1, true)
- ui.addTextArea(4, "", nil, 57, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(5, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 1", nil, 58, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(6, "", nil, 227, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(7, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 2", nil, 228, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(8, "", nil, 417, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(9, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 3", nil, 418, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(10, "", nil, 587, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(11, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 4", nil, 588, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(73, "", nil, 57, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(68, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 5", nil, 58, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(69, "", nil, 227, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(70, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 6", nil, 228, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(71, "", nil, 417, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(72, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 7", nil, 418, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(77, "", nil, 587, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(74, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 8", nil, 588, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(12, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
- ui.addTextArea(39, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
- ui.addTextArea(40, "", nil, 59, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(32, "", nil, 419, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(34, "", nil, 589, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(36, "", nil, 229, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(76, "", nil, 59, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(62, "<p align='center'><font color='#"..colors[5].."'>"..table.concat(teams[5], "\n"), nil, 60, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(63, "", nil, 419, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(64, "<p align='center'><font color='#"..colors[7].."'>"..table.concat(teams[7], "\n"), nil, 420, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(65, "", nil, 589, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(66, "<p align='center'><font color='#"..colors[8].."'>"..table.concat(teams[8], "\n"), nil, 590, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(67, "", nil, 229, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(75, "<p align='center'><font color='#"..colors[6].."'>"..table.concat(teams[6], "\n"), nil, 230, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 325, 206, 140, 200, 0, 0, 0, true)
- ui.addTextArea(15, "", nil, 374, 211, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'>VS", nil, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(42, "", ADMINISTRADOR, 749, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(41, "<p align='center'><font face='Century Gothic'><a href='event:salir'>X", ADMINISTRADOR, 750, 82, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(45, "", ADMINISTRADOR, 744, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(46, "<p align='center'><font face='Century Gothic'><a href='event:reset'>Reiniciar", ADMINISTRADOR, 745, 140, 50, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(47, "", ADMINISTRADOR, 741, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(54, "", ADMINISTRADOR, 741, 209, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- if modo2 == "Deathmatch" then
- ui.addTextArea(51, "<p align='center'><font face='Century Gothic'><a href='event:Deathmatch'><font size='12'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
- end
- verificarmodo()
- ui.addTextArea(53, "", ADMINISTRADOR, 741, 245, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(56, "<p align='center'><font face='Century Gothic'><a href='event:llenar'><font size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'><a href='event:iniciarJogo'>Inicia", ADMINISTRADOR, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(57, "", ADMINISTRADOR, 741, 281, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(58, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
- ui.addTextArea(59, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>teams", ADMINISTRADOR, 742, 290, 55, 23, 0x000000, 0x000000, 1, true)
- ui.addTextArea(60, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>Azar 2", ADMINISTRADOR, 742, 278, 55, 23, 0x000000, 0x000000, 1, true)
- end
- function verificarmodo()
- ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
- if modo2 == "burlas" then
- ui.addTextArea(51, "<p align='center'><font face='Century Gothic'><a href='event:burlas'><font size='12'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
- end
- if modo == "bootcamp" then
- ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:bootcamp'><font size='12'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- if modo == "racing" then
- ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:racing'><font size='12'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- if modo == "mix" then
- ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:mix'><font size='12'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- end
- function contarjugadores()
- local players=0
- function eventNewPlayer(name)--Cuando un jugador entre a la sala...
- players=players+1--Sumamos 1 a nuestra tabla
- end
- function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
- players=players-1--Restamos 1 a nuestra tabla
- end
- for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
- eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
- end
- end
- function eventTextAreaCallback(id, player, callback)
- if callback == 'iniciarJogo' then
- gameRunning = true
- for i = 1, 20 do
- ui.removeTextArea(i)
- end
- for i = 26, 77 do
- ui.removeTextArea(i)
- end
- borrarScoreDeathmatch()
- newMap()
- if modo2b == "burlas" then
- points[1] = 0
- points[2] = 0
- points[3] = 0
- points[4] = 0
- points[5] = 0
- points[6] = 0
- points[7] = 0
- points[8] = 0
- displayScore()
- end
- if modo2b == "Deathmatch" then
- for k,v in pairs(tfm.get.room.playerList) do
- puntos[k] = 0
- end
- end
- end
- if callback == 'salir' then
- tfm.system.exit()
- end
- if callback == 'llenar' then
- nteam = 1
- azar = {}
- playersInGame = {}
- teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- contarjugadores()
- for k,players in pairs(tfm.get.room.playerList) do
- if nteam > 8 then
- nteam = 1
- end
- table.insert(teams[nteam], k)
- playersInGame[k] = true
- nteam = nteam + 1
- displayTeams()
- end
- end
- if callback == 'reiniciar' then
- teams[1] = {}
- points[1] = 0
- teams[2] = {}
- points[2] = 0
- teams[3] = {}
- points[3] = 0
- teams[4] = {}
- points[4] = 0
- teams[5] = {}
- points[5] = 0
- teams[6] = {}
- points[6] = 0
- teams[7] = {}
- points[7] = 0
- teams[8] = {}
- points[8] = 0
- equipos = {}
- puntos = {}
- modob = "racing"
- modo = "bootcamp"
- modo2 = "Deathmatch"
- modo2b = "burlas"
- displayTeams()
- end
- if callback == 'bootcamp' then
- tiempo = 150
- modob = "bootcamp"
- modo = "mix"
- verificarmodo()
- maps = mapasbootcamp
- end
- if callback == 'racing' then
- tiempo = 60
- modob = "racing"
- modo = "bootcamp"
- verificarmodo()
- maps = mapasracing
- end
- if callback == 'mix' then
- tiempo = 90
- modob = "mix"
- modo = "racing"
- verificarmodo()
- maps = mapasmix
- end
- if callback == 'Deathmatch' then
- modo2b = "Deathmatch"
- modo2 = "burlas"
- displayTeams()
- for i = 4, 15 do
- ui.removeTextArea(i)
- end
- for i = 31, 36 do
- ui.removeTextArea(i)
- end
- for i = 39, 40 do
- ui.removeTextArea(i)
- end
- ui.removeTextArea(53)
- ui.removeTextArea(56)
- contarjugadores()
- for k,players in pairs(tfm.get.room.playerList) do
- equipos[k] = k
- puntos[k] = 0
- equipoc[k] = "0x324650"
- playersInGame[k] = true
- if textareaid >= 32 then
- else
- ui.addTextArea(textarealugar, "<p align='center'><V>"..k, nil, distanciax, distanciay, 140, 18, 0x324650, 0x324650, 1, true)
- distanciay = distanciay + 37
- textareaid = textareaid + 1
- textarealugar = textarealugar + 1
- if textareaid == 8 then
- distanciax = distanciax + 190
- distanciay = 80
- textareaid = 0
- end
- ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
- end
- end
- end
- if callback == 'burlas' then
- modo2b = "burlas"
- modo2 = "Deathmatch"
- resetmostrarjugadoresdeathmatch()
- displayTeams()
- end
- if callback == 'cerrarpuntaje' then
- borrarScoreDeathmatch()
- end
- if callback == 'azart' then
- totales = 0
- totales2 = 0
- jugando = {}
- totaljugando = 1
- jugandoposicion = {}
- playersInGame = {}
- teams[1] = {}
- teams[2] = {}
- teams[3] = {}
- teams[4] = {}
- teams[5] = {}
- teams[6] = {}
- teams[7] = {}
- teams[8] = {}
- alazar()
- borrarScoreDeathmatch()
- modoazar = "true"
- modoalazar()
- end
- if callback == 'volver' then
- totales = 0
- totales2 = 0
- jugando = {}
- totaljugando = 1
- jugandoposicion = {}
- playersInGame = {}
- teams[1] = {}
- teams[2] = {}
- teams[3] = {}
- teams[4] = {}
- teams[5] = {}
- teams[6] = {}
- teams[7] = {}
- teams[8] = {}
- displayTeams()
- end
- if callback == 'bootcamp2' then
- tiempo = 150
- modob = "bootcamp"
- modo = "mix"
- verificarmodo2()
- maps = mapasbootcamp
- end
- if callback == 'racing2' then
- tiempo = 60
- modob = "racing"
- modo = "bootcamp"
- verificarmodo2()
- maps = mapasracing
- end
- if callback == 'mix2' then
- tiempo = 90
- modob = "mix"
- modo = "racing"
- verificarmodo2()
- maps = mapasmix
- end
- end
- function alazar()
- t = 0
- for k,v in pairs(tfm.get.room.playerList) do
- if t == 1 then
- table.insert(teams[2], k)
- playersInGame[k] = true
- t = 0
- elseif t == 0 then
- table.insert(teams[1], k)
- playersInGame[k] = true
- t = 1
- end
- end
- end
- function verificarmodo2()
- ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
- if modo == "bootcamp" then
- ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:bootcamp2'><font size='12'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- if modo == "racing" then
- ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:racing2'><font size='12'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- if modo == "mix" then
- ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:mix2'><font size='12'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- end
- function string.split(s, pattern, n)
- local st = {}
- for sb in string.gmatch(s, "[^"..pattern.."]+") do
- if not n or n > -1 then
- table.insert(st,sb)
- else
- st[#st] = st[#st]..pattern..sb
- end
- n = n and n-1 or false
- end
- return st
- end
- function table.contains(tableT, element)
- for _, value in pairs(tableT) do
- if value == element then
- return true
- end
- end
- return false
- end
- function eventPlayerDied()
- local alive = 0
- for k,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- alive = alive+1
- end
- end
- if alive == 0 then
- newMap()
- end
- end
- displayTeams()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement