Sunteți pe pagina 1din 23

-----------------------------------------------------------------------------------

]]
local ADMINISTRADOR = "Gaki#1570" -- Cambia tu nombre para ser administrador
-----------------------------------------------------------------------------------
]]
--[[
Comandos:
!saltar - Para cambiar de mapa
!puntos - Para cambiar el puntaje, ej: !puntos team1 5
!np @codigo - Para poner cualquier mapa
!pausa - Para pausar el juego
!team - Para asignar jugadores a un equipo, ej: !team1 Trolleandolo
!d 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
Trolleandolo
!reset - Resetea el juego
!quitar NOMBRE - saca a un jugador del juego
!puntaje - para ver el puntaje [SOLO EN MODO DEATHMATCH]
--------------------------------------------------------------------
]]
-----------------------------------------------------------------------------------
local WINS = 15 -- Puntaje para ganar.
-----------------------------------------------------------------------------------
-
--[[
MEJORAS DE LA VERSI�N
[BOT�N REVANCHA EN DEATHMATCH Y TEAMS]
[SE QUIT� UN BUG]
[SE A�ADIERON MAPAS DE BURLAS]
[SE REDUJERON LAS PROBABILIDADES DE BUG]
[SE A�ADI� MODO 2 TEAMS AL AZAR]
]]

system.disableChatCommandDisplay()
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 modob = "racing"
local modo = "Burlas"
local modo2 = "Deathmatch"
local modo2b = "normal"
local tiempo = 60
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,33093
3,179488,172621,168754,159145,163596,152733,410040,158909,261814,195453,281985,1912
05,159932,2176211,586901,285589,257324,236768,303151,270924,1324259,1225867,563436,
424604,523270,172547,2693587,168204,2693344,193662,1788490,305680,149451,176253,342
035,2466489,292808,176615,438333,394125,162482,304861,458528,159298,184648,268915,3
29318,373105,261298,302080,449496,159187,176710,161023,366260,1852910,201172,549759
,257715,397478,261298,177652,408643,447805,155606,176619,460961,455271,172512,32060
7,166271,299942,150664,186066,152260,155628,166805,178297,313138,167903,223947,1911
77,185873,113156,156720,163159,197229,204647,163531,232675,216173,166361,169059,271
411,277824,306365,172520,157098,225744,608368,215933,266398,343875,327354,331344,33
3002,223174,332130,254785,295487,184817,159691,235717,169228,191203,503679,506032,2
747525,192255,208056,171480,182681,219956,270143,2887929,247329,250610,2118599,4451
33,149853,212903,220737,397296,2617003,629731,329627,221767,422655,417816,164931,24
5152,371072,2458243,214788,274963,2439335,269534,8679,321268,398041,5591416,5650343
,5650250,161730,4273207,4091580,5650303,5172709,5650469,214660,3579335,4003729,5084
51,314205,156510,5545443,606723,3946626,332467,1665516,1614563,3679884,414899,15313
88,905496,3834905,3821104,1851411,3816991,2331474,313245,266854,193588,2141379,3738
767,232791,285752,278506,406266,1976857,301315,180469,3693822,280896,403698,259604,
418022,323366,594883,477603,437860,590641,3688419,3682405,645288,419374,664949,7040
15,398942,195720,314159,613985,3683383,3683201,3680223,3680221,363625,1693705,31952
4,3667358,1718723,1490438,3630433,3620542,3617674,3556489,3548406,3548376,3408247,2
953315,2883986,2683170,2645615,2536577,2453022,2372538,2287914,2286056,2223685,2150
335,2150335,2101747,2018511,2007205,1975684,1964752,1964700,1956555,1923785,1862800
,1716949,1674534,1658171,1659639,1657360,1657021,1654105,1651658,1643157,1634741,16
32706,1622737,1619934,1618110,1613550,1612796,1612436,1608638,6212895,1602654,16014
92,1586439,1588884,1573997,1567620,1542618,1539791,1513407,1509474,1503393,1487161,
1450554,1425101,1394120,1393405,1373000,1371239,1368222,1359797,1358446,1352534,134
6440,1321664,1321417,1281981,1255130,1222899,1214182,1195842,1143815,1132357,105868
1,979179,829657,813156,798953,749102,737841,627609,624721,608459,616373,594049,6067
19,586688,580031,564033,558790,551126,545493,536235,528428,511275,508106,501711,496
945,496091,483924,472665,472379,447556,445133,444490,441047,438154,436447,436107,43
1373,430145,429822,428517,427300,425806,424795,422361,421302,420956,420806,418658,4
18600,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,35905
5,352885,352710,350251,344952,340069,339896,339643,337774,323600,319841,317754,3090
29,308711,308435,306213,292348,278916,277784,275514,270819,1017676,160762,2089069,2
34039,267187,263163,262144,330590,403698,396105,6538564,396105,419735,6547536,35565
8,6607378,191716,292348,6456247,5326916,6077025,356722,2564883,1450554,494706,25429
1,1503393,6467947,6263285,2953315,6114281,412752,4038817,5461992,319841,359901,1917
16,452016,1450554,397296,250610,499684,5848412,238791,2283,232274,1716693,330590,45
9349,6583596,455167,6460747,251459,244888,5755208,240973,235501,235034,234039,23339
8,232274,230510,216735,216439,216505,214037,212542,211565,198715,193936,191716,1866
04,180274,176263,178657,146801,145020,3154,2283,5382692,5249500,4412890,5163891,789
128,2245005,2030343,5712914,372401,5087373,4953687,2369254,4853690,226069,422509,54
36200,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,68545
36,6854539,6312173,6315208,6312203,6310370,6310383,6853060,6310440,6547670,7062105,
6545742,6985344,960547}
local
mapasBurlas={7610412,7551010,6967323,6967323,7608196,7602138,7602128,7602128,760252
7,7608201,7608192,7602193,7602100,7602115,7602550,7608172,7608160,7602553,7608273,7
608518,7602521,6119642,7602104,7608236,7608324,7608484,7602122,7602529,7602201,7610
088,7610115,7593270,7610109,7610103,7593275,7610106 ,
7610112,7610120,7593308,7293315,7587184,7590518,7372920,7372952,7372884,7467966,759
0520,7373778,7590533,7372977,7373491,7372909,7488706,7372895,7590519,7372870,748868
3,7467929,7373738,7488659,7373736,7373791,7488698,7372978,7488700,7593266,6894288,7
593305,7595894,7595896,7597626,7597630,7598929,7598933,7600223,7600226,7600228,7386
569,7596134,7600360,7601393,7591956,7596113,7592940,7597500,7600371,7600339,7600357
,7592439,7600361,7592432,7600378,7592662,7592953,7596124,7600830,7597522 ,
7600329,7600362,7597527,7592642,7592451,7592142,7592660,7592765,7592354,7373749,759
1132,7590527,7481567,7467939,7592971,7592129,7591945,7591944,7593080,7431358,737351
3,7591856,7591625,7592285,7596212,7596278,7596319,7596337,7596304,7596307,7596588,7
596581,7596567,7596276,7596325,7596277,7596580,7596574,7596273,7596314,7596568,7596
312,7591933,7594129,7591732,7592326,7596577,7596576,7594128,7592004,7591969,7594152
,7592015,7592026,7592028,7591735,7591711,7594122 ,
7592017,7591736,7591943,7591966,7592596,7591933,7594132,7591712,7594120,7591710,759
1702,7591676,7591670,7591673,7592589,7591445,7594137,7594139,7372968,7592594,759112
8,7587185,7590803,7590745,7592308,7590735,7592792,7592510,7591151,7592300,7591097,7
592725,7386817,7590838,7467923,7373726,7488711,7592287,7372968,7591128,7587185,7590
803,7590745,7592308,7590735,7592792,7592510,7591151,7591097,7592725,7386817,7590838
,7467923,7373726,7488711,7592287,7590837,7592489,7329536,7592514,7592820,7592313,75
91155,7591630,7488681,7591159,7591085,7592726,7590812,7590824}
local mapasracing =
{7025177,7046282,7047612,7049172,7053504,2283,2806,3154,72339,166705,237281,349389,
103182,107544,112790,114122,117548,120152,122911,124359,130763,136966,138036,138678
,407536,144468,144677,277731,146801,147436,148424,150692,152299,155168,156685,15684
7,6583596,159351,160762,161730,163682,164802,165112,165747,165843,5848412,167941,16
8776,380417,169892,171152,175205,176263,177236,177813,178545,178657,180191,180255,1
80274,180469,180509,180619,181312,184110,563303,185760,185774,186604,190026,191201,
191716,191753,192391,192566,193009,193588,193936,195720,196433,196468,197219,197501
,198549,198715,199219,201323,3679666,206810,208058,208162,208914,209315,209708,2097
99,210188,211528,211565,211885,212542,213331,213697,213933,214037,214660,214775,215
938,216439,216505,216553,216735,217282,217881,217900,219548,220500,222098,223293,22
3810,223986,224441,225017,226069,226879,226883,227417,227851,228462,229814,229827,2
29830,229834,229835,229944,230510,230741,231254,231694,231905,232140,232274,232451,
232699,232791,233230,233345,233398,233687,234039,234502,234959,235034,235501,235651
,236146,237000,237041,237263,237269,237278,237321,237744,238380,238791,239626,23988
0,240544,240548,240973,241211,241295,242708,243279,244006,244699,244888,245223,2467
90,246973,247815,247818,248098,250610,251459,252759,252806,253883,254291,255098,255
542,255893,258717,259604,259716,259833,260024,260292,260338,260377,260384,260678,26
1078,261172,261720,261959,262144,262212,262239,263163,263182,263624,263907,264132,2
64232,264348,235221,266704,266765,266807,266854,266913,266930,267187,267597,269337,
270668,270819,271523,273434,274321,275017,275514,277687,277784,278506,278916,279100
,279256,280382,280896,281730,282101,282434,282694,283526,283715,283874,284299,28575
2,286333,287268,289821,291628,292348,292614,293065,294522,294943,299002,299503,2997
1,300055,301315,302936,304356,305677,306213,308280,308435,308694,308711,308992,3090
29,309057,309169,309834,312713,313245,314159,314205,315801,316289,317696,317754,317
779,318378,318813,319524,319841,321339,321712,321814,321906,322771,323115,323366,32
3600,324355,326585,327254,327266,330441,332210,332290,332467,333277,333656,333837,3
35507,337581,337774,339272,339418,339643,339896,340069,340901,341116,341239,344361,
344865,344952,345257,245312,345943,348479,348801,349140,4581354,349984,350251,35051
9,352381,352710,352885,354616,354878,355658,355676,355769,355957,356722,356982,3573
28,357428,359055,359521,359901,360201,6414689,360273,360365,361382,362549,363411,36
3625,363638,363822,364186,364998,1512355,365464,365652,365774,365464,365652,365774,
367520,369160,369230,370444,370850,371076,371078,372970,373511,375381,378826,379326
,379550,379745,379866,381043,381287,381305,381569,381669,382977,384206,384869,38520
3,385295,386029,386046,386959,387012,387180,387270,387290,387638,388447,389582,3916
25,391693,391831,391868,391990,392446,392492,392913,393675,393851,394890,395459,395
585,395607,396223,396332,396347,396645,396861,397296,397501,397812,397938,398011,39
8041,398081,398942,399633,399673,400429,400666,400866,5886096,401778,401945,401995,
402214,402239,402453,402936,403698,403910,404440,404590,405075,405295,405339,405497
,405679,405833,405955,406266,406486,406881,406982,407165,407230,407294,407455,40745
7,407488,407495,6127809,407686,407746,408978,409199,410230,410532,410565,410608,410
736,410813,412211,412316,412657,412752,413408,414188,414460,414899,416015,416142,41
6552,418022,418196,418265,418293,418323,418337,418600,418606,418658,419374,419735,4
20806,420956,421302,421717,422361,422509,422580,422939,423062,423449,423517,423672,
424361,424786,424795,425030,425044,425215,425349,425548,425600,425771,425797,425806
,426638,427300,428517,429262,429822,429897,430145,430219,430736,431142,431373,43188
7,433937,434887,436041,436107,436447,437860,438154,440676,441047,441376,441598,4433
09,444490,444830,444964,445133,445219,447556,448281,452016,455167,459349,463195,463
977,465205,468260,470687,470727,471053,472379,472665,475151,475790,477370,477603,48
0023,483924,484992,494706,496091,496945,499109,499682,499684,499687,500074,501428,5
01711,501916,504409,504461,504704,504951,505109,505963,506215,507308,507325,508106,
508451,508796,509082,510194,511187,511275,512927,512291,514412,514510,514982,517005
,517697,523046,528428,531569,536235,537776,538116,545493,549470,551126,556253,55642
6,558790,563183,563484,564033,566347,566438,571144,580031,583056,586622,586688,5874
58,590641,594049,594883,595447,603381,606719,606723,608459,610137,611320,613985,616
373,616433,620996,624098,624721,627609,634945,645288,646800,658464,664949,667920,66
9031,670226,694900,704015,732880,734476,1445160,737841,749102,759128,763371,763378,
789058,792062,798953,813156,824082,829657,838069,846805,849224,879616,905496,972616
,976721,976786,979179,982242,1015436,1015582,1019378,1033170,1034035,1051378,105138
4,1058681,1085530,1102815,1130728,1132639,1142116,1143815,1144548,1162611,1167734,1
172426,1174107,1195842,1208798,1208979,1210037,1214182,1216253,1221661,1222899,1229
246,1231216,1234914,1249601,1252122,1253523,1255130,1255148,1256845,1281700,1281981
,1286910,1307880,1311059,1321417,1321664,1341396,1346440,1351308,1352534,1358446,13
59797,1364063,1368222,1368233,1371239,1371294,1372941,1373000,1373748,1375345,13782
09,1393405,1394120,1398732,1405249,1405496,1416040,1425101,1428436,1448760,1450554,
1453667,1471124,1483155,1487161,1490438,1491022,1492120,1495344,1503393,1504586,150
6007,1509474,1513407,1525272,1531388,1538895,1539515,1539791,1542618,1542736,155553
2,1555862,1556661,1564762,1567620,1573213,1571997,1580508,1583655,1586439,1587904,1
588884,1589026,1591471,1592767,1595600,1597594,1600443,1601492,1601786,1601857,1602
654,1603050,1605364,1608259,1608638,1609978,1611631,1612436,1612796,1613550,1613927
,1614563,1618110,1619934,1621611,1622737,1623300,1628732,1629164,1632294,1632541,16
32706,1632746,1634741,1637638,1639996,1643157,1644638,1646120,1648583,1651658,16540
96,1654105,1654841,1654903,1657021,1657360,1658171,1659639,1659716,1661852,1663380,
1663415,1665249,1665516,1665775,1669046,1673174,1674534,1675083,1687268,1689382,169
2628,1693705,1694602,1702169,1703617,1705316,1716693,1716949,1718723,1724289,172894
3,1749434,1751944,1759287,1768347,1778687,1787232,1787239,1794287,1802907,1841744,1
845710,1848032,1851411,1851568,1851968,1856349,1857829,1862800,1862823,1873736,1923
785,1924227,1926831,1927270,1932796,1951856,1952851,1954369,1954898,1956002,1956555
,1964700,1964752,1965819,1973574,1975275,1975286,1975684,1975753,1976007,1976857,19
79131,1982476,1985019,1987990,2005559,2007170,2007205,2012147,2018511,2023552,20303
43,3691622,2047177,2048474,2068543,2070768,2076632,2079190,2089069,2098621,2101747,
2106576,2118599,2134537,2138401,2141379,2144010,2149382,2150335,2174319,2176620,218
0790,2185089,2214661,2219308,2223685,2228834,2245005,2286056,2287914,2331474,234766
6,2372538,2378820,2393139,2417713,2453022,2509175,2536577,2538131,2557885,2564883,2
577060,2582610,2586491,2588032,2592421,5712914,2645615,2682985,2683170,2725924,2726
034,5834732,2796001,2813487,2816067,2840770,2854246,2868414,2883986,2894072,3816991
,2953315,2989266,2991507,3005251,3008155,3029580,3036416,3120368,3123384,3142015,31
56569,3175920,3209087,3213562,6041399,3267620,3347209,3408247,3444803,3447108,34533
51,3469987,3504036,3517347,3518418,3535192,3537419,3544895,3548376,3548378,3548406,
3549484,3549840,3556405,3556489,3556690,3572407,3574927,3575034,3575108,3575170,357
5216,3575293,3575425,3575463,3579335,3579476,3582577,3584275,3584689,3592471,359590
0,3603799,3603802,3603809,3604799,3607846,3611702,3611885,3613029,3617674,3620542,3
630433,3631748,3637041,3638794,3639993,3644272,3652003,3652102,3654416,3662698,3667
358,3668754,3670084,3676141,3676555,3679397,3778128,3679884,3680180,3680220,3680221
,3680223,3682405,3683201,3683224,3683294,3683383,3683393,3683520,3683600,3684229,36
84455,3684457,3684465,3684784,6300149,3685352,3685382,3685486,3688419,3690578,36916
09,3693822,3696662,3700684,3702767,3705931,3706599,3712183,3716560,3721990,3727755,
3728013,3737576,3738767,3778389,3799507,3799857,3799951,3801780,3816622,3818249,382
1104,3834905,3845214,3847244,3854268,3857914,3889414,3901403,3909339,3912540,394662
6,3948683,3953320,3953425,3967150,3967250,3970909,3984750,3985806,3999981,3992276,3
992671,3994471,4003729,5628991,4035194,4049042,6063528,4088129,4091580,6069537,4148
332,4174318,4174320,1250021,5249500,6070140,4234556,4238784,5495901,4323335,4344186
,5579236,5557858,4489653,4508416,4551993,4612295,3211576,4666540,4681759,5246345,46
85111,2571671,4707191,5867478,6091192,4734427,5813480,4747722,4758350,5717620,48154
04,6076351,4836483,4902526,5024682,6066715,5030579,5032745,5028454,5044309,5045485,
5053907,6629634,6114281,5029395,5000090,2423312,289068,5242039,4953687,4946442,4118
659,4914476,4911122,4853690,5972342,4778991,4645670,4477124,4468155,4412890,4273207
,4220406,3631534,2951766,2700958,2546484,2369254,2263004,2113318,1999967,1132357,99
6947,789128,529844,5096937,345290,6152426,237297,5886041,116630,5087373,330590,5552
418,2166693,5172709,571512,445167,156510,1330800,5272513,3921436,6456247,3746280,58
13783,3669435,5922046,3699155,4488954,5710582,5833401,5309288,5810931,5339441,37240
1,4469588,5346212,4834093,4813927,2522826,5382687,5382692,1913728,3272722,5379646,5
846953,4870958,5861874,5067265,5349806,5699298,4469627,1431107,4895634,3574879,4915
220,5436200,4038817,5710586,5303681,5408572,5590554,3468601,1449069,5797575,5747655
,5405469,3730656,5472330,2776889,3636268,4993931,5434934,5045922,5452432,5422102,54
88573,5776685,5766011,5517312,5590592,646968,2464807,3397865,1242669,3530855,325172
,2221510,5635990,1310092,5054601,5545443,5654008,5580742,5580210,5515862,5592108,55
91416,5591545,5624841,5630711,6124317,6120147,6114810,6112855,6112594,6103361,60875
39,6087537,6084110,6538564,6070592,6043771,6249811,5948714,6063434,327130,441339,40
00001,6069526,6160319,6180353,6172897,3065912,744038,4945098,1017676,2252884,343971
,6050338,4102732,329246,2580114,5258125,265354,326904,6226519,6100000,201442,630059
4,6276662,6263285,5
805021,6321670,6607378,6087548,6438169,1395321,5525195,5643435,5593912,6077025,6460
747,396105,1000023,1003924,2412062,2918866,3734489,3822290,3873444,3972690,4120986,
4221819,4379212,4394100,4559040,4741601,4775829,5106003,5126174,5128083,5219686,532
6916,5461992,5519925,5755208,6149243,6172480,6212895,6271125,6287479,6292735,629273
7,6305122,6326640,6371592,6467947,6520153,6572872,6530523,6532371,6542858,6547536,6
561094,6563851,6571336,6580361,6147642,1220496,532300,6730473,313091,640766,3399991
,6356583,6727662,6771291,6827953,7026694,6665146,6777679,6835898,195765,6814065,690
6753,179339,6916252,6918114,128522,6606660,6612138,6972430,6975166,630046,1867520,5
541145,6186416,6800926,158128,6310411,6312498,6310396,6312188,6473912,6389619,68545
36,6854539,6312173,6315208,6312203,6310370,6310383,6853060,6310440,6547670,7062105,
6545742,6985344,960547}
local maps = mapasracing
local equipoc= {}
local colors = {
[1] = "e54427",
[2] = "0a98db",
[3] = "00ff00",
[4] = "ffff00",
[5] = "f27d0c",
[6] = "000099",
[7] = "000001",
[8] = "7c5ead",
}
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
tfm.exec.newGame(mapcode)
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'><V>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'><V>Team 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'><V>Team 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'><V>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'><V><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'><V><a href='event:reset'>Reset",
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'><V>Modo %s - %s
",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO",
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'><V><a href='event:volver'><font
size='10'>4 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'><V><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 size='37'
color='#000000'>%s gan�\nLos otros son perdedores xdxdxd", player), nil, 3, 168,
800, 500, 0, 0, 0, true)
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)
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)
end
tfm.exec.setGameTime(3)
puntos[player] = puntos[player]+1
equipoc[player] = "0x115b17"
displayScoreDeathmatch()
end
if modo2b == "normal" then
if table.contains(teams[1], player) then
tfm.exec.setGameTime(3)
points[1] = points[1]+1
elseif table.contains(teams[2], player) then
tfm.exec.setGameTime(3)
points[2] = points[2]+1
elseif table.contains(teams[3], player) then
tfm.exec.setGameTime(3)
points[3] = points[3]+1
elseif table.contains(teams[4], player) then
tfm.exec.setGameTime(3)
points[4] = points[4]+1
elseif table.contains(teams[5], player) then
tfm.exec.setGameTime(3)
points[5] = points[5]+1
elseif table.contains(teams[6], player) then
tfm.exec.setGameTime(3)
points[6] = points[6]+1
elseif table.contains(teams[7], player) then
tfm.exec.setGameTime(3)
points[7] = points[7]+1
elseif table.contains(teams[8], player) then
tfm.exec.setGameTime(3)
points[8] = points[8]+1
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",
"Amarillo",
"Naranja",
"Azul",
"Negro",
"Violeta",
}
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)
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)
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)
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)
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)
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)
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>Deathmatch 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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] == "d" 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 == "normal" then
if args[2] and args[3] then
if args[2] == "team1" and modo2b == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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 == "normal" 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] == "reset" 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 = "Burlas"
modo2 = "Deathmatch"
modo2b = "normal"
displayTeams()

elseif args[1] == "puntos" and modo2b == "normal" 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] == "pausa" 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'><V> Juego 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
if modo2b == "normal" 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 == "normal" then
if modoazar == "true" then
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)
end
if modoazar == "false" then
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)
end
end
end
function displayScoreDeathmatch()
resetmostrarjugadoresdeathmatch()
ui.addTextArea(300, string.format("<p align='center'><V>Deathmatch 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
function displayTeams()
borrarScoreDeathmatch()
modoazar = "false"
ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
ui.addTextArea(37, "<p align='center'><V>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'><V>Team 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'><V>Team 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'><V>Team 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'><V>Team 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'><V>Team 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'><V>Team 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'><V>Team 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'><V>Team 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'><V>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'><V><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'><V><a href='event:reset'>Reset",
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'><V><a href='event:Deathmatch'><font
size='8'>"..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'><V><a href='event:llenar'><font
size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO",
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'><V><a href='event:azart'><font
size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
ui.addTextArea(59, "<p align='center'><V><a href='event:azart'><font
size='12'>teams", ADMINISTRADOR, 742, 290, 55, 23, 0x000000, 0x000000, 1, true)
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)
end
function verificarmodo()
ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s
",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
if modo2 == "normal" then
ui.addTextArea(51, "<p align='center'><V><a href='event:normal'><font
size='8'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
end
if modo == "Burlas" then
ui.addTextArea(48, "<p align='center'><V><a href='event:Burlas'><font
size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
end
if modo == "racing" then
ui.addTextArea(48, "<p align='center'><V><a href='event:racing'><font
size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
end
if modo == "mix" then
ui.addTextArea(48, "<p align='center'><V><a href='event:mix'><font
size='9'>"..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 == "normal" 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 == 'reset' 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 = "Burlas"
modo2 = "Deathmatch"
modo2b = "normal"
displayTeams()

end
if callback == 'Burlas' then
tiempo = 150
modob = "Burlas"
modo = "mix"
verificarmodo()
maps = mapasBurlas
end
if callback == 'racing' then

tiempo = 60
modob = "racing"
modo = "Burlas"
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 = "normal"
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 == 'normal' then
modo2b = "normal"
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 == 'Burlas2' then
tiempo = 150
modob = "Burlas"
modo = "mix"
verificarmodo2()
maps = mapasBurlas
end
if callback == 'racing2' then

tiempo = 60
modob = "racing"
modo = "Burlas"
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'><V>Modo %s - %s
",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
if modo == "Burlas" then
ui.addTextArea(48, "<p align='center'><V><a href='event:Burlas2'><font
size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
end
if modo == "racing" then
ui.addTextArea(48, "<p align='center'><V><a href='event:racing2'><font
size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
end
if modo == "mix" then
ui.addTextArea(48, "<p align='center'><V><a href='event:mix2'><font
size='9'>"..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()

S-ar putea să vă placă și