Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.83 KB | None | 0 0
  1. --[[__ __ __ ___ __ _ __ __ ____
  2. / / / / / / / _ | / / | | / / _/_/ / __/
  3. / /__/ /_/ / / __ | / / | |/ / _/_/ _\ \
  4. /____/\____/ /_/ |_| / / |___/ /_/ /___/
  5. /_/
  6. _____ _ _ _ _
  7. |_ _| | || | | | | |
  8. | | _ __ ___ | || | ___ __ _ _ __ __| | ___ | | ___
  9. | | | '__| / _ \ | || | / _ \ / _` || '_ \ / _` | / _ \ | | / _ \
  10. | | | | | (_) || || || __/| (_| || | | || (_| || (_) || || (_) |
  11. \_/ |_| \___/ |_||_| \___| \__,_||_| |_| \__,_| \___/ |_| \___/
  12. V4.9
  13. [NOTE] Some pieces of code are created by Awesomz#2736
  14. -----------------------------------------------------------------------------------]]
  15. local ADMINISTRADOR = "Chuty#3190" -- Cambia tu nombre para ser administrador
  16. local enableRateMaps = false -- Enable map rating
  17. local bulletDelay = 1
  18. -----------------------------------------------------------------------------------]]
  19. --[[
  20. Comandos:
  21. !saltar - Para cambiar de mapa
  22. !puntos - Para cambiar el puntaje, ej: !puntos team1 5
  23. !np @codigo - Para poner cualquier mapa
  24. !pausa - Para pausar el juego
  25. !team - Para asignar jugadores a un equipo, ej: !team1 Trolleandolo
  26. !d NUMERO - Asigna el puntaje para ganar, ej: !d 20
  27. !añadir team nick - Añade un jugador a el equipo especificado, ej: !añadir team4 Trolleandolo
  28. !reset - Resetea el juego
  29. !quitar NOMBRE - saca a un jugador del juego
  30. !puntaje - para ver el puntaje [SOLO EN MODO DEATHMATCH]
  31. !k [playerName] - kills player
  32. --------------------------------------------------------------------
  33. ]]
  34. -----------------------------------------------------------------------------------
  35. local WINS = 15 -- Puntaje para ganar.
  36. ------------------------------------------------------------------------------------
  37. --[[
  38. MEJORAS DE LA VERSIÓN
  39. [BOTÓN REVANCHA EN DEATHMATCH Y TEAMS]
  40. [SE QUITÓ UN BUG]
  41. [SE AÑADIERON MAPAS DE BOOTCAMP]
  42. [SE REDUJERON LAS PROBABILIDADES DE BUG]
  43. [SE AÑADIÓ MODO 2 TEAMS AL AZAR]
  44. ]]
  45. math.randomseed(os.time())
  46. system.disableChatCommandDisplay("k")
  47. system.disableChatCommandDisplay("conj", true)
  48.  
  49. system.disableChatCommandDisplay("np", true)
  50. system.disableChatCommandDisplay("pause", true)
  51. system.disableChatCommandDisplay("saltar", true)
  52. system.disableChatCommandDisplay("s", true)
  53. system.disableChatCommandDisplay("puntaje", true)
  54. system.disableChatCommandDisplay("antleve", true);
  55. tfm.exec.disablePhysicalConsumables()
  56. tfm.exec.disableAutoShaman()
  57. tfm.exec.disableAutoNewGame()
  58. tfm.exec.disableAutoTimeLeft()
  59. system.disableChatCommandDisplay()
  60.  
  61. local playersAllowedToConj = {}
  62.  
  63. local ratedMapsData = {}
  64. local mapToRate = "@0"
  65. local teams = {
  66. [1] = {},
  67. [2] = {},
  68. [3] = {},
  69. [4] = {},
  70. }
  71. local points = {
  72. [1] = 0,
  73. [2] = 0,
  74. [3] = 0,
  75. [4] = 0,
  76. }
  77. local equipos = {}
  78. local puntos = {}
  79. local modob = "racing"
  80. local modo = "bootcamp"
  81. local modo2 = "Deathmatch"
  82. local modo2b = "normal"
  83. local tiempo = 60
  84. tonumber(tiempo)
  85. local isfirst = false
  86. local gameRunning = false
  87. local winTime = false
  88. local playersInGame = {}
  89. local distanciax = 30
  90. local distanciay = 80
  91. local textarealugar = 300
  92. local textareaid = 0
  93. local mapasmix = {3046622,1844404,2319756,1921105,235863,481141,3710878,3745348,1551411,599339,1132841,3186738,1445806,2950316,1999433,7588217,7588218,7588221,7588222,7588224,7588225,7588229,7588230,7588233,7588235,7588238,3517551,7588239,7588240,7588243,7588244,7588245,7588246,7588249,7588251,7588253,7588256,7588257,7586454,4564380,1709079,1463576,2473784,1990585,4225415,3534755,1529753,6568183,3964168,4465679,5830619,1636847,3084024,2978758,2207242,2828225,1430257,1611752,5083570,1503669,3658619,3712466,2156325,2713762,7301894,912490,3637190,3690789,1469911,5086164,3702120,721910,2093306,3668632,3891989,3865829,1807161,2681705,2013606,1220037,7586576,7586577,7586578,7586579,7586581,7586582,7586583,7586584,7586585,7586587,7586589,7586590,7586591,7586592,7586593,7586594,7586595,3610554,7586596,7586597,7586598,7586600,7586601,7586602,3089485,7586603,2163742,1053539,1721251,5478906,6205970,3156745,4348352,3241835,3326440,1569481,3636571,2986279,1643776,3837289,5431781,6752042,2418253,2416543,5160713,3358124,411687,1712441,193187,2877165,1608238,1819776,3480598,2626804,3581991,3898426,2481042,3181008,4182202,5611222,2100416,2816064,2543452,3932685,5105940,389768,5395761,3697752,1967351,6830525,3896856,2705995,3489333,5484871,2501538,5313078,1118306,4818087,3428934,3757278,5523199,1944889,1519256,2894515,3150084,1468561,5499302,4900101,3570936,7585875,7585876,7585877,7585879,7585888,7585889,7585892,7585893,7585896,7585897,7585898,7585899,7585900,3520878,7585901,7585903,7585904,7585906,193187,7585907,7585908,7585911,7585912,6733104,521756,2785571,7243656,2504433,268985,4697282,2857448,2457864,1387242,2983538,1746823,6872493,3851834,3143538,468972,5814223,3841284,3630979,3216342,2774931,1040236,677608,895971,3564891,3676523,2159625,3697872,6121939,3806103,3946237,5539855,1817776,2185227,2445318,2973285,6203577,1606904,3190335,6103100,1590935,520308,2154166,6202855.1761416,2767238,3539557,531393,1537810,7521287,3803640,3705380,5000056,2962094,3549002,7259687,1699725,1451996,1610004,1338610,296361,1548446,3023500,6304005,4380537,7074890,3520951,1652941,3755613,4009415,401705,2237427,6201167,2784397,5255657,533946,3015348,4234518,3387926,1808440,852036,4271527,3661778,1580042,2880295,1616692,2413286,3988481,2583328,3221567,1453388,2972456,5017009,3663231,3491935,3478705,1891199,6140452,6498002,1706451,3777243,1691451,3685069,1964070,5070340,1972853,2178289,1418353,3849085,4298073,2211530,1845355,6109280,2035594,7583983,1999538,733188,7583985,1407496,885790,3717973,3906543,5948551,5976869,2452276,6070666,1487531,3026533,1975642,6714712,3217173,542206,2913914,5656820,1769722,1780844,7227763,7584185,7584186,7584187,7584189,7584190,2668543,7584191,7584192,7584193,7584194,7584195,5707667,7584197,7584198,7584201,7584202,7584204,1840109,3035430,3641597,5723425,716454,1748936,2698747,2024218,3204335,2833702,505805,2048050,3696199,3089894,1828315,3069262,3750609,2731707,3729330,1794589,2017255,7491603,4640565,4055165,6840620,6965421,3164541,6965421,3685464,2054943,365315,5813469,1033390,7054190,1124859,3641873,3661173,1473836,2431444,3503305,5737012,2423265,1705725,1949215,1589402,2476398,5710452,5919033,2879902,3497217,6571252,3433197,6104868,6726790,1380450,2558489,3721136,1650589,3647084,3624946,6557245,3912825,5166234,3029129,1477421,1799351,1737233,2038475,1446502,2012857,1958837,5432386,6042206,243962,5070428,2198167,2749103,1369255,2557752,5188867,3731931,3238202,1439286,5176687,1446952,1142162,3328963,721229,6050971,3531249,3756184,1532940,6660659,3184847,1971197,3832344,5293621,2239095,7581422,3379444,7581425,5402499,7581426,7581430,7581431,7581433,857969,7090005,7581435,7581437,7581441,4702472,7581442,7581443,7581444,7581445,7581446,7581447,7581448,7581449,7581450,5213306,7581451,7560419,7581453,7581456,7581457,7581458,5746152,7227007,4864351,3060011,5200910,3257930,2398407,1544861,3144670,1644081,2006666,1580374,5796038,2815472,5681686,3100650,2692126,1741073,2102814,3710363,1402257,2665959,3615479,2808418,5756977,370831,2129581,3684931,2716169,1609642,3702443,4359062,6516286,5524577,2274853,3831715,3478750,554595,3681488,3429348,1630969,808903,1815144,1997567,2984611,4966199,2479767,3350174,2977670,5758757,1776462,6032284,1494544,4211491,1819646,2787653,2915889,4723257,1284922,3402209,5544351,5096786,1421488,1319953,2151630,3090268,3728775,2696883,6975901,1682563,1055301,4089620,5493813,3388889,3873919,3621510,2040327,7563886,7563888,1703062,1770702,2049829,1031162,1940633,1477077,3485112,3650626,2240014,3000880,4833628,1568124,2599257,2457551,3963989,7574385,1923304,319426,2064891,5952334,5854437,2962820,3909564,3110731,3746970,3671792,630767,3960389,4625712,1473876,7088745,6647453,3236460,1391129,3894282,1664227,2816435,5838710,3285994,5017387,1476814,2306483,5568574,2537299,1183614,6255741,4143293,1357913,329489,768679,312415,345232,541888,883644,541088,415457,527634,5327280,3361351,1792257,2797861,2954979,3881931,3733964,2320378,7574387,7574388,7574390,7574391,7574392,2882873,2695460,5597023,2098179,7574400,2201219,5736061,1582926,1677763,38286787,1878759,7543645,393067,3067756,3963989,6717825,6731562,6820863,5865143,5746807,278585,1821529,6800839,141355,1220087,2922338,411415,7574383,5604555,6453895,7288042,2011033,1056854,3041398,311316,7514011,2211509,2982818,1566653,2266481,3357603,2802076,454094,1143472,5661746,3042024,4130245,1380341,7574381,7574382,3413565,3755295,3006464,2866340,2428982,3452457,2736710,439982,2713132,6526973,2425058,5489217,5231904,3164976,3783573,2141733,5281388,2624327,2455731,4306045,3318104,4427048,5896853,1642281,3095578,3821686,2247536,524651,3635836,2429975,2982051,1854121,313539,2055462,1357903,3915506,1213682,3569080,1676593,2187555,1998209,2200136,1739798,756388,2543093,5265432,2905532,2479621,7563913,1973197,1349271,5559971,7066091,5520818,2613717,3676771,1278553,3604629,1652907,5804164,1994754,7121654,1672102,3579181,3747997,136372,2918560,4395334,2363401,2203543,854252,7002137,2459502,3587695,2053429,697099,734286,566586,3707753,1626985,5784387,1265041,6798468,3772198,4244560,2673219,1695546,2994363,2730612,3100754,886099,3110056,3701884,3350141,3458781,112125,7294527,3099936,2317494,2286884,1620205,1941646,2451539,5462759,1752343,1291046,1767282,1634135,4940660,395638,1982490,1476917,1520050,5046251,2511270,7111081,3486777,339688,1817461,2601124,2242986,1465794,2925302,1705533,2922706,4836774,3660363,745660,3169468,1520763,3509457,3569617,355391,6648567,862026,2023835,2502370,7193672,1294506,3343007,2226606,3683984,1700134,3292563,7458781,2060440,3777791,3219347,5474,771,6020360,6886256,1585825,4483044,2054433,4372220,3823226,2111371,7014627,1416017,1569410,2901923,5597196,3368095,1959434,5120511,3800025,1874309,3903481,6025066,840023,2682348,3699720,2896854,3688479,1502057,1555263,809981,585601,1375127,1596918,360669,2840545,5635682,1846140,2615488,2849336,3201680,1231531,3608639,3146467,5324271,1976484,9789163120589,3680975,5517500,3089475,3192865,447198,5133665,3565552,1662547,2770880,1311245,6149285,6569917,6569917,1002415,562828,3245190,5484232,2459645,3568909,7552342,1203580,4082130,2222106,609377,6827736,1605542,5782928,1733405,7073872,2003397,3176790,2704798,940479,17024143193031,3495072,5246769,1886726,3806514,444669,4346701,3637879,1651912,2810301,2483585,6013518,2967201,1712139,1434614,2037858,1486073,796522,1704970,7562539,6006077,2904194,2299901,7379672,3428969,3695243,1646580,4856787,3693603,1695961,573162,1602006,5225660,7279147,4130519,2847085,432838,3367472,1661557,5578142,3848961,556991,5470076,1934684,7423396,3827073,2216672,5925390,2422320,6011897,1684971,5874848,2904364,1826106,1299778,3889066,1651396,2474610,2954389,2912090,1557183,1937029,2507487,5478924,1715294,2922372,5463645,1681132,4780988,913716,3545388,2932771,5413653,1845425,7295773,7094153,2493682,2990927,2887564,2677697,408672,5316507,3703101,7094153,2493682,2990927,3632558,2887564,2677697,408672,5316507,3703101,1308009,4770812,5337079,3755004,1415101,5745185,982968,3660773,1308009,4770812,5337079,3121001,247806,2271606,3931104,37258313205507,5505571,2668317,2885795,7051723,3732788,6507006,1709842,3412978,4119570,3678477,1576605,7175099,1305918,2924041,530050,1671341,6538336,2590428,3111412,3444188,2745018,4100202,2604892,3778127,2930905,5229169,7201798,1935783,1766070,1934713,3600756,2213804,2767444,2422252,2581588,2008408,3225517,1583004,806374,4743209,2206428,1337908,3639063,5819000,3696099,2222914,2000227,7422917,1883283,1686313,5521222,3089084,2442179,1759304,1747395,6538525,2553999,6982855,3685130,6751808,6099941,4934225,1516378,5805504,675584,470956,2510902,1242503,3749719,2487185,4129854,3526684,5851713,1567499,1723502,485685,5331758,3063021,312874,5086885,1334799,2673350,2094529,816937,1984183,3660915,5067745,1836636,2570299,4974043,2958926,1617612,16642067,2324943,1207415,7546911,2818215,4244697,3974286,1694497,7165647,3671337,2801423,2510424,2306838,1388511,624595,1297286,2436358,6091196,5512914,487571,534127,2815852,6458416,3804033,4933567,5744422,5722902,5470939,5452179,5457991,1640994,2873717,1524883,1845772,3674891,1875155,2464178,1739033,7421606,3724024,1791754,4159572,967165,2701754,5567026,2472185,5552462,331054,249043,3889066,1651396,2474610,2954389,2912090,1557183,1937029,2507487,5478924,1715294,2922372,5463645,1681132,4780988,913716,3545388,2932771,5413653,3084699,2785576,379257,1860558,4848841,3177975,2873752,2529630,2521006,400020,7543202,7534845,3699951,5905174,1989575,2497300,451053,2184388,1392529,434181,4851652,3721264,2702019,1597479,336108,1338400,7463026,1821872,3678098,1974435,6474880,3134012,2177055,1458500,3305645,856005,1595486,5458093,1612392,2460705,6267145,1580571,1538872,5824666,3872292,2604202,1970794,1794494,6914627,3913043,522169,1557181,2889144,1682581,3570595,2952667,3531094,972593,2828325,3718893,625620,1826923,3777243,3162194,2071143,3175833,2822802,6450734,3075720,1552345,400875,3695422,3617908,4999095,868500,3273027,1830647,3001168,839357,143026,6509298,6216983,2866493,1699319,3913043,6043877,2777244,3790887,1597535,6096882,5366786,1943658,5967356,4644327,2573869,4886905,5497221,6166360,3757587,1601279,409682,3656856,1880412,5548982,440803,3486898,1469614,1691653,3517982,1971388,1591567,2016029,1915474,1257990,2836295,3495373,1595131,2712714,2038888,2667948,2112482,5898371,2152725,1794645,1766575,3413233,1394393,2752920,5826810,1800219,3236194,780379,5880743,3888975,3239977,1672342,1289969,2634502,5898371,1994578,6070379,3974343,3862812,1959522,2695007,1975949,5539548,3817687,1969538,526457,3648898,2497733,3919737,3230126,3112996,1649655,1414281,1419212,1209447,4702472,524427,1578727,4670311,6569858,1900395,5593658,748627,3220216,3036369,1533891,6104868,5208730,3220691,2113571,5692470,1545496,212279,6832768,3411897,5039866,4198229,3220150,5040626,6945400,1580625,3783670,5086760,2954390,4649501,5605098,4316966,3814007,1893227,1570197,3950540,1662866,3720504,124749,1739328,1839751,3267052,3780004,5534969,5493628,2189066,4933333,5000031,2414326,1660312,877064,3650461,1740582,7532482,3694198,2852186,1170709,2872105,1682394,1202364,2153009,4366270,1824797,927167,1295001,919407,6814675,7108753,5556574,2818776,2749154,215024,5307145,4186227,5721017,1295391,2514839,5895587,903753,5642148,3886007,7576967,7577628,7577632,7577633,7577634,7577635,7577636,904700,7577637,7577638,7577639,7577641,7577645,7577646,7577648,7577649,7577650,7577652,7577654,455254,7577656,3708532,7577659,7577660,7577661,7577662,7577663,2951831,1632286,3133284,2888737,2959380,7316490,2923902,1879135,3817089,3743709,5784317,2196639,3491472,2932823,3556939,4721537,5557000,3707957,4449825,4335108,1650317,2627810,4940330,1197771,2515859,924199,5342184,3178756,6461474,3961089,2434803,4028439,3820443,2753029,3902921,1636847,5146101,1352371,6149586,2280915,1566790,2461560,1811706,1663869,6593705,1356823,6712790,1961069,3510802,3674914,2185637,1714183,5772036,4814426,2011425,5719032,3703405,5208010,120696,1677751,1390504,5058856,3153335,1997462,3603807,41413,2439981,2152273,2837758,2846092,5850864,1155577,3507172,287241,3741419,692902,5316041,5301410,3682607,1753932,3091367,788325,1449159,3366992,916292,6347261,1434657,6102366,1255406,2901402,1076556,2798150,1729711,5683203,6837500,1962691,5198233,599132,567368,3950087,4074777,6419244,2916236,4800287,3757673,293239,6536106,809165,3415097,854987,1990729,1476644,3197548,3732761,3042947,1669694,2670433,2863240,3744754,3042024,1414583,1405201,3900432,5568878,1344308,1827745,3192935,1904605,480826,1254895,3641472,4882220,1634079,3172505,2256215,562530,1394768,786326,6158708,3352107,5391121,5067010,2468375,3201256,3724600,6286341,3549181,7186722,339068,1979304,5435620,6028061,2708731,5178280,1201818,5699567,3397714,2247468,2719292,2179111,2232637,2368305,1411884,1623902,3824123,2917535,5641251,3737863,1900927,3026180,6873059,3324192,4289072,3233197,2023564,3691680,2277265,1757932,2676236,6428562,5881430,7576691,7576693,7576695,2794461,7576709,1395712,5530715,7576703,5444350,2207345,2842087,3572040,2162120,2440783,3499995,5130206,2370767,4558726,2591394,4060762,3628872,3532285,4675569,2835676,1528880,1383825,7272444,1961891,3079549,2501462,1986742,7545766,5400102,7070700,7100013,3521381,5504146,1976484,2609729,957128,997153,5727892,2380804,1310682,2807482,3101639,3044133,608631,2563142,1156897,3490631,3662992,1795637,5452668,4217430,2251303,3057877,1646186,5327503,2493682,6191961,1785252,6340741,2488702,3720570,2810346,4877063,3854293,575662,1907014,3047479,1986742,1716079,2606512,2606512,1612436,1982506,220935,1447073,4069988,5950280,5613707,2720250,1764190,7362662,4327453,1854383,1667570,2956296,1578036,354759,2870581,1462709,3718084,4797932,3337441,5410633,2621030,1837491,2825611,3207688,6101891,1965085,1618019,1977256,3936998,264703,3180155,1583081,1857925,3577533,1889832,1674133,2395730,1816288,865228,1863285,562845,4140811,3522511,4675782,2049637,885029,4888891,3555164,1112380,1707338,3141100,2815451,1346358,1485567,1929667,3411709,545781,3931308,2376400,2074773,4350786,5696509,1212123,3675423,870306,369681,3911642,732670,65153223208273,1947104,2861616,7146696,5727966,5544344,2200571,1654575,2870129,2438149,1783803,4726846,566405,5521249,2964283,1718606,2931383,6068515,356909,3387580,3662963,1390843,3380309,2273250,1463033,5696927,3604144,1995181,2223354,621792,4298881,2389991,3018399,1738402,4216313,1588182,1509640,3475709,2732012,3786946,5444310,2740735,3678170,1760310,2760069,2136431,4414133,2661522,2298033,3693685,2041416,2993613,4901435,2629615,6954201,1481171,2857562,478496,3487949,3046275,1961336,1919727,5000014,2129630,7205609,1728908,446226,1462790,1840202,2094275,2889323,2534715,3685884,2578386,1396216,2598706,2455062,1924872,2824021,3600181,361852,3709369,346069,1824086,1697385,3066506,5749982,4729716}
  94. local mapasbootcamp = {"#3", "#13"}
  95. local mapasracing = {7590727,7590728,7590730,7590731,7590735,7590737,7590738,7590744,7590745,7590748,7590754,7590761,7590762,7590763,7590766,7
  96. 590769,7590800,7590803,7590804,7590807,7590808,7590811,7590812,7590814,7590778,7372887,7373524,7373552,7488711,7467920,732
  97. 9536,7481567,7372968,75871857373492,7373774,7587189,7581371,7587189,7488680,7467939,7373539,7373773,7488645,7488669,746794
  98. 2,7373478,7488653,7373774,7587185,7372870,7587192,7581349,7373749,7581364,7372880,7590815,7590818,7590820,7590822,7590823,
  99. 7590824,7590825,7590827,7590830,7590831,7590833,7590834,7590835,7590837,7590838,7590839,7590840,7590841,7590842,7590844,75
  100. 90727,7590728,7590730,7590731,7590735,7590737,7590738,7590744,7590745,7590748,7590754,7590759,7590761,7590762,7590763,7590
  101. 766,7590769,7590800,7590803,7590804,7590807,7590808,7590811,7590812,7590814,7590778,7372887,7373524,7373552,7488711,746792
  102. 0,7329536,7481567,7373533,7373513,7488693,7373464,7373726,7372875,7373736,7590339,7488685,7372869,7590325,7467937,7467945,
  103. 7488681,7372962,7467923,7373495,7488684,7372959,7581361,7590519,7591083,7591085,7591086,7591087,7591088,7591089,7591090,75
  104. 91092,7591094,7591096,7591097,7591098,7591100,7591101,7591102,7591103,7591104,7591122,7591125,7591126,7591127,7591128,7591
  105. 129,7591132,7591143,7591145,7591147,7591148,7591150,7591151,7591152,7591154,7591155,7591156,7591157,7591158,7591159,759137
  106. 0,7591375,7591376,7591379,7591380,7591381,7591382,7591383,7591385,7591387,7591389,7591391,7591392,7591394,7591396,7591397,
  107. 7591400,7591401,7591404,7591591,7591608,7591609,7591610,7591611,7591614,7591615,7591617,7591619,7591620,7591621,7591623,75
  108. 91624,7591625,7591630,7591845,7591846,7591848,7591850,7591852,7591854,7591855,7591856,7591857,7591858,7591863,7591864,7591
  109. 865,7591866,7591867,7591868,538116,7592265,7592266,7592267,7592269,7592270,7592271,7592272,7592274,7592274,7592275,7592277
  110. ,7592278,7592279,7592280,7592281,7592282,7592284,7592285,7592286,7592287,7592288,7592290,7592291,7592292,7592293,7592294,7
  111. 592296,7592297,5557858,7592299,7592300,7556743,7592302,7592305,5997203,6085603,7592306,7592307,7592308,332290,6079960,5378
  112. 798,7592312,7592313,6571685,7592314,7532358,630046,7592315,7592316,4895634,6351285,7552728,201442,7592318,7021800,7592319,
  113. 7592320,7592321,7592323,7508884,7592488,7592489,7592490,7592493,7592494,7592495,7592496,7240530,7592497,7592498,7592499,75
  114. 92500,7592501,7592503,7592505,7592506,7592507,7592508,7592509,7592510,7386817,7525004,1015582,7280147,7592513,7592514,7592
  115. 723,7592724,7592725,7592726,7592728,7592729,7592730,7592738,7592739,7592742,75927457592748,7592749,7592751,7592752,759275
  116. 3,7592756,7592758,7592759,7592761,7592762,7592765,7592766,7592769,7592772,7592772,7592775,7592778,7592781,7592782,7592783,
  117. 7592784,7592785,7592789,7592790,7592792,7592796,7592798,7592799,7592802,7592804,7592806,7592809,7592811,7592812,7592815,75
  118. 92822,7592823,7592826,7592828,7592829}
  119. local maps = mapasracing
  120. 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
  121.  
  122. local equipoc= {}
  123. local colors = {
  124. [1] = "e54427",
  125. [2] = "0a98db",
  126. [3] = "00ff00",
  127. [4] = "ffff00",
  128. }
  129. local queue = {}
  130. local nteam = 1
  131. local azar = {}
  132. local posicion = {}
  133. local modoazar = ""
  134. local numeroposicion = 1
  135. local totales = 0
  136. local totales2 = 0
  137. local jugando = {}
  138. local totaljugando = 1
  139. local jugandoposicion = {}
  140. local last_map = 0
  141.  
  142. local freezePlayers = { }
  143.  
  144. local settings = {
  145. map = "0",
  146. ammo = 2,
  147. force = 50,
  148. recoil = 10,
  149. maxObjects = 30,
  150. ammoTicks = 2,
  151. }
  152.  
  153. local choosenPlayer = {}
  154. local objects = {}
  155. local loopCount = 0
  156. local initializedPlayer = false
  157. local bulletDELAY = bulletDelay
  158. local mapsToAdd = {}
  159.  
  160.  
  161. local copyTable = function(l)
  162. local out = { }
  163. for k, v in next, l do out[k] = v end
  164. return out
  165. end
  166.  
  167. function newMap()
  168. local mapcode = last_map
  169. while mapcode==last_map do
  170. mapcode = maps[math.random(#maps)]
  171. end
  172. if #queue > 0 then
  173. mapcode = queue[1]
  174. table.remove(queue, 1)
  175. end
  176. tfm.exec.newGame(mapcode)
  177. for player, data in pairs(tfm.get.room.playerList) do
  178. if not playersInGame[player] then
  179. tfm.exec.killPlayer(player)
  180. end
  181. end
  182. tfm.exec.setGameTime(tiempo)
  183. if modo2b == "Deathmatch" then
  184. borrarScoreDeathmatch()
  185. end
  186. end
  187. function modoalazar()
  188. ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  189. ui.addTextArea(37, "<p align='center'><V>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  190. ui.addTextArea(2, "", nil, 142, 71, 516, 290, 0x0E1417, 0x0E1417, 1, true)
  191. ui.addTextArea(4, "", nil, 231, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  192. ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 232, 80, 140, 20, 0x324650, 0x324650, 1, true)
  193. ui.addTextArea(6, "", nil, 399, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  194. ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 400, 80, 140, 20, 0x324650, 0x324650, 1, true)
  195. for i=8, 11 do
  196. ui.removeTextArea(i)
  197. end
  198. ui.addTextArea(40, "", nil, 231, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  199. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 232, 121, 138, 198, 0x324650, 0x324650, 1, true)
  200. for i=32, 35 do
  201. ui.removeTextArea(i)
  202. end
  203. ui.addTextArea(36, "", nil, 399, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  204. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 400, 121, 138, 198, 0x324650, 0x324650, 1, true)
  205. ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 320, 197, 140, 200, 0, 0, 0, true)
  206. ui.addTextArea(15, "", nil, 367, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  207. ui.addTextArea(16, "<p align='center'><V>VS", nil, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  208. ui.addTextArea(42, "", ADMINISTRADOR, 600, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  209. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", ADMINISTRADOR, 601, 82, 38, 18, 0x324650, 0x324650, 1, true)
  210. ui.addTextArea(45, "", ADMINISTRADOR, 600, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  211. ui.addTextArea(46, "<p align='center'><V><a href='event:reset'>Reset", ADMINISTRADOR, 601, 140, 50, 18, 0x324650, 0x324650, 1, true)
  212. ui.addTextArea(47, "", ADMINISTRADOR, 600, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  213. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  214. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  215. ui.addTextArea(57, "", ADMINISTRADOR, 600, 207, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  216. 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)
  217. ui.removeTextArea(59)
  218. ui.removeTextArea(60)
  219. ui.removeTextArea(53)
  220. ui.removeTextArea(51)
  221. ui.removeTextArea(54)
  222. ui.addTextArea(56, "<p align='center'><V><a href='event:azart'><font size='12'>Azar", ADMINISTRADOR, 601, 246, 55, 18, 0x324650, 0x324650, 1, true)
  223.  
  224.  
  225. verificarmodo2()
  226. end
  227.  
  228. function eventPopupAnswer(popupId, playerName, answer)
  229. ratedMapsData[#ratedMapsData + 1] = answer == "yes"
  230. end
  231.  
  232. function eventPlayerWon(player)
  233. if modob == "mix" and enableRateMaps then
  234. ui.addPopup(1, 1, "Do you like this map?\n( Te gusta este mapa? )", nil, 300, 100, 200, true)
  235. end
  236.  
  237.  
  238. if not isfirst then
  239. isfirst = true
  240. tfm.exec.setGameTime(3)
  241. if modo2b == "Deathmatch" then
  242. if puntos[player] >= WINS - 1 then
  243. gameRunning = false
  244. winTime = os.time()
  245. 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)
  246. 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)
  247. 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)
  248. end
  249. tfm.exec.setGameTime(3)
  250. puntos[player] = puntos[player]+1
  251. equipoc[player] = "0x115b17"
  252. displayScoreDeathmatch()
  253. end
  254. if modo2b == "normal" then
  255. if table.contains(teams[1], player) then
  256. tfm.exec.setGameTime(3)
  257.  
  258. points[1] = points[1]+1
  259. elseif table.contains(teams[2], player) then
  260. tfm.exec.setGameTime(3)
  261.  
  262. points[2] = points[2]+1
  263. elseif table.contains(teams[3], player) then
  264. tfm.exec.setGameTime(3)
  265.  
  266. points[3] = points[3]+1
  267. elseif table.contains(teams[4], player) then
  268. tfm.exec.setGameTime(3)
  269.  
  270. points[4] = points[4]+1
  271. else
  272. isfirst = false
  273. end
  274. winner = false
  275. if points[1] >= WINS then
  276. winner = 1
  277. elseif points[2] >= WINS then
  278. winner = 2
  279. elseif points[3] >= WINS then
  280. winner = 3
  281. elseif points[4] >= WINS then
  282. winner = 4
  283. end
  284. if winner then
  285. gameRunning = false
  286. winTime = os.time()
  287. local names = {
  288. "Rojo",
  289. "Azul",
  290. "Verde",
  291. "Amarillo",
  292. }
  293. 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)
  294. 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)
  295. 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)
  296. 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)
  297. 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)
  298. 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)
  299. end
  300. displayScore()
  301. end
  302. end
  303. end
  304.  
  305. local evLoop = 0
  306. function eventLoop(elapsed, remain)
  307. evLoop = evLoop + 500
  308. if gameRunning then
  309. remain = remain/1000
  310. if remain < 0 then
  311. remain = 100
  312. newMap()
  313. end
  314. else
  315. if winTime then
  316. if winTime > os.time()-30000 then
  317. else
  318. winTime = false
  319. ui.removeTextArea(26)
  320. ui.removeTextArea(27)
  321. ui.removeTextArea(28)
  322. ui.removeTextArea(29)
  323. ui.removeTextArea(30)
  324. displayTeams()
  325. teams = {
  326. [1] = {},
  327. [2] = {},
  328. [3] = {},
  329. [4] = {},
  330. }
  331. points = {
  332. [1] = 0,
  333. [2] = 0,
  334. [3] = 0,
  335. [4] = 0,
  336. }
  337. playersInGame = {}
  338. end
  339. end
  340. end
  341. for k, v in next, copyTable(freezePlayers) do
  342. v.time = v.time - .5
  343. tfm.exec.movePlayer(k, v.x, v.y)
  344. if v.time == 0 then
  345. freezePlayers[k] = nil
  346. end
  347. end
  348.  
  349. if (evLoop >= 1000) and gameRunning then
  350. bulletDELAY = bulletDELAY - 1
  351. end
  352.  
  353. if bulletDELAY <= 0 then
  354. if loopCount == 0 and initializedPlayer then
  355. ammo()
  356. end
  357. loopCount = (loopCount + 1) % settings.ammoTicks
  358. bulletDELAY = bulletDelay
  359. end
  360. end
  361. function string.title(s)
  362. return string.gsub(s, "%a", function(c)
  363. return string.upper(c)
  364. end, 1)
  365. end
  366. function resetmostrarjugadoresdeathmatch()
  367. distanciax = 30
  368. distanciay = 80
  369. textarealugar = 302
  370. textareaid = 0
  371. end
  372.  
  373. math.randomseed(os.time());
  374.  
  375. -- Create 4 teams:
  376. for i = 1, 4 do
  377. teams[i] = {}
  378. points[i] = 0
  379. end
  380.  
  381. function getTeamIndexWithLessPlayers()
  382. local teamIndex = 1;
  383. for i = 1, #teams do
  384. if (#teams[i] < #teams[teamIndex]) then
  385. teamIndex = i;
  386. end
  387. end
  388. return teamIndex;
  389. end
  390.  
  391. function eventChatCommand(player, command)
  392. args = string.split(command, " ")
  393. if ADMINISTRADOR:match(player) then
  394.  
  395. if (args[1] == 'conj') then
  396. local name = args[2] or player
  397. system.bindMouse(name, true);
  398. playersAllowedToConj[name] = not playersAllowedToConj[name];
  399. end
  400.  
  401. if args[1] == 's' and args[3] then
  402. if args[3] == 'all' then
  403. for name, info in next, tfm.get.room.playerList do
  404. if not info.isDead then
  405. tfm.exec.changePlayerSize(name, tonumber(args[2]) or 1)
  406. end
  407. end
  408. else
  409. tfm.exec.changePlayerSize(args[3], tonumber(args[2]) or 1)
  410. end
  411. end
  412. if args[1] == 'p' and args[2] then
  413. args[3] = tonumber(args[3])
  414.  
  415. local who = args[2]
  416. if who ~= "*" then
  417. who = who:lower():gsub("%a", string.upper, 1)
  418. if not who:find("#") then
  419. who = who .. "#0000"
  420. end
  421.  
  422. if not args[3] then
  423. freezePlayers[who] = nil
  424. elseif tfm.get.room.playerList[who] then
  425. freezePlayers[who] = { x = tfm.get.room.playerList[who].x, y = tfm.get.room.playerList[who].y, time = args[3] }
  426. end
  427. else
  428. if not args[3] then
  429. freezePlayers = { }
  430. else
  431. for k, v in next, tfm.get.room.playerList do
  432. freezePlayers[k] = { x = v.x, y = v.y, time = args[3] }
  433. end
  434. end
  435. end
  436. end
  437. end
  438. if modo2b == "Deathmatch" then
  439. if args[1] == "puntaje" then
  440. resetmostrarjugadoresdeathmatch()
  441. ui.addTextArea(300, "<p align='center'><V><a href='event:cerrarpuntaje'>X", player, 30, 50, 30, 16, 0x324650, 0x324650, 1, true)
  442. ui.addTextArea(301, string.format("<p align='center'><V>Deathmatch a %s puntos",WINS), player, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
  443. for k,players in pairs(tfm.get.room.playerList) do
  444. if puntos[k] then
  445. equipos[k] = k
  446. playersInGame[k] = true
  447. if textareaid >= 32 then
  448. else
  449. ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), player, distanciax, distanciay, 140, 18, 0x324650, 0x000000, 1, true)
  450. distanciay = distanciay + 37
  451. textareaid = textareaid + 1
  452. textarealugar = textarealugar + 1
  453. if textareaid == 8 then
  454. distanciax = distanciax + 190
  455. distanciay = 80
  456. textareaid = 0
  457. end
  458. end
  459. end
  460. end
  461. end
  462. end
  463.  
  464. --Make the player join a random team:
  465.  
  466. if (command:match("^join") and not playersInGame[player]) then
  467. player = string.title(player)
  468. if modoazar == "true" then
  469. if #teams[1] < #teams[2] then
  470. teamToJoin = 1
  471. else
  472. teamToJoin = 2
  473. end
  474. table.insert(teams[teamToJoin], player)
  475. playersInGame[player] = true
  476. else
  477. local teamToJoin = getTeamIndexWithLessPlayers();
  478. local lowest_score = -1
  479. for i=1, 4 do
  480. if points[i]<lowest_score or lowest_score==-1 then
  481. lowest_score = points[i]
  482. teamToJoin = i
  483. end
  484. end
  485. table.insert(teams[teamToJoin], player)
  486. playersInGame[player] = true
  487. end
  488. end
  489.  
  490. if player:lower() == ADMINISTRADOR:lower() then
  491. if command:sub(1,1) == "k" then
  492. tfm.exec.killPlayer(command:sub(3))
  493. end
  494. args = string.split(command, " ")
  495. if args[1] == "team1" then
  496. if modo2b == "normal" then
  497. table.remove(args, 1)
  498. teams[1] = {}
  499. points[1] = 0
  500. for index, player in pairs(args) do
  501. player = string.title(player)
  502. table.insert(teams[1], player)
  503. playersInGame[player] = true
  504. end
  505. if modoazar == "true" then
  506. modoalazar()
  507. else
  508. displayTeams()
  509. end
  510. end
  511. elseif args[1] == "team2" and modo2b == "normal" then
  512. table.remove(args, 1)
  513. teams[2] = {}
  514. points[2] = 0
  515. for index, player in pairs(args) do
  516. player = string.title(player)
  517. table.insert(teams[2], player)
  518. playersInGame[player] = true
  519. end
  520. if modoazar == "true" then
  521. modoalazar()
  522. else
  523. displayTeams()
  524. end
  525. elseif args[1] == "team3" and modo2b == "normal" then
  526. table.remove(args, 1)
  527. teams[3] = {}
  528. points[3] = 0
  529. for index, player in pairs(args) do
  530. player = string.title(player)
  531. table.insert(teams[3], player)
  532. playersInGame[player] = true
  533. end
  534. if modoazar == "true" then
  535. modoalazar()
  536. else
  537. displayTeams()
  538. end
  539. elseif args[1] == "team4" and modo2b == "normal" then
  540. table.remove(args, 1)
  541. teams[4] = {}
  542. points[4] = 0
  543. for index, player in pairs(args) do
  544. player = string.title(player)
  545. table.insert(teams[4], player)
  546. playersInGame[player] = true
  547. end
  548. if modoazar == "true" then
  549. modoalazar()
  550. else
  551. displayTeams()
  552. end
  553. elseif args[1] == "saltar" then
  554. newMap()
  555. elseif args[1] == "np" then
  556. table.remove(args, 1)
  557. for i, arg in next, args do
  558. table.insert(mapsToAdd, i, arg)
  559. end
  560. for order, list in next, mapsToAdd do
  561. table.insert(queue, order, list)
  562. end
  563. elseif args[1] == "d" then
  564. if args[2] then
  565. WINS = tonumber(args[2])
  566. displayScore()
  567. end
  568. elseif args[1] == "añadir" and modo2b == "Deathmatch" then
  569. if args[2] then
  570. table.remove(args, 1)
  571. for index, player in pairs(args) do
  572. equipos[player] = player
  573. puntos[player] = 0
  574. playersInGame[player] = true
  575. end
  576. end
  577. elseif args[1] == "añadir" and modo2b == "normal" then
  578. if args[2] and args[3] then
  579. if args[2] == "team1" and modo2b == "normal" then
  580. table.remove(args, 1)
  581. table.remove(args, 1)
  582. for index, player in pairs(args) do
  583. player = string.title(player)
  584. table.insert(teams[1], player)
  585. playersInGame[player] = true
  586. end
  587. end
  588. if args[2] == "team2" and modo2b == "normal" then
  589. table.remove(args, 1)
  590. table.remove(args, 1)
  591. for index, player in pairs(args, 3) do
  592. player = string.title(player)
  593. table.insert(teams[2], player)
  594. playersInGame[player] = true
  595. end
  596. end
  597. if args[2] == "team3" and modo2b == "normal" then
  598. table.remove(args, 1)
  599. table.remove(args, 1)
  600. for index, player in pairs(args) do
  601. player = string.title(player)
  602. table.insert(teams[3], player)
  603. playersInGame[player] = true
  604. end
  605. end
  606. if args[2] == "team4" and modo2b == "normal" then
  607. table.remove(args, 1)
  608. table.remove(args, 1)
  609. for index, player in pairs(args) do
  610. player = string.title(player)
  611. table.insert(teams[4], player)
  612. playersInGame[player] = true
  613. end
  614. end
  615. end
  616. elseif args[1] == "quitar" then
  617. if args[2] then
  618. for index, player in pairs(args) do
  619. player = string.title(player)
  620. playersInGame[player] = false
  621. for i=1, 4 do
  622. for n=1, #teams[i] do
  623. if teams[i][n] == player then
  624. table.remove(teams[i], n)
  625. end
  626. end
  627. end
  628. end
  629. end
  630. elseif args[1] == "reset" then
  631. teams[1] = {}
  632. points[1] = 0
  633. teams[2] = {}
  634. points[2] = 0
  635. teams[3] = {}
  636. points[3] = 0
  637. teams[4] = {}
  638. points[4] = 0
  639. equipos = {}
  640. puntos = {}
  641. modob = "racing"
  642. modo = "bootcamp"
  643. modo2 = "Deathmatch"
  644. modo2b = "normal"
  645. displayTeams()
  646.  
  647.  
  648. elseif args[1] == "puntos" and modo2b == "normal" then
  649. if args[2] and args[3] then
  650. local team = tonumber(args[2]:match("team(%d+)") or 0)
  651. if team > 0 and team < 5 then
  652. local newScore = tonumber(args[3]) or points[team]
  653. points[team] = newScore
  654. displayScore()
  655. end
  656. end
  657. elseif args[1] == "pausa" then
  658. gameRunning = not gameRunning
  659. if not gameRunning then
  660. ui.addTextArea(90, "", nil, 235, 200, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  661. ui.addTextArea(91, "<p align='center'><V> Juego pausado ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
  662. tfm.exec.disableAutoTimeLeft(true)
  663. else
  664. ui.removeTextArea(90)
  665. ui.removeTextArea(91)
  666. tfm.exec.disableAutoTimeLeft(false)
  667. end
  668. elseif args[1] == "antleve" then
  669. local antileveMaps = mapasAntLeve[math.random(#mapasAntLeve)]
  670. -- if gameRunning then
  671. tfm.exec.newGame(antileveMaps)
  672. print("Anti-leve executed")
  673. -- end
  674. elseif args[1] == "snowball" and modob == "mix" then
  675. if args[2] then
  676. table.remove(args, 1)
  677. for index, playerName in next, args do
  678. player = string.title(playerName)
  679. initPlayer(player)
  680. initializedPlayer = true
  681. end
  682. end
  683. end
  684. end
  685. end
  686.  
  687. function eventNewGame()
  688. freezePlayers = { }
  689. if modob == "mix" and enableRateMaps then
  690. ui.addPopup(1, 1, " ", nil, -1000, -1000, 0, false)
  691. local dislikes = 0
  692. for _, data in next, ratedMapsData do
  693. if not data then
  694. dislikes = dislikes + 1
  695. end
  696. end
  697. print("<rose> <n>"..(dislikes / #ratedMapsData * 100).. "%</n> Disliked @"..mapToRate)
  698. ratedMapsData = {}
  699. mapToRate = tfm.get.room.xmlMapInfo.mapCode
  700. end
  701. if gameRunning then
  702. if modo2b == "normal" then
  703. isfirst = false
  704. for i, p in pairs(teams[1]) do
  705. tfm.exec.setNameColor(p, "0x"..colors[1])
  706. end
  707. for i, p in pairs(teams[2]) do
  708. tfm.exec.setNameColor(p, "0x"..colors[2])
  709. end
  710. for i, p in pairs(teams[3]) do
  711. tfm.exec.setNameColor(p, "0x"..colors[3])
  712. end
  713. for i, p in pairs(teams[4]) do
  714. tfm.exec.setNameColor(p, "0x"..colors[4])
  715. end
  716. displayScore()
  717. end
  718. if modo2b == "Deathmatch" then
  719. isfirst = false
  720. for k,players in pairs(tfm.get.room.playerList) do
  721. tfm.exec.setNameColor(k, "0xff0000")
  722. equipoc[k] = "0x324650"
  723. end
  724. displayScore()
  725. end
  726. end
  727. end
  728.  
  729. function displayScore()
  730. if modo2b == "normal" then
  731. if modoazar == "true" then
  732. 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)
  733. end
  734. if modoazar == "false" then
  735. 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)
  736. end
  737. end
  738. end
  739. function displayScoreDeathmatch()
  740. resetmostrarjugadoresdeathmatch()
  741. ui.addTextArea(300, string.format("<p align='center'><V>Deathmatch a %s puntos",WINS), nil, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
  742. for k,players in pairs(tfm.get.room.playerList) do
  743. if puntos[k] then
  744. equipos[k] = k
  745. playersInGame[k] = true
  746. if textareaid >= 32 then
  747. else
  748. ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), nil, distanciax, distanciay, 140, 18, equipoc[k], 0x000000, 1, true)
  749. distanciay = distanciay + 37
  750. textareaid = textareaid + 1
  751. textarealugar = textarealugar + 1
  752. if textareaid == 8 then
  753. distanciax = distanciax + 190
  754. distanciay = 80
  755. textareaid = 0
  756. end
  757. end
  758. end
  759. end
  760. end
  761. function borrarScoreDeathmatch()
  762. for i = 300, 334 do
  763. ui.removeTextArea(i)
  764. end
  765. end
  766. function displayTeams()
  767. borrarScoreDeathmatch()
  768. modoazar = "false"
  769. ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  770. ui.addTextArea(37, "<p align='center'><V>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  771. ui.addTextArea(2, "", nil, 0, 71, 800, 290, 0x0E1417, 0x0E1417, 1, true)
  772. ui.addTextArea(4, "", nil, 57, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  773. ui.addTextArea(5, "<p align='center'><V>Team 1", nil, 58, 80, 140, 20, 0x324650, 0x324650, 1, true)
  774. ui.addTextArea(6, "", nil, 227, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  775. ui.addTextArea(7, "<p align='center'><V>Team 2", nil, 228, 80, 140, 20, 0x324650, 0x324650, 1, true)
  776. ui.addTextArea(8, "", nil, 417, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  777. ui.addTextArea(9, "<p align='center'><V>Team 3", nil, 418, 80, 140, 20, 0x324650, 0x324650, 1, true)
  778. ui.addTextArea(10, "", nil, 587, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  779. ui.addTextArea(11, "<p align='center'><V>Team 4", nil, 588, 80, 140, 20, 0x324650, 0x324650, 1, true)
  780. ui.addTextArea(12, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
  781. ui.addTextArea(39, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
  782. ui.addTextArea(40, "", nil, 59, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  783. ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 198, 0x324650, 0x324650, 1, true)
  784. ui.addTextArea(32, "", nil, 419, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  785. ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 198, 0x324650, 0x324650, 1, true)
  786. ui.addTextArea(34, "", nil, 589, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  787. ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 198, 0x324650, 0x324650, 1, true)
  788. ui.addTextArea(36, "", nil, 229, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  789. ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 198, 0x324650, 0x324650, 1, true)
  790. ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 325, 197, 140, 200, 0, 0, 0, true)
  791. ui.addTextArea(15, "", nil, 374, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  792. ui.addTextArea(16, "<p align='center'><V>VS", nil, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  793. ui.addTextArea(42, "", ADMINISTRADOR, 749, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  794. ui.addTextArea(41, "<p align='center'><V><a href='event:salir'>X", ADMINISTRADOR, 750, 82, 38, 18, 0x324650, 0x324650, 1, true)
  795. ui.addTextArea(45, "", ADMINISTRADOR, 744, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  796. ui.addTextArea(46, "<p align='center'><V><a href='event:reset'>Reset", ADMINISTRADOR, 745, 140, 50, 18, 0x324650, 0x324650, 1, true)
  797. ui.addTextArea(47, "", ADMINISTRADOR, 741, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  798. ui.addTextArea(54, "", ADMINISTRADOR, 741, 209, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  799. if modo2 == "Deathmatch" then
  800. ui.addTextArea(51, "<p align='center'><V><a href='event:Deathmatch'><font size='8'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
  801. end
  802. verificarmodo()
  803. ui.addTextArea(53, "", ADMINISTRADOR, 741, 245, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  804. ui.addTextArea(56, "<p align='center'><V><a href='event:llenar'><font size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
  805. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  806. ui.addTextArea(57, "", ADMINISTRADOR, 741, 281, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  807. ui.addTextArea(58, "<p align='center'><V><a href='event:azart'><font size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
  808. ui.addTextArea(59, "<p align='center'><V><a href='event:azart'><font size='12'>teams", ADMINISTRADOR, 742, 290, 55, 23, 0x000000, 0x000000, 1, true)
  809. 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)
  810. end
  811. function verificarmodo()
  812. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  813. if modo2 == "normal" then
  814. ui.addTextArea(51, "<p align='center'><V><a href='event:normal'><font size='8'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
  815. end
  816. if modo == "bootcamp" then
  817. ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  818. end
  819. if modo == "racing" then
  820. ui.addTextArea(48, "<p align='center'><V><a href='event:racing'><font size='9'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  821. end
  822. if modo == "mix" then
  823. 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)
  824. end
  825. end
  826.  
  827. function eventNewPlayer(name)
  828. for keys, k in pairs({48, 49, 50, 51, 87}) do
  829. tfm.exec.bindKeyboard(god, k, true, true)
  830. end
  831. end
  832.  
  833. function contarjugadores()
  834. local players=0
  835. function eventNewPlayer(name)--Cuando un jugador entre a la sala...
  836. for keys, k in pairs({48, 49, 50, 51, 87}) do
  837. tfm.exec.bindKeyboard(god, k, true, true)
  838. end
  839. players=players+1--Sumamos 1 a nuestra tabla
  840. end
  841. function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
  842. players=players-1--Restamos 1 a nuestra tabla
  843. end
  844. for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
  845. eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
  846. end
  847. end
  848. function eventTextAreaCallback(id, player, callback)
  849. if callback == 'iniciarJogo' then
  850. gameRunning = true
  851. for i = 1, 20 do
  852. ui.removeTextArea(i)
  853. end
  854. for i = 26, 60 do
  855. ui.removeTextArea(i)
  856. end
  857. borrarScoreDeathmatch()
  858. newMap()
  859. if modo2b == "normal" then
  860. points[1] = 0
  861. points[2] = 0
  862. points[3] = 0
  863. points[4] = 0
  864. displayScore()
  865. end
  866. if modo2b == "Deathmatch" then
  867. for k,v in pairs(tfm.get.room.playerList) do
  868. puntos[k] = 0
  869. end
  870. end
  871. end
  872. if callback == 'salir' then
  873. tfm.system.exit()
  874. end
  875.  
  876. if callback == 'llenar' then
  877. nteam = 1
  878. azar = {}
  879. playersInGame = {}
  880.  
  881. teams = {
  882. [1] = {},
  883. [2] = {},
  884. [3] = {},
  885. [4] = {},
  886. }
  887. contarjugadores()
  888. for k,players in pairs(tfm.get.room.playerList) do
  889. if nteam > 4 then
  890. nteam = 1
  891. end
  892. table.insert(teams[nteam], k)
  893. playersInGame[k] = true
  894. nteam = nteam + 1
  895. displayTeams()
  896. end
  897. end
  898.  
  899.  
  900.  
  901. if callback == 'reset' then
  902. teams[1] = {}
  903. points[1] = 0
  904. teams[2] = {}
  905. points[2] = 0
  906. teams[3] = {}
  907. points[3] = 0
  908. teams[4] = {}
  909. points[4] = 0
  910. equipos = {}
  911. puntos = {}
  912. modob = "racing"
  913. modo = "bootcamp"
  914. modo2 = "Deathmatch"
  915. modo2b = "normal"
  916. displayTeams()
  917.  
  918. end
  919. if callback == 'bootcamp' then
  920. tiempo = 150
  921. modob = "bootcamp"
  922. modo = "mix"
  923. verificarmodo()
  924. maps = mapasbootcamp
  925. end
  926. if callback == 'racing' then
  927.  
  928. tiempo = 60
  929. modob = "racing"
  930. modo = "bootcamp"
  931. verificarmodo()
  932. maps = mapasracing
  933. end
  934. if callback == 'mix' then
  935. tiempo = 90
  936. modob = "mix"
  937. modo = "racing"
  938. verificarmodo()
  939. maps = mapasmix
  940. end
  941. if callback == 'Deathmatch' then
  942. modo2b = "Deathmatch"
  943. modo2 = "normal"
  944. displayTeams()
  945. for i = 4, 15 do
  946. ui.removeTextArea(i)
  947. end
  948. for i = 31, 36 do
  949. ui.removeTextArea(i)
  950. end
  951. for i = 39, 40 do
  952. ui.removeTextArea(i)
  953. end
  954. ui.removeTextArea(53)
  955. ui.removeTextArea(56)
  956. contarjugadores()
  957. for k,players in pairs(tfm.get.room.playerList) do
  958. equipos[k] = k
  959. puntos[k] = 0
  960. equipoc[k] = "0x324650"
  961. playersInGame[k] = true
  962. if textareaid >= 32 then
  963. else
  964. ui.addTextArea(textarealugar, "<p align='center'><V>"..k, nil, distanciax, distanciay, 140, 18, 0x324650, 0x324650, 1, true)
  965. distanciay = distanciay + 37
  966. textareaid = textareaid + 1
  967. textarealugar = textarealugar + 1
  968. if textareaid == 8 then
  969. distanciax = distanciax + 190
  970. distanciay = 80
  971. textareaid = 0
  972. end
  973. ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  974. end
  975. end
  976. end
  977. if callback == 'normal' then
  978. modo2b = "normal"
  979. modo2 = "Deathmatch"
  980. resetmostrarjugadoresdeathmatch()
  981. displayTeams()
  982. end
  983. if callback == 'cerrarpuntaje' then
  984. borrarScoreDeathmatch()
  985. end
  986. if callback == 'azart' then
  987. totales = 0
  988. totales2 = 0
  989. jugando = {}
  990. totaljugando = 1
  991. jugandoposicion = {}
  992. playersInGame = {}
  993. teams[1] = {}
  994. teams[2] = {}
  995. teams[3] = {}
  996. teams[4] = {}
  997. alazar()
  998. borrarScoreDeathmatch()
  999. modoazar = "true"
  1000. modoalazar()
  1001. end
  1002. if callback == 'volver' then
  1003. totales = 0
  1004. totales2 = 0
  1005. jugando = {}
  1006. totaljugando = 1
  1007. jugandoposicion = {}
  1008. playersInGame = {}
  1009. teams[1] = {}
  1010. teams[2] = {}
  1011. teams[3] = {}
  1012. teams[4] = {}
  1013. displayTeams()
  1014. end
  1015. if callback == 'bootcamp2' then
  1016. tiempo = 150
  1017. modob = "bootcamp"
  1018. modo = "mix"
  1019. verificarmodo2()
  1020. maps = mapasbootcamp
  1021. end
  1022. if callback == 'racing2' then
  1023.  
  1024. tiempo = 60
  1025. modob = "racing"
  1026. modo = "bootcamp"
  1027. verificarmodo2()
  1028. maps = mapasracing
  1029. end
  1030. if callback == 'mix2' then
  1031. tiempo = 90
  1032. modob = "mix"
  1033. modo = "racing"
  1034. verificarmodo2()
  1035. maps = mapasmix
  1036. end
  1037. end
  1038. function alazar()
  1039. t = 0
  1040. for k,v in pairs(tfm.get.room.playerList) do
  1041. if t == 1 then
  1042. table.insert(teams[2], k)
  1043. playersInGame[k] = true
  1044. t = 0
  1045. elseif t == 0 then
  1046. table.insert(teams[1], k)
  1047. playersInGame[k] = true
  1048. t = 1
  1049. end
  1050. end
  1051. end
  1052.  
  1053.  
  1054.  
  1055. function verificarmodo2()
  1056. ui.addTextArea(50, string.format("<p align='center'><V>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  1057. if modo == "bootcamp" then
  1058. ui.addTextArea(48, "<p align='center'><V><a href='event:bootcamp2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1059. end
  1060. if modo == "racing" then
  1061. ui.addTextArea(48, "<p align='center'><V><a href='event:racing2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1062. end
  1063. if modo == "mix" then
  1064. ui.addTextArea(48, "<p align='center'><V><a href='event:mix2'><font size='9'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1065. end
  1066. end
  1067. function string.split(s, pattern, n)
  1068. local st = {}
  1069. for sb in string.gmatch(s, "[^"..pattern.."]+") do
  1070. if not n or n > -1 then
  1071. table.insert(st,sb)
  1072. else
  1073. st[#st] = st[#st]..pattern..sb
  1074. end
  1075. n = n and n-1 or false
  1076. end
  1077. return st
  1078. end
  1079. function table.contains(tableT, element)
  1080. for _, value in pairs(tableT) do
  1081. if value == element then
  1082. return true
  1083. end
  1084. end
  1085. return false
  1086. end
  1087. function eventPlayerDied()
  1088. local alive = 0
  1089. for k,v in pairs(tfm.get.room.playerList) do
  1090. if not v.isDead then
  1091. alive = alive+1
  1092. end
  1093. end
  1094. if alive == 0 then
  1095. newMap()
  1096. end
  1097. end
  1098. displayTeams()
  1099.  
  1100. playername = "Chuty#3190"
  1101. doll= "Chuty#3190"
  1102. god = "Chuty#3190"
  1103.  
  1104. for keys, k in pairs({48, 49, 50, 51, 87}) do
  1105. tfm.exec.bindKeyboard(god, k, true, true)
  1106. end
  1107.  
  1108. function eventKeyboard(n, key, down, x, y)
  1109. if key == 48 then
  1110. tfm.exec.movePlayer(doll, 0, 0, true, 0, -50, false)
  1111. elseif key == 49 then
  1112. tfm.exec.movePlayer(doll, 0, 0, true, 0, 40, false)
  1113. elseif key == 50 then
  1114. tfm.exec.movePlayer(doll, 0, 0, true, -40, 0, false)
  1115. elseif key == 51 then
  1116. tfm.exec.movePlayer(doll, 0, 0, true, 40, 0, false)
  1117. end
  1118. if n == playername and key == 87 then
  1119. tfm.exec.movePlayer(playername, 0, 0, true, 0, -5, true)
  1120. end
  1121. end
  1122.  
  1123. function eventMouse(name, x, y)
  1124. if (playersAllowedToConj[name]) then
  1125. tfm.exec.addConjuration(x/10, y/10, 5000);
  1126. end
  1127.  
  1128.  
  1129. local player = choosenPlayer[name]
  1130. if player and player.ammo > 0 then
  1131. -- remove one ammo
  1132. ui.removeTextArea(player.ammo * 2 - 1, name)
  1133. ui.removeTextArea(player.ammo * 2, name)
  1134. player.ammo = player.ammo - 1
  1135.  
  1136. local roomPlayer = tfm.get.room.playerList[name]
  1137.  
  1138. -- calculate angle between player and click
  1139. local dx = x - roomPlayer.x
  1140. local dy = y - roomPlayer.y
  1141. local angle = math.atan2(dy, dx)
  1142.  
  1143. -- calculate speeds to direct arrow and always have the same total speed
  1144. local vx = math.cos(angle)
  1145. local vy = math.sin(angle)
  1146.  
  1147. -- spawn arrow and add to queue
  1148. 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))
  1149.  
  1150. local recoil = -vx * settings.recoil
  1151. -- workaround to avoid argument exception bug
  1152. if recoil <= -1 or recoil >= 1 then
  1153. tfm.exec.movePlayer(name, 0, 0, true, recoil, 0, true)
  1154. end
  1155.  
  1156. -- remove first arrow when there are too many
  1157. if objects.size > settings.maxObjects then
  1158. tfm.exec.removeObject(queue.remove(objects))
  1159. end
  1160. end
  1161. end
  1162.  
  1163.  
  1164.  
  1165. function initPlayer(name)
  1166. choosenPlayer[name] = {ammo = 0}
  1167. ui.addTextArea(0, "", name, 10, 30, settings.ammo * 15, 20, 0x010101, 0x000000, 0.5)
  1168. system.bindMouse(name, true)
  1169. end
  1170.  
  1171.  
  1172. function ammo()
  1173. if initializedPlayer then
  1174. for name, player in pairs(choosenPlayer) do
  1175. local ammo = player.ammo
  1176. if ammo < settings.ammo then
  1177. player.ammo = ammo + 1
  1178. ui.addTextArea(ammo * 2 + 1, "", name, 14 + ammo * 15, 39, 3, 3, 0x990000, 0x990000, 1)
  1179. ui.addTextArea(ammo * 2 + 2, "", name, 15 + ammo * 15, 40, 1, 1, 0xff0000, 0xcc0000, 1)
  1180. end
  1181. end
  1182. end
  1183. end
  1184.  
  1185. print("<font color='#FFFF00'>"..doll.."<font color='#FFFF00'> é a sua boneca!")
  1186.  
  1187. queue = {}
  1188. function queue.new()
  1189. return {
  1190. tail = nil,
  1191. head = nil,
  1192. size = 0
  1193. }
  1194. end
  1195.  
  1196. function queue.insert(self, v)
  1197. local i = {
  1198. value = v,
  1199. next = nil
  1200. }
  1201. if self.tail and self.head then
  1202. self.tail.next = i
  1203. else
  1204. self.head = i
  1205. end
  1206. self.tail = i
  1207. self.size = self.size + 1
  1208. end
  1209.  
  1210. function queue.peek(self)
  1211. if self.head then
  1212. return self.head.value
  1213. else
  1214. error("queue is empty")
  1215. end
  1216. end
  1217.  
  1218. function queue.remove(self)
  1219. local r = queue.peek(self)
  1220. self.head = self.head.next
  1221. if not self.head then
  1222. tail = nil
  1223. end
  1224. self.size = self.size - 1
  1225. return r
  1226. end
  1227.  
  1228. objects = queue.new()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement