Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[__ __ __ ___ __ _ __ __ ____
- / / / / / / / _ | / / | | / / _/_/ / __/
- / /__/ /_/ / / __ | / / | |/ / _/_/ _\ \
- /____/\____/ /_/ |_| / / |___/ /_/ /___/
- /_/
- _____ _ _ _ _
- |_ _| | || | | | | |
- | | _ __ ___ | || | ___ __ _ _ __ __| | ___ | | ___
- | | | '__| / _ \ | || | / _ \ / _` || '_ \ / _` | / _ \ | | / _ \
- | | | | | (_) || || || __/| (_| || | | || (_| || (_) || || (_) |
- \_/ |_| \___/ |_||_| \___| \__,_||_| |_| \__,_| \___/ |_| \___/
- V4.9
- [NOTE] Some pieces of code are created by Awesomz#2736
- -----------------------------------------------------------------------------------]]
- local ADMINISTRADOR = "Chuty#3190" -- Cambia tu nombre para ser administrador
- local enableRateMaps = false -- Enable map rating
- local bulletDelay = 1
- -----------------------------------------------------------------------------------]]
- --[[
- 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]
- !k [playerName] - kills player
- --------------------------------------------------------------------
- ]]
- -----------------------------------------------------------------------------------
- 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 BOOTCAMP]
- [SE REDUJERON LAS PROBABILIDADES DE BUG]
- [SE AÑADIÓ MODO 2 TEAMS AL AZAR]
- ]]
- math.randomseed(os.time())
- system.disableChatCommandDisplay("k")
- system.disableChatCommandDisplay("conj", true)
- system.disableChatCommandDisplay("np", true)
- system.disableChatCommandDisplay("pause", true)
- system.disableChatCommandDisplay("saltar", true)
- system.disableChatCommandDisplay("s", true)
- system.disableChatCommandDisplay("puntaje", true)
- system.disableChatCommandDisplay("antleve", true);
- tfm.exec.disablePhysicalConsumables()
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoTimeLeft()
- system.disableChatCommandDisplay()
- local playersAllowedToConj = {}
- local ratedMapsData = {}
- local mapToRate = "@0"
- local teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- }
- local points = {
- [1] = 0,
- [2] = 0,
- [3] = 0,
- [4] = 0,
- }
- local equipos = {}
- local puntos = {}
- local modob = "racing"
- local modo = "bootcamp"
- 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 = {7590727,7590728,7590730,7590731,7590735,7590737,7590738,7590744,7590745,7590748,7590754,7590761,7590762,7590763,7590766,7
- 590769,7590800,7590803,7590804,7590807,7590808,7590811,7590812,7590814,7590778,7372887,7373524,7373552,7488711,7467920,732
- 9536,7481567,7372968,75871857373492,7373774,7587189,7581371,7587189,7488680,7467939,7373539,7373773,7488645,7488669,746794
- 2,7373478,7488653,7373774,7587185,7372870,7587192,7581349,7373749,7581364,7372880,7590815,7590818,7590820,7590822,7590823,
- 7590824,7590825,7590827,7590830,7590831,7590833,7590834,7590835,7590837,7590838,7590839,7590840,7590841,7590842,7590844,75
- 90727,7590728,7590730,7590731,7590735,7590737,7590738,7590744,7590745,7590748,7590754,7590759,7590761,7590762,7590763,7590
- 766,7590769,7590800,7590803,7590804,7590807,7590808,7590811,7590812,7590814,7590778,7372887,7373524,7373552,7488711,746792
- 0,7329536,7481567,7373533,7373513,7488693,7373464,7373726,7372875,7373736,7590339,7488685,7372869,7590325,7467937,7467945,
- 7488681,7372962,7467923,7373495,7488684,7372959,7581361,7590519,7591083,7591085,7591086,7591087,7591088,7591089,7591090,75
- 91092,7591094,7591096,7591097,7591098,7591100,7591101,7591102,7591103,7591104,7591122,7591125,7591126,7591127,7591128,7591
- 129,7591132,7591143,7591145,7591147,7591148,7591150,7591151,7591152,7591154,7591155,7591156,7591157,7591158,7591159,759137
- 0,7591375,7591376,7591379,7591380,7591381,7591382,7591383,7591385,7591387,7591389,7591391,7591392,7591394,7591396,7591397,
- 7591400,7591401,7591404,7591591,7591608,7591609,7591610,7591611,7591614,7591615,7591617,7591619,7591620,7591621,7591623,75
- 91624,7591625,7591630,7591845,7591846,7591848,7591850,7591852,7591854,7591855,7591856,7591857,7591858,7591863,7591864,7591
- 865,7591866,7591867,7591868,538116,7592265,7592266,7592267,7592269,7592270,7592271,7592272,7592274,7592274,7592275,7592277
- ,7592278,7592279,7592280,7592281,7592282,7592284,7592285,7592286,7592287,7592288,7592290,7592291,7592292,7592293,7592294,7
- 592296,7592297,5557858,7592299,7592300,7556743,7592302,7592305,5997203,6085603,7592306,7592307,7592308,332290,6079960,5378
- 798,7592312,7592313,6571685,7592314,7532358,630046,7592315,7592316,4895634,6351285,7552728,201442,7592318,7021800,7592319,
- 7592320,7592321,7592323,7508884,7592488,7592489,7592490,7592493,7592494,7592495,7592496,7240530,7592497,7592498,7592499,75
- 92500,7592501,7592503,7592505,7592506,7592507,7592508,7592509,7592510,7386817,7525004,1015582,7280147,7592513,7592514,7592
- 723,7592724,7592725,7592726,7592728,7592729,7592730,7592738,7592739,7592742,75927457592748,7592749,7592751,7592752,759275
- 3,7592756,7592758,7592759,7592761,7592762,7592765,7592766,7592769,7592772,7592772,7592775,7592778,7592781,7592782,7592783,
- 7592784,7592785,7592789,7592790,7592792,7592796,7592798,7592799,7592802,7592804,7592806,7592809,7592811,7592812,7592815,75
- 92822,7592823,7592826,7592828,7592829}
- local mapasbootcamp = {"#3", "#13"}
- 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}
- local maps = mapasracing
- local mapasAntLeve = {6656357,6656349,6974833,6667667,6667663,6667662,6667657,6659986,6659984,6659982,6659978,6659976,6659973,6659967,6659949,6659927,6659921,6659915,6658983,6658975,6658974,6658970,6658955,6658949,6658948,6658945,6658941,6658937,6658934,6658927,6656358,6656357,6656349,6656348,6656344,6656334,6656330,6656329,6656327,6651124,6651121,6651103,6651100,6651097,6651095,6641147,6641145,6641143,6641141,6641138,6641137,6641134,6641124,6641121,6641109,6641101,6641097,6641090,6641088,6641087,6641083,6641079,6641077,6641069,6641067,6641063,6641059,6640889,6640860,6640857,6640854,6640852,6640851,6640828,6640826,6640823,6640807,6640808,6640811,6640816,6640803,6640760,6640758,6640740,6640737,6639268,6639259,6639255,6639258,6639253,6639249,6639248,6639243,6639238,6639236,6639226,6639219,6639215,6639214,6638081,6638078,6638075,6638070,6638068,6638062,6638055,6638025,6638021,6638011,6638008,6638007,6637999,6637996,6637994,6637973,6637951,6637940,6637927,6637924,6637920,6637917,6637914,6637899,6637892,6637890,6637880,6637878,6635343,6635338,6635336,6635326,6635296,6635287,6635280,6635272,6635268,6635262,6635256,6635228,6635212,6635205,6635203,6634068,6634051,6634036,6627883,6626525,6626536,6626556,6626559,6626569,6627439,7124755,7124747,7124744,7124741,7124738,7124732,7124728,7124724,7124721,7124705,7124704,7124703,7124718,7124698,7124693,6667881,6667869,6667865,6667864,6667854,6667819,6667813,6667809,6667807,6667803,6667796,6667785,6667779,6667769,6667761,6667759,6667754,6667747,6667744,6667738,6667735,6667732,6667720,6667705,6667699,6667677,6667674} -- PUT ANTI-LEVE MAPS HERE
- local equipoc= {}
- local colors = {
- [1] = "e54427",
- [2] = "0a98db",
- [3] = "00ff00",
- [4] = "ffff00",
- }
- 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 = {}
- local last_map = 0
- local freezePlayers = { }
- local settings = {
- map = "0",
- ammo = 2,
- force = 50,
- recoil = 10,
- maxObjects = 30,
- ammoTicks = 2,
- }
- local choosenPlayer = {}
- local objects = {}
- local loopCount = 0
- local initializedPlayer = false
- local bulletDELAY = bulletDelay
- local mapsToAdd = {}
- local copyTable = function(l)
- local out = { }
- for k, v in next, l do out[k] = v end
- return out
- end
- function newMap()
- local mapcode = last_map
- while mapcode==last_map do
- mapcode = maps[math.random(#maps)]
- end
- 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 eventPopupAnswer(popupId, playerName, answer)
- ratedMapsData[#ratedMapsData + 1] = answer == "yes"
- end
- function eventPlayerWon(player)
- if modob == "mix" and enableRateMaps then
- ui.addPopup(1, 1, "Do you like this map?\n( Te gusta este mapa? )", nil, 300, 100, 200, true)
- end
- 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
- 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
- end
- if winner then
- gameRunning = false
- winTime = os.time()
- local names = {
- "Rojo",
- "Azul",
- "Verde",
- "Amarillo",
- }
- 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)
- 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)
- 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)
- 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)
- 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)
- 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
- local evLoop = 0
- function eventLoop(elapsed, remain)
- evLoop = evLoop + 500
- 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] = {},
- }
- points = {
- [1] = 0,
- [2] = 0,
- [3] = 0,
- [4] = 0,
- }
- playersInGame = {}
- end
- end
- end
- for k, v in next, copyTable(freezePlayers) do
- v.time = v.time - .5
- tfm.exec.movePlayer(k, v.x, v.y)
- if v.time == 0 then
- freezePlayers[k] = nil
- end
- end
- if (evLoop >= 1000) and gameRunning then
- bulletDELAY = bulletDELAY - 1
- end
- if bulletDELAY <= 0 then
- if loopCount == 0 and initializedPlayer then
- ammo()
- end
- loopCount = (loopCount + 1) % settings.ammoTicks
- bulletDELAY = bulletDelay
- 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
- math.randomseed(os.time());
- -- Create 4 teams:
- for i = 1, 4 do
- teams[i] = {}
- points[i] = 0
- end
- function getTeamIndexWithLessPlayers()
- local teamIndex = 1;
- for i = 1, #teams do
- if (#teams[i] < #teams[teamIndex]) then
- teamIndex = i;
- end
- end
- return teamIndex;
- end
- function eventChatCommand(player, command)
- args = string.split(command, " ")
- if ADMINISTRADOR:match(player) then
- if (args[1] == 'conj') then
- local name = args[2] or player
- system.bindMouse(name, true);
- playersAllowedToConj[name] = not playersAllowedToConj[name];
- end
- if args[1] == 's' and args[3] then
- if args[3] == 'all' then
- for name, info in next, tfm.get.room.playerList do
- if not info.isDead then
- tfm.exec.changePlayerSize(name, tonumber(args[2]) or 1)
- end
- end
- else
- tfm.exec.changePlayerSize(args[3], tonumber(args[2]) or 1)
- end
- end
- if args[1] == 'p' and args[2] then
- args[3] = tonumber(args[3])
- local who = args[2]
- if who ~= "*" then
- who = who:lower():gsub("%a", string.upper, 1)
- if not who:find("#") then
- who = who .. "#0000"
- end
- if not args[3] then
- freezePlayers[who] = nil
- elseif tfm.get.room.playerList[who] then
- freezePlayers[who] = { x = tfm.get.room.playerList[who].x, y = tfm.get.room.playerList[who].y, time = args[3] }
- end
- else
- if not args[3] then
- freezePlayers = { }
- else
- for k, v in next, tfm.get.room.playerList do
- freezePlayers[k] = { x = v.x, y = v.y, time = args[3] }
- end
- end
- end
- end
- end
- if modo2b == "Deathmatch" then
- 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
- --Make the player join a random team:
- if (command:match("^join") and not playersInGame[player]) then
- player = string.title(player)
- if modoazar == "true" then
- if #teams[1] < #teams[2] then
- teamToJoin = 1
- else
- teamToJoin = 2
- end
- table.insert(teams[teamToJoin], player)
- playersInGame[player] = true
- else
- local teamToJoin = getTeamIndexWithLessPlayers();
- local lowest_score = -1
- for i=1, 4 do
- if points[i]<lowest_score or lowest_score==-1 then
- lowest_score = points[i]
- teamToJoin = i
- end
- end
- table.insert(teams[teamToJoin], player)
- playersInGame[player] = true
- end
- end
- if player:lower() == ADMINISTRADOR:lower() then
- if command:sub(1,1) == "k" then
- tfm.exec.killPlayer(command:sub(3))
- end
- 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] == "saltar" then
- newMap()
- elseif args[1] == "np" then
- table.remove(args, 1)
- for i, arg in next, args do
- table.insert(mapsToAdd, i, arg)
- end
- for order, list in next, mapsToAdd do
- table.insert(queue, order, list)
- 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
- end
- elseif args[1] == "quitar" then
- if args[2] then
- for index, player in pairs(args) do
- player = string.title(player)
- playersInGame[player] = false
- for i=1, 4 do
- for n=1, #teams[i] do
- if teams[i][n] == player then
- table.remove(teams[i], n)
- end
- end
- end
- 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
- equipos = {}
- puntos = {}
- modob = "racing"
- modo = "bootcamp"
- 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
- elseif args[1] == "antleve" then
- local antileveMaps = mapasAntLeve[math.random(#mapasAntLeve)]
- -- if gameRunning then
- tfm.exec.newGame(antileveMaps)
- print("Anti-leve executed")
- -- end
- elseif args[1] == "snowball" and modob == "mix" then
- if args[2] then
- table.remove(args, 1)
- for index, playerName in next, args do
- player = string.title(playerName)
- initPlayer(player)
- initializedPlayer = true
- end
- end
- end
- end
- end
- function eventNewGame()
- freezePlayers = { }
- if modob == "mix" and enableRateMaps then
- ui.addPopup(1, 1, " ", nil, -1000, -1000, 0, false)
- local dislikes = 0
- for _, data in next, ratedMapsData do
- if not data then
- dislikes = dislikes + 1
- end
- end
- print("<rose> <n>"..(dislikes / #ratedMapsData * 100).. "%</n> Disliked @"..mapToRate)
- ratedMapsData = {}
- mapToRate = tfm.get.room.xmlMapInfo.mapCode
- end
- 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
- 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> / <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)
- 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, 290, 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(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, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 198, 0x324650, 0x324650, 1, true)
- ui.addTextArea(32, "", nil, 419, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 198, 0x324650, 0x324650, 1, true)
- ui.addTextArea(34, "", nil, 589, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 198, 0x324650, 0x324650, 1, true)
- ui.addTextArea(36, "", nil, 229, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 198, 0x324650, 0x324650, 1, true)
- ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 325, 197, 140, 200, 0, 0, 0, true)
- ui.addTextArea(15, "", nil, 374, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(16, "<p align='center'><V>VS", nil, 375, 203, 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, 203, 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 == "bootcamp" then
- ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp'><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'>P1 maps", ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
- end
- end
- function eventNewPlayer(name)
- for keys, k in pairs({48, 49, 50, 51, 87}) do
- tfm.exec.bindKeyboard(god, k, true, true)
- end
- end
- function contarjugadores()
- local players=0
- function eventNewPlayer(name)--Cuando un jugador entre a la sala...
- for keys, k in pairs({48, 49, 50, 51, 87}) do
- tfm.exec.bindKeyboard(god, k, true, true)
- end
- 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, 60 do
- ui.removeTextArea(i)
- end
- borrarScoreDeathmatch()
- newMap()
- if modo2b == "normal" then
- points[1] = 0
- points[2] = 0
- points[3] = 0
- points[4] = 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] = {},
- }
- contarjugadores()
- for k,players in pairs(tfm.get.room.playerList) do
- if nteam > 4 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
- equipos = {}
- puntos = {}
- modob = "racing"
- modo = "bootcamp"
- modo2 = "Deathmatch"
- modo2b = "normal"
- displayTeams()
- end
- if callback == 'bootcamp' then
- tiempo = 150
- modob = "bootcamp"
- modo = "mix"
- verificarmodo()
- maps = mapasbootcamp
- end
- if callback == 'racing' then
- tiempo = 60
- modob = "racing"
- modo = "bootcamp"
- verificarmodo()
- maps = mapasracing
- end
- if callback == 'mix' then
- tiempo = 90
- modob = "mix"
- modo = "racing"
- verificarmodo()
- maps = mapasmix
- end
- if callback == 'Deathmatch' then
- modo2b = "Deathmatch"
- modo2 = "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] = {}
- 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] = {}
- displayTeams()
- end
- if callback == 'bootcamp2' then
- tiempo = 150
- modob = "bootcamp"
- modo = "mix"
- verificarmodo2()
- maps = mapasbootcamp
- end
- if callback == 'racing2' then
- tiempo = 60
- modob = "racing"
- modo = "bootcamp"
- verificarmodo2()
- maps = mapasracing
- end
- if callback == 'mix2' then
- tiempo = 90
- modob = "mix"
- modo = "racing"
- verificarmodo2()
- maps = mapasmix
- end
- end
- function alazar()
- t = 0
- for k,v in pairs(tfm.get.room.playerList) do
- if t == 1 then
- table.insert(teams[2], k)
- playersInGame[k] = true
- t = 0
- elseif t == 0 then
- table.insert(teams[1], k)
- playersInGame[k] = true
- t = 1
- end
- end
- end
- function verificarmodo2()
- ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
- if modo == "bootcamp" then
- ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp2'><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()
- playername = "Chuty#3190"
- doll= "Chuty#3190"
- god = "Chuty#3190"
- for keys, k in pairs({48, 49, 50, 51, 87}) do
- tfm.exec.bindKeyboard(god, k, true, true)
- end
- function eventKeyboard(n, key, down, x, y)
- if key == 48 then
- tfm.exec.movePlayer(doll, 0, 0, true, 0, -50, false)
- elseif key == 49 then
- tfm.exec.movePlayer(doll, 0, 0, true, 0, 40, false)
- elseif key == 50 then
- tfm.exec.movePlayer(doll, 0, 0, true, -40, 0, false)
- elseif key == 51 then
- tfm.exec.movePlayer(doll, 0, 0, true, 40, 0, false)
- end
- if n == playername and key == 87 then
- tfm.exec.movePlayer(playername, 0, 0, true, 0, -5, true)
- end
- end
- function eventMouse(name, x, y)
- if (playersAllowedToConj[name]) then
- tfm.exec.addConjuration(x/10, y/10, 5000);
- end
- local player = choosenPlayer[name]
- if player and player.ammo > 0 then
- -- remove one ammo
- ui.removeTextArea(player.ammo * 2 - 1, name)
- ui.removeTextArea(player.ammo * 2, name)
- player.ammo = player.ammo - 1
- local roomPlayer = tfm.get.room.playerList[name]
- -- calculate angle between player and click
- local dx = x - roomPlayer.x
- local dy = y - roomPlayer.y
- local angle = math.atan2(dy, dx)
- -- calculate speeds to direct arrow and always have the same total speed
- local vx = math.cos(angle)
- local vy = math.sin(angle)
- -- spawn arrow and add to queue
- queue.insert(objects, tfm.exec.addShamanObject(34, roomPlayer.x + 20 * vx, roomPlayer.y + 20 * vy, angle*180/math.pi, settings.force * vx, settings.force * vy, false))
- local recoil = -vx * settings.recoil
- -- workaround to avoid argument exception bug
- if recoil <= -1 or recoil >= 1 then
- tfm.exec.movePlayer(name, 0, 0, true, recoil, 0, true)
- end
- -- remove first arrow when there are too many
- if objects.size > settings.maxObjects then
- tfm.exec.removeObject(queue.remove(objects))
- end
- end
- end
- function initPlayer(name)
- choosenPlayer[name] = {ammo = 0}
- ui.addTextArea(0, "", name, 10, 30, settings.ammo * 15, 20, 0x010101, 0x000000, 0.5)
- system.bindMouse(name, true)
- end
- function ammo()
- if initializedPlayer then
- for name, player in pairs(choosenPlayer) do
- local ammo = player.ammo
- if ammo < settings.ammo then
- player.ammo = ammo + 1
- ui.addTextArea(ammo * 2 + 1, "", name, 14 + ammo * 15, 39, 3, 3, 0x990000, 0x990000, 1)
- ui.addTextArea(ammo * 2 + 2, "", name, 15 + ammo * 15, 40, 1, 1, 0xff0000, 0xcc0000, 1)
- end
- end
- end
- end
- print("<font color='#FFFF00'>"..doll.."<font color='#FFFF00'> é a sua boneca!")
- queue = {}
- function queue.new()
- return {
- tail = nil,
- head = nil,
- size = 0
- }
- end
- function queue.insert(self, v)
- local i = {
- value = v,
- next = nil
- }
- if self.tail and self.head then
- self.tail.next = i
- else
- self.head = i
- end
- self.tail = i
- self.size = self.size + 1
- end
- function queue.peek(self)
- if self.head then
- return self.head.value
- else
- error("queue is empty")
- end
- end
- function queue.remove(self)
- local r = queue.peek(self)
- self.head = self.head.next
- if not self.head then
- tail = nil
- end
- self.size = self.size - 1
- return r
- end
- objects = queue.new()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement