Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.76 KB | None | 0 0
  1. local ADMINISTRADOR = "Redditguy" -- Cambia tu nombre para ser administrador
  2. -----------------------------------------------------------------------------------]]
  3. --[[
  4. Comandos:
  5. !skip - skip the map
  6. !score TEAM NUMBER - set a score: !score team1 15
  7. !np @CODE - play a map
  8. !pause - pause the game
  9. !team NAMES - create a team with chosen players
  10. !d NUMBER - score to reach
  11. !add TEAM NAME - add a player to a team: !add team1 Trolleandolo
  12. !reset - reset the game
  13. !remove TEAM NAME - remove a player from a team: !quit team1 Trolleandolo
  14. --------------------------------------------------------------------
  15. ]]
  16. -----------------------------------------------------------------------------------
  17. local WINS = 15 -- Puntaje para ganar.
  18. ------------------------------------------------------------------------------------
  19. --[[
  20. MEJORAS DE LA VERSIÓN
  21. [SE QUITÓ UN BUG]
  22. [SE AÑADIERON MAPAS DE BOOTCAMP]
  23. [SE REDUJERON LAS PROBABILIDADES DE BUG]
  24. [SE AÑADIÓ MODO 2 TEAMS AL AZAR]
  25. ]]
  26.  
  27. system.disableChatCommandDisplay("np", true)
  28. system.disableChatCommandDisplay("pause", true)
  29. system.disableChatCommandDisplay("skip", true)
  30. system.disableChatCommandDisplay("puntaje", true)
  31. tfm.exec.disablePhysicalConsumables()
  32. tfm.exec.disableAutoShaman()
  33. tfm.exec.disableAutoNewGame()
  34. tfm.exec.disableAutoTimeLeft()
  35. local teams = {
  36. [1] = {},
  37. [2] = {},
  38. [3] = {},
  39. [4] = {},
  40. }
  41. local points = {
  42. [1] = 0,
  43. [2] = 0,
  44. [3] = 0,
  45. [4] = 0,
  46. }
  47. local modob = "racing"
  48. local modo = "bootcamp"
  49. local tiempo = 60
  50. tonumber(tiempo)
  51. local isfirst = false
  52. local gameRunning = false
  53. local winTime = false
  54. local playersInGame = {}
  55. local distanciax = 30
  56. local distanciay = 80
  57. local textarealugar = 300
  58. local textareaid = 0
  59. local mapasmix = {203664,214631,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}
  60. local mapasbootcamp= {203664,170514,173816,171776,562897,166430,169076,330933,179488,172621,168754,159145,163596,152733,410040,158909,261814,281985,159932,2176211,285589,257324,236768,303151,270924,563436,424604,523270,172547,2693587,168204,2693344,193662,1788490,305680,149451,176253,342035,2466489,292808,438333,394125,162482,304861,159298,184648,268915,329318,261298,302080,159187,176710,161023,1852910,201172,549759,257715,397478,261298,177652,447805,460961,455271,172512,320607,166271,299942,186066,152260,155628,166805,178297,167903,223947,150664,157203,163159,197229,204647,163531,232675,216173,166361,169059,271411,277824,306365,172520,113156,149422,149451,6000050,150651,150664,151655,152260,152733,153996,155480,155606,155611,155628,155765,156720,157004,157203,157805,157960,158345,158417,158909,159187,159298,159932,160841,161023,161434,162482,163094,163159,163172,163531,163596,164544,164916,165186,166032,177652,166056,166271,166333,166361,166430,166805,167075,167903,168204,168754,169059,169076,169110,169139,169228,70514,171480,171482,171776,172501,172512,172520,172547,172605,172621,172951,172976,173623,173816,174223,175204,175280,176253,176507,176619,176710,176729,179005,179488,179492,179807,180801,182370,182769,183139,183141,184648,184817,184868,185289,185428,185529,185873,185887,186066,189819,190646,190996,191177,191203,191205,191443,191642,192158,192255,192560,192959,193662,195116,195672,197229,198988,199210,199710,199826,201000,202574,203664,204488,204647,205240,205506,206396,208056,208373,234675,208653,208940,209848,213752,213755,213874,214631,214755,216171,216173,217261,220352,222377,222910,223947,2795201,225744,226226,227093,230588,231137,231921,232469,232678,235037,236768,237091,242291,250153,254785,257218,257324,257715,258192,258908,259319,261298,261814,263819,263926,264091,268915,270143,270924,271193,271411,159145,272402,272518,272689,277427,277513,514311,277824,279337,281948,282584,284134,286254,289865,2574744,4617716,295465,295630,295932,297442,299942,299983,301610,302080,303151,303939,304861,305567,305614,590775,305820,306365,306384,306655,307324,313216,314743,315666,315800,316012,318129,d320483,320626,322582,327354,237743,239200,329571,330933,331344,331988,332130,332906,333002,336305,337644,343456,354984,2914456,365061,368839,372255,372419,5404791,391924,392240,393426,394132,395216,395310,397469,397478,374995,399364,401630,403940,3133917,408577,410040,410045,412467,412913,419335,419369,419635,420877,422981,423311,424604,424685,424900,2932238,425884,431433,431749,432501,435812,438333,438364,438449,439092,444589,447805,449496,454049,455271,457726,458528,460961,467137,476706,478236,482791,492222,492399,496610,497965,499986,500000,500690,500748,500894,504485,505619,506032,506613,506940,510996,511136,512887,522719,523270,528032,531084,541223,541223,541693,541729,543010,551317,552986,556575,556841,380516,557066,557074,560526,560583,563897,563436,564198,568122,571683,574183,575497,584783,586901,587501,592189,593164,3734991,593431,593530,596239,2242899,605255,608368,612415,618999,654894,684566,692650,692740,721319,722837,729863,758595,783547,815336,834297,842167,868262,881158,886744,912356,1111252,919484,970919,976944,999963,1000006,1004622,1014343,1018394d,1066607,1130256,1156092,1157281,1162831,1164086,1225867,1226207,1242584,1355359,536905,1265789,1266330,1301649,1303323,1323048,1333846,1383297,1384078,1390405,1398609,1403454,1410539,1413528,1427980,1435902,1494499,1503203,1526894,1531604,1540221,1580356,1580835,1593066,1595965,1615753,1615949,1620703,1647131,1722755,1733211,1788490,1807217,1809410,1955745,1989803,1990413,2024960,2040569,2130169,2178800,2311703,2329940,2426969,2423300,2469365,256899,2520540,2636519,2738370,2788517,2794566,2846829,2989803,3038589,3136410,3199998,3242049,3295967,3326197,3333223,3380788,3456260,3551333,3668866,3668888,3690269,3908151,3988424,4067327,4445580,330841,549666,4114521,2176211,1523082,5960814,1256085,373105,375455,376704,378704,2252731,1646448,6137767,4890068,4488666,698992,3888888,4627777,528782,557132,357892,273373,225484,192519,5000126,6533602,6568526,159691,158053,3907267,3848147,6574593,293559,4763378,1601992,2692883,4770120,6774534,5517891,4877895,556973,4769901,7016000,406154,6642996,6675248,223174,6999009,4895345,7147973,6999882,7097819,5750090,7053648,7001001,3089270,7000066,2617140,346830,7000001,6727980,6726357,6503426,6924913,4766009,6680648,201172,187478,182681,6827739,4854539,7024409,5933637,3205704,4000000,1553755,6575613,6586669,6586669,3828508,6450492,4632975,532860,4595576,6284671,6041917,4000010,366260,6289411,3984871,219956,3500000,4660408,3985463,5553707,5720741,5758150,5998000,6079100,5284625,5356911,4117513,178297,2918822,293658,6045500,5340984,5706542,5914063,1914925,4398794,5761507,5616777,2605186,5473125,157098,293306,4220381,3142783,4948551,2941840,2395201,4000662,3483300,5931069,5505990,3937567,6621953,2998268,4822672,4794517,3311534,4948659,4506542,621850,1852910,1551020,3734984,4720851,3846632,1923584,4675691,3838020,322649,2758747,3530999,4313858,4365527,600212,3295954,5092739,170483,5384241,4311255,4644584,6022675,6609034,4484685,3939000,3999979,3820501,4413656,4249695,823329,320607,4362335,4234558,4295473,1568331,4337732,4390388,1972688,7091488,5134116,4317592,5132197,4333895,4121359,4107909,4093488,4058168,4039451,4241333,4027263,4237910,4000008,4000007,3999997,3999992,3999991,3976766,6304911,3969628,3964892,5342889,3958217,5263927,3920916,3866663,3866660,3860578,3849999,3826546,3815568,3799357,3850000,3779861,3767893,3759157,3750360,3747520,3734998,3734996,3734990,3734989,3734988,1737800,3707630,6462982,394125,3668877,3659983,3645415,5036934,3603631,3588395,3576303,3076903,3561333,3560999,1939604,5292798,3535850,3527399,267971,2601214,3513929,3500755,3734997,3493490,3493456,3484437,1853529,3473704,3471016,3459986,3434941,3430712,3428069,3637540,3404894,3395605,5085011,3343092,3338283,3330219,3295960,3293485,3281758,3264848,4373748,3243455,3242050,5348692,3219400,3200001,3185979,3182487,3182006,3163166,3161324,3149125,3146209,3137929,208548,3118286,3099302,3085218,3075090,277631,3043779,3041105,5460041,3024606,6729952,3016226,3012311,3012178,3008515,3008319,3000006,2999994,2996951,2974387,2967631,2963166,2961800,2947140,2945156,2933390,2933011,2925531,2920826,4889180,2470461,2890123,2887929,2884392,2869337,2860683,2860211,2858882,2854813,2850177,2844637,2828481,2819876,2818330,2817711,2811229,2805938,2803483,2797076,2789121,2777168,2772507,2750014,2747525,2719419,2718406,2708585,7000990,2704483,2693587,2693344,3963960,2682583,2673019,2669415,2668918,2643916,2636207,2574960,5489869,2474044,2466489,2448730,2432090,2427910,2420714,2378364,2362046,2357991,2346943,2341982,2309030,2297260,5616978,2239788,2208924,2202628,5598943,2128560,2082776,2080400,2036898,2033229,2031184,2009003,1869912,5819555,1802012,613277,d4538472,1737297,6593495,1705006,3139767,7062569,1642725,1636814,1610638,1584555,5876254,1526368,1296299,1134969,1110982,1102513,814311,763368,733146,720672,159116,655207,651656,639878,597804,597348,593003,591528,554154,549759,544695,515684,507884,503679,431873,392861,4578236,371579,368585,366809,357837,353356,346684,343875,342640,322922,313214,313138,305680,301559,298424,296020,295487,294478,292808,292668,285961,285589,281985,a280949,277835,266398,259854,258289,257092,255943,253469,249760,235717,229974,215933,212322,197368,195453,187035,186855,3976977,176615,175454,170007,167333,5522262,3734999,155517,2484316,1962695,1952415,1951944,1949730,1872179,}
  61. 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,156847,6583596,159351,160762,161730,163682,164802,165112,165747,165843,5848412,167941,168776,380417,169892,171152,175205,176263,177236,177813,178545,178657,180191,180255,180274,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,209799,210188,211528,211565,211885,212542,213331,213697,213933,214037,214660,214775,215938,216439,216505,216553,216735,217282,217881,217900,219548,220500,222098,223293,223810,223986,224441,225017,226069,226879,226883,227417,227851,228462,229814,229827,229830,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,239880,240544,240548,240973,241211,241295,242708,243279,244006,244699,244888,245223,246790,246973,247815,247818,248098,250610,251459,252759,252806,253883,254291,255098,255542,255893,258717,259604,259716,259833,260024,260292,260338,260377,260384,260678,261078,261172,261720,261959,262144,262212,262239,263163,263182,263624,263907,264132,264232,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,285752,286333,287268,289821,291628,292348,292614,293065,294522,294943,299002,299503,29971,300055,301315,302936,304356,305677,306213,308280,308435,308694,308711,308992,309029,309057,309169,309834,312713,313245,314159,314205,315801,316289,317696,317754,317779,318378,318813,319524,319841,321339,321712,321814,321906,322771,323115,323366,323600,324355,326585,327254,327266,330441,332210,332290,332467,333277,333656,333837,335507,337581,337774,339272,339418,339643,339896,340069,340901,341116,341239,344361,344865,344952,345257,245312,345943,348479,348801,349140,4581354,349984,350251,350519,352381,352710,352885,354616,354878,355658,355676,355769,355957,356722,356982,357328,357428,359055,359521,359901,360201,6414689,360273,360365,361382,362549,363411,363625,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,385203,385295,386029,386046,386959,387012,387180,387270,387290,387638,388447,389582,391625,391693,391831,391868,391990,392446,392492,392913,393675,393851,394890,395459,395585,395607,396223,396332,396347,396645,396861,397296,397501,397812,397938,398011,398041,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,407457,407488,407495,6127809,407686,407746,408978,409199,410230,410532,410565,410608,410736,410813,412211,412316,412657,412752,413408,414188,414460,414899,416015,416142,416552,418022,418196,418265,418293,418323,418337,418600,418606,418658,419374,419735,420806,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,431887,433937,434887,436041,436107,436447,437860,438154,440676,441047,441376,441598,443309,444490,444830,444964,445133,445219,447556,448281,452016,455167,459349,463195,463977,465205,468260,470687,470727,471053,472379,472665,475151,475790,477370,477603,480023,483924,484992,494706,496091,496945,499109,499682,499684,499687,500074,501428,501711,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,556426,558790,563183,563484,564033,566347,566438,571144,580031,583056,586622,586688,587458,590641,594049,594883,595447,603381,606719,606723,608459,610137,611320,613985,616373,616433,620996,624098,624721,627609,634945,645288,646800,658464,664949,667920,669031,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,1051384,1058681,1085530,1102815,1130728,1132639,1142116,1143815,1144548,1162611,1167734,1172426,1174107,1195842,1208798,1208979,1210037,1214182,1216253,1221661,1222899,1229246,1231216,1234914,1249601,1252122,1253523,1255130,1255148,1256845,1281700,1281981,1286910,1307880,1311059,1321417,1321664,1341396,1346440,1351308,1352534,1358446,1359797,1364063,1368222,1368233,1371239,1371294,1372941,1373000,1373748,1375345,1378209,1393405,1394120,1398732,1405249,1405496,1416040,1425101,1428436,1448760,1450554,1453667,1471124,1483155,1487161,1490438,1491022,1492120,1495344,1503393,1504586,1506007,1509474,1513407,1525272,1531388,1538895,1539515,1539791,1542618,1542736,1555532,1555862,1556661,1564762,1567620,1573213,1571997,1580508,1583655,1586439,1587904,1588884,1589026,1591471,1592767,1595600,1597594,1600443,1601492,1601786,1601857,1602654,1603050,1605364,1608259,1608638,1609978,1611631,1612436,1612796,1613550,1613927,1614563,1618110,1619934,1621611,1622737,1623300,1628732,1629164,1632294,1632541,1632706,1632746,1634741,1637638,1639996,1643157,1644638,1646120,1648583,1651658,1654096,1654105,1654841,1654903,1657021,1657360,1658171,1659639,1659716,1661852,1663380,1663415,1665249,1665516,1665775,1669046,1673174,1674534,1675083,1687268,1689382,1692628,1693705,1694602,1702169,1703617,1705316,1716693,1716949,1718723,1724289,1728943,1749434,1751944,1759287,1768347,1778687,1787232,1787239,1794287,1802907,1841744,1845710,1848032,1851411,1851568,1851968,1856349,1857829,1862800,1862823,1873736,1923785,1924227,1926831,1927270,1932796,1951856,1952851,1954369,1954898,1956002,1956555,1964700,1964752,1965819,1973574,1975275,1975286,1975684,1975753,1976007,1976857,1979131,1982476,1985019,1987990,2005559,2007170,2007205,2012147,2018511,2023552,2030343,3691622,2047177,2048474,2068543,2070768,2076632,2079190,2089069,2098621,2101747,2106576,2118599,2134537,2138401,2141379,2144010,2149382,2150335,2174319,2176620,2180790,2185089,2214661,2219308,2223685,2228834,2245005,2286056,2287914,2331474,2347666,2372538,2378820,2393139,2417713,2453022,2509175,2536577,2538131,2557885,2564883,2577060,2582610,2586491,2588032,2592421,5712914,2645615,2682985,2683170,2725924,2726034,5834732,2796001,2813487,2816067,2840770,2854246,2868414,2883986,2894072,3816991,2953315,2989266,2991507,3005251,3008155,3029580,3036416,3120368,3123384,3142015,3156569,3175920,3209087,3213562,6041399,3267620,3347209,3408247,3444803,3447108,3453351,3469987,3504036,3517347,3518418,3535192,3537419,3544895,3548376,3548378,3548406,3549484,3549840,3556405,3556489,3556690,3572407,3574927,3575034,3575108,3575170,3575216,3575293,3575425,3575463,3579335,3579476,3582577,3584275,3584689,3592471,3595900,3603799,3603802,3603809,3604799,3607846,3611702,3611885,3613029,3617674,3620542,3630433,3631748,3637041,3638794,3639993,3644272,3652003,3652102,3654416,3662698,3667358,3668754,3670084,3676141,3676555,3679397,3778128,3679884,3680180,3680220,3680221,3680223,3682405,3683201,3683224,3683294,3683383,3683393,3683520,3683600,3684229,3684455,3684457,3684465,3684784,6300149,3685352,3685382,3685486,3688419,3690578,3691609,3693822,3696662,3700684,3702767,3705931,3706599,3712183,3716560,3721990,3727755,3728013,3737576,3738767,3778389,3799507,3799857,3799951,3801780,3816622,3818249,3821104,3834905,3845214,3847244,3854268,3857914,3889414,3901403,3909339,3912540,3946626,3948683,3953320,3953425,3967150,3967250,3970909,3984750,3985806,3999981,3992276,3992671,3994471,4003729,5628991,4035194,4049042,6063528,4088129,4091580,6069537,4148332,4174318,4174320,1250021,5249500,6070140,4234556,4238784,5495901,4323335,4344186,5579236,5557858,4489653,4508416,4551993,4612295,3211576,4666540,4681759,5246345,4685111,2571671,4707191,5867478,6091192,4734427,5813480,4747722,4758350,5717620,4815404,6076351,4836483,4902526,5024682,6066715,5030579,5032745,5028454,5044309,5045485,5053907,6629634,6114281,5029395,5000090,2423312,289068,5242039,4953687,4946442,4118659,4914476,4911122,4853690,5972342,4778991,4645670,4477124,4468155,4412890,4273207,4220406,3631534,2951766,2700958,2546484,2369254,2263004,2113318,1999967,1132357,996947,789128,529844,5096937,345290,6152426,237297,5886041,116630,5087373,330590,5552418,2166693,5172709,571512,445167,156510,1330800,5272513,3921436,6456247,3746280,5813783,3669435,5922046,3699155,4488954,5710582,5833401,5309288,5810931,5339441,372401,4469588,5346212,4834093,4813927,2522826,5382687,5382692,1913728,3272722,5379646,5846953,4870958,5861874,5067265,5349806,5699298,4469627,1431107,4895634,3574879,4915220,5436200,4038817,5710586,5303681,5408572,5590554,3468601,1449069,5797575,5747655,5405469,3730656,5472330,2776889,3636268,4993931,5434934,5045922,5452432,5422102,5488573,5776685,5766011,5517312,5590592,646968,2464807,3397865,1242669,3530855,325172,2221510,5635990,1310092,5054601,5545443,5654008,5580742,5580210,5515862,5592108,5591416,5591545,5624841,5630711,6124317,6120147,6114810,6112855,6112594,6103361,6087539,6087537,6084110,6538564,6070592,6043771,6249811,5948714,6063434,327130,441339,4000001,6069526,6160319,6180353,6172897,3065912,744038,4945098,1017676,2252884,343971,6050338,4102732,329246,2580114,5258125,265354,326904,6226519,6100000,201442,6300594,6276662,6263285,5805021,6321670,6607378,6087548,6438169,1395321,5525195,5643435,5593912,6077025,6460747,396105,1000023,1003924,2412062,2918866,3734489,3822290,3873444,3972690,4120986,4221819,4379212,4394100,4559040,4741601,4775829,5106003,5126174,5128083,5219686,5326916,5461992,5519925,5755208,6149243,6172480,6212895,6271125,6287479,6292735,6292737,6305122,6326640,6371592,6467947,6520153,6572872,6530523,6532371,6542858,6547536,6561094,6563851,6571336,6580361,6147642,1220496,532300,6730473,313091,640766,3399991,6356583,6727662,6771291,6827953,7026694,6665146,6777679,6835898,195765,6814065,6906753,179339,6916252,6918114,128522,6606660,6612138,6972430,6975166,630046,1867520,5541145,6186416,6800926,158128,6310411,6312498,6310396,6312188,6473912,6389619,6854536,6854539,6312173,6315208,6312203,6310370,6310383,6853060,6310440,6547670,7062105,6545742,6985344,960547}
  62. local maps = mapasracing
  63. local colors = {
  64. [1] = "e54427",
  65. [2] = "0a98db",
  66. [3] = "00ff00",
  67. [4] = "ffff00",
  68. }
  69. local queue = {}
  70. local nteam = 1
  71. local azar = {}
  72. local posicion = {}
  73. local modoazar = ""
  74. local numeroposicion = 1
  75. function newMap()
  76. local mapcode = maps[math.random(#maps)]
  77. if #queue > 0 then
  78. mapcode = queue[1]
  79. table.remove(queue, 1)
  80. end
  81. tfm.exec.newGame(mapcode)
  82. for player, data in pairs(tfm.get.room.playerList) do
  83. if not playersInGame[player] then
  84. tfm.exec.killPlayer(player)
  85. end
  86. end
  87. tfm.exec.setGameTime(tiempo)
  88. end
  89. function modoalazar()
  90. ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  91. ui.addTextArea(37, "<p align='center'><V>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  92. ui.addTextArea(2, "", nil, 142, 71, 516, 290, 0x0E1417, 0x0E1417, 1, true)
  93. ui.addTextArea(4, "", nil, 231, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  94. ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 232, 80, 140, 20, 0x324650, 0x324650, 1, true)
  95. ui.addTextArea(6, "", nil, 399, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  96. ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 400, 80, 140, 20, 0x324650, 0x324650, 1, true)
  97. for i=8, 11 do
  98. ui.removeTextArea(i)
  99. end
  100. ui.addTextArea(40, "", nil, 231, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  101. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 232, 121, 138, 198, 0x324650, 0x324650, 1, true)
  102. for i=32, 35 do
  103. ui.removeTextArea(i)
  104. end
  105. ui.addTextArea(36, "", nil, 399, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  106. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 400, 121, 138, 198, 0x324650, 0x324650, 1, true)
  107. ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 320, 197, 140, 200, 0, 0, 0, true)
  108. ui.addTextArea(15, "", nil, 367, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  109. ui.addTextArea(16, "<p align='center'><V>VS", nil, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  110. ui.addTextArea(42, "", ADMINISTRADOR, 600, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  111. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", ADMINISTRADOR, 601, 82, 38, 18, 0x324650, 0x324650, 1, true)
  112. ui.addTextArea(45, "", ADMINISTRADOR, 600, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  113. ui.addTextArea(46, "<p align='center'><V><a href='event:reset'>Reset", ADMINISTRADOR, 601, 140, 50, 18, 0x324650, 0x324650, 1, true)
  114. ui.addTextArea(47, "", ADMINISTRADOR, 600, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  115. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  116. ui.addTextArea(57, "", ADMINISTRADOR, 600, 207, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  117. 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)
  118. ui.removeTextArea(59)
  119. ui.removeTextArea(60)
  120. ui.removeTextArea(53)
  121. ui.removeTextArea(51)
  122. ui.removeTextArea(56)
  123. ui.removeTextArea(54)
  124. verificarmodo2()
  125. end
  126. function eventPlayerWon(player)
  127. if not isfirst then
  128. isfirst = true
  129. tfm.exec.setGameTime(3)
  130. if table.contains(teams[1], player) then
  131. tfm.exec.setGameTime(3)
  132.  
  133. points[1] = points[1]+1
  134. elseif table.contains(teams[2], player) then
  135. tfm.exec.setGameTime(3)
  136.  
  137. points[2] = points[2]+1
  138. elseif table.contains(teams[3], player) then
  139. tfm.exec.setGameTime(3)
  140.  
  141. points[3] = points[3]+1
  142. elseif table.contains(teams[4], player) then
  143. tfm.exec.setGameTime(3)
  144.  
  145. points[4] = points[4]+1
  146. else
  147. isfirst = false
  148. end
  149. winner = false
  150. if points[1] >= WINS then
  151. winner = 1
  152. elseif points[2] >= WINS then
  153. winner = 2
  154. elseif points[3] >= WINS then
  155. winner = 3
  156. elseif points[4] >= WINS then
  157. winner = 4
  158. end
  159. if winner then
  160. gameRunning = false
  161. winTime = os.time()
  162. local names = {
  163. "Rojo",
  164. "Azul",
  165. "Verde",
  166. "Amarillo",
  167. }
  168. ui.addTextArea(26, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó\nLos otros son perdedores xdxdxd", names[winner]), nil, 0, 171, 800, 500, 0, 0, 0, true)
  169. ui.addTextArea(27, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó\nLos otros son perdedores xdxdxd", names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  170. ui.addTextArea(28, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó\nLos otros son perdedores xdxdxd", names[winner]), nil, 2, 169, 800, 500, 0, 0, 0, true)
  171. ui.addTextArea(29, string.format("<p align='center'><font size='37' color='#000000'>El equipo %s Ganó\nLos otros son perdedores xdxdxd", names[winner]), nil, 3, 168, 800, 500, 0, 0, 0, true)
  172. ui.addTextArea(30, string.format("<p align='center'><font size='37'><font color='#cecece'>El equipo <font color='#%s'>%s</font> Ganó\nLos otros son perdedores xdxdxd", colors[winner], names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  173. 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)
  174. end
  175. displayScore()
  176. end
  177. end
  178. function eventLoop(elapsed, remain)
  179. if gameRunning then
  180. remain = remain/1000
  181. if remain < 0 then
  182. remain = 100
  183. newMap()
  184. end
  185. else
  186. if winTime then
  187. if winTime > os.time()-30000 then
  188. else
  189. winTime = false
  190. ui.removeTextArea(26)
  191. ui.removeTextArea(27)
  192. ui.removeTextArea(28)
  193. ui.removeTextArea(29)
  194. ui.removeTextArea(30)
  195. displayTeams()
  196. teams = {
  197. [1] = {},
  198. [2] = {},
  199. [3] = {},
  200. [4] = {},
  201. }
  202. points = {
  203. [1] = 0,
  204. [2] = 0,
  205. [3] = 0,
  206. [4] = 0,
  207. }
  208. playersInGame = {}
  209. end
  210. end
  211. end
  212. end
  213. function string.title(s)
  214. return string.gsub(s, "%a", function(c)
  215. return string.upper(c)
  216. end, 1)
  217. end
  218. function eventChatCommand(player, command)
  219. if player:lower() == ADMINISTRADOR:lower() then
  220. args = string.split(command, " ")
  221. if args[1] == "team1" then
  222. table.remove(args, 1)
  223. teams[1] = {}
  224. points[1] = 0
  225. for index, player in pairs(args) do
  226. player = string.title(player)
  227. table.insert(teams[1], player)
  228. playersInGame[player] = true
  229. end
  230. if modoazar == "true" then
  231. modoalazar()
  232. else
  233. displayTeams()
  234. end
  235. elseif args[1] == "team2"then
  236. table.remove(args, 1)
  237. teams[2] = {}
  238. points[2] = 0
  239. for index, player in pairs(args) do
  240. player = string.title(player)
  241. table.insert(teams[2], player)
  242. playersInGame[player] = true
  243. end
  244. if modoazar == "true" then
  245. modoalazar()
  246. else
  247. displayTeams()
  248. end
  249. elseif args[1] == "team3" then
  250. table.remove(args, 1)
  251. teams[3] = {}
  252. points[3] = 0
  253. for index, player in pairs(args) do
  254. player = string.title(player)
  255. table.insert(teams[3], player)
  256. playersInGame[player] = true
  257. end
  258. if modoazar == "true" then
  259. modoalazar()
  260. else
  261. displayTeams()
  262. end
  263. elseif args[1] == "team4"then
  264. table.remove(args, 1)
  265. teams[4] = {}
  266. points[4] = 0
  267. for index, player in pairs(args) do
  268. player = string.title(player)
  269. table.insert(teams[4], player)
  270. playersInGame[player] = true
  271. end
  272. if modoazar == "true" then
  273. modoalazar()
  274. else
  275. displayTeams()
  276. end
  277. elseif args[1] == "skip" then
  278. newMap()
  279. elseif args[1] == "np" then
  280. if args[2] then
  281. table.insert(queue, args[2])
  282. end
  283. elseif args[1] == "d" then
  284. if args[2] then
  285. WINS = tonumber(args[2])
  286. displayScore()
  287. end
  288. elseif args[1] == "add"then
  289. if args[2] and args[3] then
  290. if args[2] == "team1"then
  291. table.remove(args, 1)
  292. table.remove(args, 1)
  293. for index, player in pairs(args) do
  294. player = string.title(player)
  295. table.insert(teams[1], player)
  296. playersInGame[player] = true
  297. end
  298. end
  299. if args[2] == "team2" then
  300. table.remove(args, 1)
  301. table.remove(args, 1)
  302. for index, player in pairs(args, 3) do
  303. player = string.title(player)
  304. table.insert(teams[2], player)
  305. playersInGame[player] = true
  306. end
  307. end
  308. if args[2] == "team3" then
  309. table.remove(args, 1)
  310. table.remove(args, 1)
  311. for index, player in pairs(args) do
  312. player = string.title(player)
  313. table.insert(teams[3], player)
  314. playersInGame[player] = true
  315. end
  316. end
  317. if args[2] == "team4" then
  318. table.remove(args, 1)
  319. table.remove(args, 1)
  320. for index, player in pairs(args) do
  321. player = string.title(player)
  322. table.insert(teams[4], player)
  323. playersInGame[player] = true
  324. end
  325. end
  326. end
  327. elseif args[1] == "remove" then
  328. if args[2] then
  329. for index, player in pairs(args) do
  330. player = string.title(player)
  331. playersInGame[player] = false
  332. end
  333. end
  334. elseif args[1] == "reset" then
  335. teams[1] = {}
  336. points[1] = 0
  337. teams[2] = {}
  338. points[2] = 0
  339. teams[3] = {}
  340. points[3] = 0
  341. teams[4] = {}
  342. points[4] = 0
  343. equipos = {}
  344. puntos = {}
  345. modob = "racing"
  346. modo = "bootcamp"
  347. displayTeams()
  348.  
  349.  
  350. elseif args[1] == "score"then
  351. if args[2] and args[3] then
  352. local team = tonumber(args[2]:match("team(%d+)") or 0)
  353. if team > 0 and team < 5 then
  354. local newScore = tonumber(args[3]) or points[team]
  355. points[team] = newScore
  356. displayScore()
  357. end
  358. end
  359. elseif args[1] == "pause" then
  360. gameRunning = not gameRunning
  361. if not gameRunning then
  362. ui.addTextArea(90, "", nil, 235, 200, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  363. ui.addTextArea(91, "<p align='center'><V> Juego pausado ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
  364. tfm.exec.disableAutoTimeLeft(true)
  365. else
  366. ui.removeTextArea(90)
  367. ui.removeTextArea(91)
  368. tfm.exec.disableAutoTimeLeft(false)
  369. end
  370. end
  371. end
  372. end
  373. function eventNewGame()
  374. if gameRunning then
  375. isfirst = false
  376. for i, p in pairs(teams[1]) do
  377. tfm.exec.setNameColor(p, "0x"..colors[1])
  378. end
  379. for i, p in pairs(teams[2]) do
  380. tfm.exec.setNameColor(p, "0x"..colors[2])
  381. end
  382. for i, p in pairs(teams[3]) do
  383. tfm.exec.setNameColor(p, "0x"..colors[3])
  384. end
  385. for i, p in pairs(teams[4]) do
  386. tfm.exec.setNameColor(p, "0x"..colors[4])
  387. end
  388. displayScore()
  389. end
  390. end
  391. function displayScore()
  392. if modoazar == "true" then
  393. 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)
  394. end
  395. if modoazar == "false" then
  396. 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='#111111'>%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)
  397. end
  398. end
  399. function displayTeams()
  400. modoazar = "false"
  401. ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  402. ui.addTextArea(37, "<p align='center'><V>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  403. ui.addTextArea(2, "", nil, 0, 71, 800, 290, 0x0E1417, 0x0E1417, 1, true)
  404. ui.addTextArea(4, "", nil, 57, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  405. ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 58, 80, 140, 20, 0x324650, 0x324650, 1, true)
  406. ui.addTextArea(6, "", nil, 227, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  407. ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 228, 80, 140, 20, 0x324650, 0x324650, 1, true)
  408. ui.addTextArea(8, "", nil, 417, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  409. ui.addTextArea(9, "<p align='center'><V>Team 3", nil, 418, 80, 140, 20, 0x324650, 0x324650, 1, true)
  410. ui.addTextArea(10, "", nil, 587, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  411. ui.addTextArea(11, "<p align='center'><V>Team 4", nil, 588, 80, 140, 20, 0x324650, 0x324650, 1, true)
  412. ui.addTextArea(12, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
  413. ui.addTextArea(39, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
  414. ui.addTextArea(40, "", nil, 59, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  415. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 198, 0x324650, 0x324650, 1, true)
  416. ui.addTextArea(32, "", nil, 419, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  417. ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 198, 0x324650, 0x324650, 1, true)
  418. ui.addTextArea(34, "", nil, 589, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  419. ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 198, 0x324650, 0x324650, 1, true)
  420. ui.addTextArea(36, "", nil, 229, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  421. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 198, 0x324650, 0x324650, 1, true)
  422. ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 325, 197, 140, 200, 0, 0, 0, true)
  423. ui.addTextArea(15, "", nil, 374, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  424. ui.addTextArea(16, "<p align='center'><V>VS", nil, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  425. ui.addTextArea(42, "", ADMINISTRADOR, 749, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  426. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", ADMINISTRADOR, 750, 82, 38, 18, 0x324650, 0x324650, 1, true)
  427. ui.addTextArea(45, "", ADMINISTRADOR, 744, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  428. ui.addTextArea(46, "<p align='center'><V><a href='event:reset'>Reset", ADMINISTRADOR, 745, 140, 50, 18, 0x324650, 0x324650, 1, true)
  429. ui.addTextArea(47, "", ADMINISTRADOR, 741, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  430. ui.addTextArea(54, "", ADMINISTRADOR, 741, 209, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  431. verificarmodo()
  432. ui.addTextArea(53, "", ADMINISTRADOR, 741, 245, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  433. ui.addTextArea(56, "<p align='center'><V><a href='event:llenar'><font size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
  434. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  435. ui.addTextArea(57, "", ADMINISTRADOR, 741, 281, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  436. ui.addTextArea(58, "<p align='center'><V><a href='event:azart'><font size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
  437. ui.addTextArea(59, "<p align='center'><V><a href='event:azart'><font size='12'>teams", ADMINISTRADOR, 742, 290, 55, 23, 0x000000, 0x000000, 1, true)
  438. 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)
  439. end
  440. function verificarmodo()
  441. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s ",modob),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  442. if modo == "bootcamp" then
  443. ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  444. end
  445. if modo == "racing" then
  446. ui.addTextArea(48, "<p align='center'><V><a href='event:racing'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  447. end
  448. if modo == "mix" then
  449. ui.addTextArea(48, "<p align='center'><V><a href='event:mix'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  450. end
  451. end
  452. function contarjugadores()
  453. local players=0
  454. function eventNewPlayer(name)--Cuando un jugador entre a la sala...
  455. players=players+1--Sumamos 1 a nuestra tabla
  456. end
  457. function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
  458. players=players-1--Restamos 1 a nuestra tabla
  459. end
  460. for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
  461. eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
  462. end
  463. end
  464. function eventTextAreaCallback(id, player, callback)
  465. if callback == 'iniciarJogo' then
  466. gameRunning = true
  467. for i = 1, 20 do
  468. ui.removeTextArea(i)
  469. end
  470. for i = 26, 60 do
  471. ui.removeTextArea(i)
  472. end
  473. newMap()
  474. points[1] = 0
  475. points[2] = 0
  476. points[3] = 0
  477. points[4] = 0
  478. displayScore()
  479. end
  480. if callback == 'salir' then
  481. tfm.system.exit()
  482. end
  483.  
  484. if callback == 'llenar' then
  485. nteam = 1
  486. azar = {}
  487. playersInGame = {}
  488.  
  489. teams = {
  490. [1] = {},
  491. [2] = {},
  492. [3] = {},
  493. [4] = {},
  494. }
  495. contarjugadores()
  496. for k,players in pairs(tfm.get.room.playerList) do
  497. if nteam > 4 then
  498. nteam = 1
  499. end
  500. table.insert(teams[nteam], k)
  501. playersInGame[k] = true
  502. nteam = nteam + 1
  503. displayTeams()
  504. end
  505. end
  506.  
  507.  
  508.  
  509. if callback == 'reset' then
  510. teams[1] = {}
  511. points[1] = 0
  512. teams[2] = {}
  513. points[2] = 0
  514. teams[3] = {}
  515. points[3] = 0
  516. teams[4] = {}
  517. points[4] = 0
  518. equipos = {}
  519. puntos = {}
  520. modob = "racing"
  521. modo = "bootcamp"
  522. displayTeams()
  523.  
  524. end
  525. if callback == 'bootcamp' then
  526. tiempo = 150
  527. modob = "bootcamp"
  528. modo = "mix"
  529. verificarmodo()
  530. maps = mapasbootcamp
  531. end
  532. if callback == 'racing' then
  533.  
  534. tiempo = 60
  535. modob = "racing"
  536. modo = "bootcamp"
  537. verificarmodo()
  538. maps = mapasracing
  539. end
  540. if callback == 'mix' then
  541. tiempo = 90
  542. modob = "mix"
  543. modo = "racing"
  544. verificarmodo()
  545. maps = mapasmix
  546. end
  547. if callback == 'azart' then
  548. playersInGame = {}
  549. teams[1] = {}
  550. teams[2] = {}
  551. teams[3] = {}
  552. teams[4] = {}
  553. alazar()
  554. modoazar = "true"
  555. modoalazar()
  556. end
  557. if callback == 'volver' then
  558. displayTeams()
  559. end
  560. if callback == 'bootcamp2' then
  561. tiempo = 150
  562. modob = "bootcamp"
  563. modo = "mix"
  564. verificarmodo2()
  565. maps = mapasbootcamp
  566. end
  567. if callback == 'racing2' then
  568.  
  569. tiempo = 60
  570. modob = "racing"
  571. modo = "bootcamp"
  572. verificarmodo2()
  573. maps = mapasracing
  574. end
  575. if callback == 'mix2' then
  576. tiempo = 90
  577. modob = "mix"
  578. modo = "racing"
  579. verificarmodo2()
  580. maps = mapasmix
  581. end
  582. end
  583. local totales = 0
  584. local totales2 = 0
  585. local jugando = {}
  586. local totaljugando = 1
  587. local jugandoposicion = {}
  588. function alazar()
  589. for k,v in pairs(tfm.get.room.playerList) do
  590. t = math.random(0,1)
  591. if t == 0 then
  592. table.insert(teams[1],k)
  593. playersInGame[k] = true
  594. end
  595. if t == 1 then
  596. table.insert(teams[2],k)
  597. playersInGame[k] = true
  598. end
  599. end
  600. end
  601.  
  602. function verificarmodo2()
  603. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  604. if modo == "bootcamp" then
  605. ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  606. end
  607. if modo == "racing" then
  608. ui.addTextArea(48, "<p align='center'><V><a href='event:racing2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  609. end
  610. if modo == "mix" then
  611. ui.addTextArea(48, "<p align='center'><V><a href='event:mix2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  612. end
  613. end
  614. function string.split(s, pattern, n)
  615. local st = {}
  616. for sb in string.gmatch(s, "[^"..pattern.."]+") do
  617. if not n or n > -1 then
  618. table.insert(st,sb)
  619. else
  620. st[#st] = st[#st]..pattern..sb
  621. end
  622. n = n and n-1 or false
  623. end
  624. return st
  625. end
  626. function table.contains(tableT, element)
  627. for _, value in pairs(tableT) do
  628. if value == element then
  629. return true
  630. end
  631. end
  632. return false
  633. end
  634. function eventPlayerDied()
  635. local alive = 0
  636. for k,v in pairs(tfm.get.room.playerList) do
  637. if not v.isDead then
  638. alive = alive+1
  639. end
  640. end
  641. if alive == 0 then
  642. newMap()
  643. end
  644. end
  645. displayTeams()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement