KevinK_O

Lua Funcorp

Sep 20th, 2020
753
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. local ADMINISTRADOR = "+Lknx#0000"
  4.  
  5. --[[                                                                
  6. Comandos:
  7. !saltar - Para cambiar de mapa
  8. !puntos  - Para cambiar el puntaje, ej: !puntos team1 5  
  9. !np @codigo - Para poner cualquier mapa
  10. !pausar - Para pausar el juego
  11. !team - Para asignar jugadores a un equipo, ej: !team1 Kmo#7926
  12. !resultado NUMERO - Asigna el puntaje para ganar, ej: !d 20
  13. !añadir team nick - Añade un jugador a el equipo especificado, ej: !añadir team4 Kmo#7926
  14. !reiniciar - Resetea el juego
  15. !quitar NOMBRE - saca a un jugador del juego
  16. !puntaje - para ver el puntaje [SOLO EN MODO DEATHMATCH]
  17. --------------------------------------------------------------------
  18. ]]
  19. -----------------------------------------------------------------------------------
  20. local WINS = 20 -- Puntaje para ganar.
  21. ------------------------------------------------------------------------------------
  22.  
  23.  
  24. ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
  25.  
  26. system.disableChatCommandDisplay("np", true)
  27. system.disableChatCommandDisplay("pausar", true)
  28. system.disableChatCommandDisplay("saltar", true)
  29. system.disableChatCommandDisplay("puntaje", true)
  30. system.disableChatCommandDisplay("team1", true)
  31. system.disableChatCommandDisplay("team2", true)
  32. system.disableChatCommandDisplay("team3", true)
  33. system.disableChatCommandDisplay("team4", true)
  34. system.disableChatCommandDisplay("team5", true)
  35. system.disableChatCommandDisplay("team6", true)
  36. system.disableChatCommandDisplay("team7", true)
  37. system.disableChatCommandDisplay("team8", true)
  38. system.disableChatCommandDisplay("reiniciar", true)
  39. system.disableChatCommandDisplay("resultado", true)
  40. system.disableChatCommandDisplay("añadir", true)
  41. system.disableChatCommandDisplay("quitar", true)
  42. system.disableChatCommandDisplay("puntos", true)
  43.  
  44. system.disableChatCommandDisplay("tamaño", true)
  45. system.disableChatCommandDisplay("tamaño5", true)
  46. system.disableChatCommandDisplay("tamaño4", true)
  47. system.disableChatCommandDisplay("tamaño3", true)
  48. system.disableChatCommandDisplay("tamaño2", true)
  49. system.disableChatCommandDisplay("tamaño1", true)
  50. system.disableChatCommandDisplay("tamaño0.5", true)
  51. system.disableChatCommandDisplay("tamaño0.4", true)
  52. system.disableChatCommandDisplay("tamaño0.3", true)
  53. system.disableChatCommandDisplay("tamaño0.2", true)
  54. system.disableChatCommandDisplay("tamaño0.1", true)
  55.  
  56. system.disableChatCommandDisplay("meep", true)
  57. system.disableChatCommandDisplay("vampiros", true)
  58. system.disableChatCommandDisplay("chamanes", true)
  59.  
  60. tfm.exec.disablePhysicalConsumables()
  61. tfm.exec.disableAutoShaman()
  62. tfm.exec.disableAutoNewGame()
  63. tfm.exec.disableAutoTimeLeft()
  64. local teams = {
  65.     [1] = {},
  66.     [2] = {},
  67.     [3] = {},
  68.     [4] = {},
  69.     [5] = {},
  70.     [6] = {},
  71.     [7] = {},
  72.     [8] = {},
  73. }
  74. local points = {
  75.     [1] = 0,
  76.     [2] = 0,
  77.     [3] = 0,
  78.     [4] = 0,
  79.     [5] = 0,
  80.     [6] = 0,
  81.     [7] = 0,
  82.     [8] = 0,
  83. }
  84. local equipos = {}
  85. local puntos = {}
  86. local maxPlayers = 200
  87. local modob = "racing"
  88. local modo = "bootcamp"
  89. local modo2 = "Deathmatch"
  90. local modo2b = "normal""FF0000",
  91.     [2] = "003AFF",
  92.     [3] = "00FF04",
  93.     [4] = "FF9E00",
  94.     [5] = "FBFF00",
  95.     [6] = "AE00FF",
  96.     [7] = "FF0097",
  97.     [8] = "060606",
  98. }
  99. local queue = {}
  100. local nteam = 1
  101. local azar = {}
  102. local posicion = {}
  103. local modoazar = ""
  104.  
  105. local numeroposicion = 1
  106. local totales = 0
  107. local totales2 = 0
  108. local jugando = {}
  109. local totaljugando = 1
  110. local jugandoposicion = {}
  111. function newMap()
  112.     local mapcode = maps[math.random(#maps)]
  113.     if #queue > 0 then
  114.         mapcode = queue[1]
  115.         table.remove(queue, 1)
  116.     end
  117.     ui.removeTextArea(100, nil)
  118.     tfm.exec.newGame(mapcode)
  119.     ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
  120.     for player, data in pairs(tfm.get.room.playerList) do
  121.         if not playersInGame[player] then
  122.             tfm.exec.killPlayer(player)
  123.         end
  124.     end
  125.     tfm.exec.setGameTime(tiempo)
  126.     if modo2b == "Deathmatch" then
  127.     borrarScoreDeathmatch()
  128.     end
  129. end
  130.  
  131. ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
  132.  
  133.  
  134. function modoalazar()
  135.     ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  136.     ui.addTextArea(37, "<p align='center'><font face='Century Gothic'><font size='12'>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  137.     ui.addTextArea(2, "", nil, 142, 71, 516, 290, 0x0E1417, 0x0E1417, 1, true)
  138.     ui.addTextArea(4, "", nil, 231, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  139.     ui.addTextArea(5, "<p align='center'><font face='Century Gothic'><font size='11'>Equipo 1", nil, 232, 80, 140, 20, 0x324650, 0x324650, 1, true)
  140.     ui.addTextArea(6, "", nil, 399, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  141.     ui.addTextArea(7, "<p align='center'><font face='Century Gothic'><font size='11'>Equipo 2", nil, 400, 80, 140, 20, 0x324650, 0x324650, 1, true)
  142.     for i=8, 11 do
  143.     ui.removeTextArea(i)
  144.     end
  145.     ui.addTextArea(40, "", nil, 231, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  146.     ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 232, 121, 138, 198, 0x324650, 0x324650, 1, true)
  147.     for i=32, 35 do
  148.     ui.removeTextArea(i)
  149.     end
  150.     ui.addTextArea(36, "", nil, 399, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
  151.     ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 400, 121, 138, 198, 0x324650, 0x324650, 1, true)
  152.     ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____         ____</font>", nil, 320, 197, 140, 200, 0, 0, 0, true)
  153.     ui.addTextArea(15, "", nil, 367, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  154.     ui.addTextArea(16, "<p align='center'><font face='Century Gothic'>VS", nil, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  155.     ui.addTextArea(42, "", ADMINISTRADOR, 600, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  156.     ui.addTextArea(41, "<p align='center'><font face='Century Gothic'><a href='event:salir'>X", ADMINISTRADOR, 601, 82, 38, 18, 0x324650, 0x324650, 1, true)
  157.     ui.addTextArea(45, "", ADMINISTRADOR, 600, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  158.     ui.addTextArea(46, "<p align='center'><font face='Century Gothic'><a href='event:reset'>Reiniciar", ADMINISTRADOR, 601, 140, 50, 18, 0x324650, 0x324650, 1, true)
  159.     ui.addTextArea(47, "", ADMINISTRADOR, 600, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  160.     ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  161.  
  162.  
  163.  
  164.     ui.addTextArea(16, "<p align='center'><font face='Century Gothic'><a href='event:iniciarJogo'>Iniciar", ADMINISTRADOR, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
  165.     ui.addTextArea(57, "", ADMINISTRADOR, 600, 207, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  166.     ui.addTextArea(58, "<p align='center'><font face='Century Gothic'><a href='event:volver'><font size='11'>8 Teams", ADMINISTRADOR, 601, 208, 55, 23, 0x324650, 0x324650, 1, true)
  167.     ui.removeTextArea(59)
  168.     ui.removeTextArea(60)
  169.     ui.removeTextArea(53)
  170.     ui.removeTextArea(51)
  171.     ui.removeTextArea(54)
  172.     ui.addTextArea(56, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>Azar", ADMINISTRADOR, 601, 246, 55, 18, 0x324650, 0x324650, 1, true)
  173.  
  174.    
  175.     verificarmodo2()
  176.     end
  177.  
  178. ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
  179.  
  180.  
  181. function eventPlayerWon(player)
  182.     if not isfirst then
  183.         isfirst = true
  184.         tfm.exec.setGameTime(3)
  185.         if modo2b == "Deathmatch" then
  186.             if puntos[player] >= WINS - 1 then
  187.                 gameRunning = false
  188.                 winTime = os.time()
  189.                 ui.addTextArea(29, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>%s ganó", player), nil, 3, 168, 800, 500, 0, 0, 0, true)
  190.                 ui.addTextArea(30, string.format("<p align='center'><font face='Century Gothic'><font size='37'><font color='#cecece'><font color='#ff0000'>%s </font>ganó", player), nil, 1, 170, 800, 500, 0, 0, 0, true)
  191.                  ui.addTextArea(16, "<p align='center'><font color='#225066' size='18' face='Impact'><a href='event:iniciarJogo'>DE NUEVO", ADMINISTRADOR, 350, 270, 100, 20, 0xFFFFFF, 0xFFFFFF, 1, true)
  192.             end
  193.                 tfm.exec.setGameTime(3)
  194.                 puntos[player] = puntos[player]+1
  195.                 equipoc[player] = "0x115b17"
  196.                 displayScoreDeathmatch()
  197.         end
  198.     if modo2b == "normal" then
  199.         if table.contains(teams[1], player) then
  200.             tfm.exec.setGameTime(3)
  201.             points[1] = points[1]+1
  202.             ui.addTextArea(100, "<p align='center'><font size='20' color='#FF0000'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'><font face='Century Gothic'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  203.         elseif table.contains(teams[2], player) then
  204.             tfm.exec.setGameTime(3)
  205.             points[2] = points[2]+1
  206.             ui.addTextArea(100, "<p align='center'><font size='20' color='#003AFF'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  207.         elseif table.contains(teams[3], player) then
  208.             tfm.exec.setGameTime(3)
  209.             points[3] = points[3]+1
  210.             ui.addTextArea(100, "<p align='center'><font size='20' color='#00FF04'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  211.         elseif table.contains(teams[4], player) then
  212.             tfm.exec.setGameTime(3)
  213.             points[4] = points[4]+1
  214.             ui.addTextArea(100, "<p align='center'><font size='20' color='#FF9E00'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  215.         elseif table.contains(teams[5], player) then
  216.             tfm.exec.setGameTime(3)
  217.             points[5] = points[5]+1
  218.             ui.addTextArea(100, "<p align='center'><font size='20' color='#FBFF00'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  219.         elseif table.contains(teams[6], player) then
  220.             tfm.exec.setGameTime(3)
  221.             points[6] = points[6]+1
  222.             ui.addTextArea(100, "<p align='center'><font size='20' color='#AE00FF'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  223.         elseif table.contains(teams[7], player) then
  224.             tfm.exec.setGameTime(3)
  225.             points[7] = points[7]+1
  226.             ui.addTextArea(100, "<p align='center'><font size='20' color='#FF0097'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  227.         elseif table.contains(teams[8], player) then
  228.             tfm.exec.setGameTime(3)
  229.             points[8] = points[8]+1
  230.             ui.addTextArea(100, "<p align='center'><font size='20' color='#060606'><font face='Century Gothic'>¡" ..player  .." <font color='#ffffff'>se ha llevado el punto!</font>", nil, 6, 70, 790, 100, 0x324650, 0x000000, 0, true)
  231.         else
  232.             isfirst = false
  233.         end
  234.         winner = false
  235.         if points[1] >= WINS then
  236.             winner = 1
  237.         elseif points[2] >= WINS then
  238.             winner = 2
  239.         elseif points[3] >= WINS then
  240.             winner = 3
  241.         elseif points[4] >= WINS then
  242.             winner = 4
  243.         elseif points[5] >= WINS then
  244.             winner = 5
  245.          elseif points[6] >= WINS then
  246.             winner = 6
  247.         elseif points[7] >= WINS then
  248.             winner = 7
  249.         elseif points[8] >= WINS then
  250.             winner = 8
  251.         end
  252.         if winner then
  253.             gameRunning = false
  254.             winTime = os.time()
  255.             local names = {
  256.                 "rojo",
  257.                 "azul",
  258.                 "verde",
  259.                 "naranja",
  260.                 "amarillo",
  261.                 "morado",
  262.                 "rosado",
  263.                 "negro",
  264.             }
  265.             ui.addTextArea(26, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 0, 171, 800, 500, 0, 0, 0, true)
  266.             ui.addTextArea(27, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  267.             ui.addTextArea(28, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 2, 169, 800, 500, 0, 0, 0, true)
  268.             ui.addTextArea(29, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>El equipo %s ganó", names[winner]), nil, 3, 168, 800, 500, 0, 0, 0, true)
  269.             ui.addTextArea(30, string.format("<p align='center'><font face='Century Gothic'><font size='37'><font color='#cecece'>El equipo <font color='#%s'>%s</font> ganó", colors[winner], names[winner]), nil, 1, 170, 800, 500, 0, 0, 0, true)
  270.             ui.addTextArea(16, "<p align='center'><font color='#225066' size='15' face='Century Gothic'><a href='event:iniciarJogo'>REVANCHA", ADMINISTRADOR, 350, 270, 100, 20, 0xFFFFFF, 0xFFFFFF, 1, true)
  271.         end
  272.         displayScore()
  273.         end
  274.     end
  275. end
  276. function eventLoop(elapsed, remain)
  277.     if gameRunning then
  278.         remain = remain/1000
  279.         if remain < 0 then
  280.             remain = 100
  281.             newMap()
  282.         end
  283.  
  284. ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
  285.  
  286.  
  287.     else
  288.         if winTime then
  289.             if winTime > os.time()-30000 then
  290.             else
  291.                 winTime = false
  292.                 ui.removeTextArea(26)
  293.                 ui.removeTextArea(27)
  294.                 ui.removeTextArea(28)
  295.                 ui.removeTextArea(29)
  296.                 ui.removeTextArea(30)
  297.                 displayTeams()
  298.                 teams = {
  299.                     [1] = {},
  300.                     [2] = {},
  301.                     [3] = {},
  302.                     [4] = {},
  303.                     [5] = {},
  304.                     [6] = {},
  305.                     [7] = {},
  306.                     [8] = {},
  307.                 }
  308.                 points = {
  309.                     [1] = {},
  310.                     [2] = {},
  311.                     [3] = {},
  312.                     [4] = {},
  313.                     [5] = {},
  314.                     [6] = {},
  315.                     [7] = {},
  316.                     [8] = {},
  317.                 }
  318.                 playersInGame = {}
  319.             end
  320.         end
  321.     end
  322. end
  323. function string.title(s)
  324.     return string.gsub(s, "%a", function(c)
  325.         return string.upper(c)
  326.     end, 1)
  327. end
  328. function resetmostrarjugadoresdeathmatch()
  329. distanciax = 30
  330. distanciay = 80
  331. textarealugar = 302
  332. textareaid = 0
  333. end
  334. function eventChatCommand(player, command)
  335.     if modo2b == "Deathmatch" then
  336.         args = string.split(command, " ")
  337.         if args[1] == "puntaje" then
  338.             resetmostrarjugadoresdeathmatch()
  339.             ui.addTextArea(300, "<p align='center'><V><a href='event:cerrarpuntaje'>X", player, 30, 50, 30, 16, 0x324650, 0x324650, 1, true)
  340.             ui.addTextArea(301, string.format("<p align='center'><V>Todos a %s puntos",WINS), player, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
  341.             for k,players in pairs(tfm.get.room.playerList) do
  342.                 if puntos[k] then
  343.                     equipos[k] = k
  344.                     playersInGame[k] = true
  345.                     if textareaid >= 32 then
  346.                     else
  347.                         ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), player, distanciax, distanciay, 140, 18, 0x324650, 0x000000, 1, true)
  348.                         distanciay = distanciay + 37
  349.                         textareaid = textareaid + 1
  350.                         textarealugar = textarealugar + 1
  351.                         if textareaid == 8 then
  352.                             distanciax = distanciax + 190
  353.                             distanciay = 80
  354.                             textareaid = 0
  355.                         end
  356.                     end
  357.                 end
  358.             end
  359.         end
  360.     end
  361.     if player:lower() == ADMINISTRADOR:lower() then
  362.         args = string.split(command, " ")
  363.         if args[1] == "team1" then
  364.             if modo2b == "normal" then
  365.                 table.remove(args, 1)
  366.                 teams[1] = {}
  367.                 points[1] = 0
  368.                 for index, player in pairs(args) do
  369.                     player = string.title(player)
  370.                     table.insert(teams[1], player)
  371.                     playersInGame[player] = true
  372.                 end
  373.             if modoazar == "true" then
  374.             modoalazar()
  375.             else
  376.             displayTeams()
  377.             end
  378.             end
  379.         elseif args[1] == "team2" and modo2b == "normal" then
  380.             table.remove(args, 1)
  381.             teams[2] = {}
  382.             points[2] = 0
  383.             for index, player in pairs(args) do
  384.                 player = string.title(player)
  385.                 table.insert(teams[2], player)
  386.                 playersInGame[player] = true
  387.             end
  388.             if modoazar == "true" then
  389.             modoalazar()
  390.             else
  391.             displayTeams()
  392.             end
  393.         elseif args[1] == "team3" and modo2b == "normal" then
  394.             table.remove(args, 1)
  395.             teams[3] = {}
  396.             points[3] = 0
  397.             for index, player in pairs(args) do
  398.                 player = string.title(player)
  399.                 table.insert(teams[3], player)
  400.                 playersInGame[player] = true
  401.             end
  402.             if modoazar == "true" then
  403.             modoalazar()
  404.             else
  405.             displayTeams()
  406.             end
  407.         elseif args[1] == "team4" and modo2b == "normal" then
  408.             table.remove(args, 1)
  409.             teams[4] = {}
  410.             points[4] = 0
  411.             for index, player in pairs(args) do
  412.                 player = string.title(player)
  413.                 table.insert(teams[4], player)
  414.                 playersInGame[player] = true
  415.             end
  416.                         if modoazar == "true" then
  417.             modoalazar()
  418.             else
  419.             displayTeams()
  420.             end
  421.                 elseif args[1] == "team5" and modo2b == "normal" then
  422.             table.remove(args, 1)
  423.             teams[5] = {}
  424.             points[5] = 0
  425.             for index, player in pairs(args) do
  426.                 player = string.title(player)
  427.                 table.insert(teams[5], player)
  428.                 playersInGame[player] = true
  429.             end
  430.                         if modoazar == "true" then
  431.             modoalazar()
  432.             else
  433.             displayTeams()
  434.             end
  435.            
  436.         elseif args[1] == "team6" and modo2b == "normal" then
  437.             table.remove(args, 1)
  438.             teams[6] = {}
  439.             points[6] = 0
  440.             for index, player in pairs(args) do
  441.                 player = string.title(player)
  442.                 table.insert(teams[6], player)
  443.                 playersInGame[player] = true
  444.             end
  445.                         if modoazar == "true" then
  446.             modoalazar()
  447.             else
  448.             displayTeams()
  449.             end
  450.            
  451.                 elseif args[1] == "team7" and modo2b == "normal" then
  452.             table.remove(args, 1)
  453.             teams[7] = {}
  454.             points[7] = 0
  455.             for index, player in pairs(args) do
  456.                 player = string.title(player)
  457.                 table.insert(teams[7], player)
  458.                 playersInGame[player] = true
  459.             end
  460.                         if modoazar == "true" then
  461.             modoalazar()
  462.             else
  463.             displayTeams()
  464.             end
  465.             elseif args[1] == "team8" and modo2b == "normal" then
  466.             table.remove(args, 1)
  467.             teams[8] = {}
  468.             points[8] = 0
  469.             for index, player in pairs(args) do
  470.                 player = string.title(player)
  471.                 table.insert(teams[8], player)
  472.                 playersInGame[player] = true
  473.             end
  474.             if modoazar == "true" then
  475.             modoalazar()
  476.             else
  477.             displayTeams()
  478.             end
  479.  
  480.         elseif args[1] == "meep" then
  481.        for name,player in pairs(tfm.get.room.playerList) do
  482.        tfm.exec.giveMeep(name)
  483.             end
  484.  
  485.         elseif args[1] == "saltar" then
  486.             newMap()
  487.         elseif args[1] == "np" then
  488.             if args[2] then
  489.                 table.insert(queue, args[2])
  490.             end
  491. elseif args[1] == "tamaño" then
  492.     print(args[1],args[2],args[3])
  493.    
  494.      tfm.exec.changePlayerSize(args[2],args[3])
  495.            
  496.         elseif args[1] == "resultado" then
  497.             if args[2] then
  498.                 WINS = tonumber(args[2])
  499.                 displayScore()
  500.             end
  501.         elseif args[1] == "añadir" and modo2b == "Deathmatch" then
  502.             if args[2] then
  503.                 table.remove(args, 1)
  504.                 for index, player in pairs(args) do
  505.                 equipos[player] = player
  506.                 puntos[player] = 0
  507.                 playersInGame[player] = true
  508.                 end
  509.             end
  510.         elseif args[1] == "añadir" and modo2b == "normal" then
  511.             if args[2] and args[3] then
  512.                 if args[2] == "team1" and modo2b == "normal" then
  513.                     table.remove(args, 1)
  514.                     table.remove(args, 1)
  515.                     for index, player in pairs(args) do
  516.                         player = string.title(player)
  517.                         table.insert(teams[1], player)
  518.                         playersInGame[player] = true
  519.                     end
  520.                 end
  521.                 if args[2] == "team2" and modo2b == "normal" then
  522.                     table.remove(args, 1)
  523.                     table.remove(args, 1)
  524.                     for index, player in pairs(args, 3) do
  525.                         player = string.title(player)
  526.                         table.insert(teams[2], player)
  527.                         playersInGame[player] = true
  528.                     end
  529.                 end
  530.                 if args[2] == "team3" and modo2b == "normal" then
  531.                     table.remove(args, 1)
  532.                     table.remove(args, 1)
  533.                     for index, player in pairs(args) do
  534.                         player = string.title(player)
  535.                         table.insert(teams[3], player)
  536.                         playersInGame[player] = true
  537.                     end
  538.                 end
  539.                 if args[2] == "team4" and modo2b == "normal" then
  540.                     table.remove(args, 1)
  541.                     table.remove(args, 1)
  542.                     for index, player in pairs(args) do
  543.                         player = string.title(player)
  544.                         table.insert(teams[4], player)
  545.                         playersInGame[player] = true
  546.                     end
  547.                 end
  548.                 if args[2] == "team5" and modo2b == "normal" then
  549.                     table.remove(args, 1)
  550.                     table.remove(args, 1)
  551.                     for index, player in pairs(args) do
  552.                         player = string.title(player)
  553.                         table.insert(teams[5], player)
  554.                         playersInGame[player] = true
  555.                     end
  556.                 end
  557.                 if args[2] == "team6" and modo2b == "normal" then
  558.                     table.remove(args, 1)
  559.                     table.remove(args, 1)
  560.                     for index, player in pairs(args) do
  561.                         player = string.title(player)
  562.                         table.insert(teams[6], player)
  563.                         playersInGame[player] = true
  564.                     end
  565.                 end
  566.                 if args[2] == "team7" and modo2b == "normal" then
  567.                     table.remove(args, 1)
  568.                     table.remove(args, 1)
  569.                     for index, player in pairs(args) do
  570.                         player = string.title(player)
  571.                         table.insert(teams[7], player)
  572.                         playersInGame[player] = true
  573.                     end
  574.                 end
  575.                 if args[2] == "team8" and modo2b == "normal" then
  576.                     table.remove(args, 1)
  577.                     table.remove(args, 1)
  578.                     for index, player in pairs(args) do
  579.                         player = string.title(player)
  580.                         table.insert(teams[8], player)
  581.                         playersInGame[player] = true
  582.                     end
  583.                 end
  584.             end
  585.         elseif args[1] == "quitar" then
  586.             if args[2] then
  587.                     for index, player in pairs(args) do
  588.                         player = string.title(player)
  589.                         playersInGame[player] = false
  590.                     end
  591.             end
  592.         elseif args[1] == "reiniciar" then
  593.             teams[1] = {}
  594.             points[1] = 0
  595.             teams[2] = {}
  596.             points[2] = 0
  597.             teams[3] = {}
  598.             points[3] = 0
  599.             teams[4] = {}
  600.             points[4] = 0
  601.             teams[5] = {}
  602.             points[5] = 0
  603.             teams[6] = {}
  604.             points[6] = 0
  605.             teams[7] = {}
  606.             points[7] = 0
  607.             teams[8] = {}
  608.             points[8] = 0
  609.             equipos = {}
  610.             puntos = {}
  611.             modob = "racing"
  612.             modo = "bootcamp"
  613.             modo2 = "Deathmatch"
  614.             modo2b = "normal"
  615.             displayTeams()
  616.            
  617.            
  618.         elseif args[1] == "puntos" and modo2b == "normal" then
  619.             if args[2] and args[3] then
  620.                 local team = tonumber(args[2]:match("team(%d+)") or 0)
  621.                 if team > 0 and team < 5 then
  622.                     local newScore = tonumber(args[3]) or points[team]
  623.                     points[team] = newScore
  624.                     displayScore()
  625.                 end
  626.             end
  627.         elseif args[1] == "pausar" then
  628.             gameRunning = not gameRunning
  629.             if not gameRunning then
  630.                 ui.addTextArea(90, "", nil, 235, 200, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  631.                 ui.addTextArea(91, "<p align='center'><font face='Century Gothic'> El juego ha sido pausado  ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
  632.                 tfm.exec.disableAutoTimeLeft(true)
  633.             else
  634.                 ui.removeTextArea(90)
  635.                 ui.removeTextArea(91)
  636.                 tfm.exec.disableAutoTimeLeft(false)
  637.             end
  638.         end
  639.     end
  640. end
  641. function eventNewGame()
  642.     if gameRunning then
  643.         tfm.exec.setUIMapName("")
  644.         if modo2b == "normal" then
  645.             isfirst = false
  646.             for i, p in pairs(teams[1]) do
  647.                 tfm.exec.setNameColor(p, "0x"..colors[1])
  648.             end
  649.             for i, p in pairs(teams[2]) do
  650.                 tfm.exec.setNameColor(p, "0x"..colors[2])
  651.             end
  652.             for i, p in pairs(teams[3]) do
  653.                 tfm.exec.setNameColor(p, "0x"..colors[3])
  654.             end
  655.             for i, p in pairs(teams[4]) do
  656.                 tfm.exec.setNameColor(p, "0x"..colors[4])
  657.             end
  658.             for i, p in pairs(teams[5]) do
  659.                 tfm.exec.setNameColor(p, "0x"..colors[5])
  660.             end
  661.             for i, p in pairs(teams[6]) do
  662.                 tfm.exec.setNameColor(p, "0x"..colors[6])
  663.             end
  664.             for i, p in pairs(teams[7]) do
  665.                 tfm.exec.setNameColor(p, "0x"..colors[7])
  666.             end
  667.             for i, p in pairs(teams[8]) do
  668.                 tfm.exec.setNameColor(p, "0x"..colors[8])
  669.             end
  670.             displayScore()
  671.         end
  672.         if modo2b == "Deathmatch" then
  673.             isfirst = false
  674.             for k,players in pairs(tfm.get.room.playerList) do
  675.                 tfm.exec.setNameColor(k, "0xff0000")
  676.                 equipoc[k] = "0x324650"
  677.             end
  678.             displayScore()
  679.         end
  680.     end
  681. end
  682. function displayScore()
  683.     if modo2b == "normal" then
  684.         if modoazar == "true" then
  685.             ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> - <font color='#%s'>%s <N> (Ganar) <font color='#111111'>%s", colors[1], points[1], colors[2], points[2], WINS), nil, 0, 22, 800, 30, 0, 0, 0, true)
  686.         end
  687.         if modoazar == "false" then
  688.             ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> - <font color='#%s'>%s <N> (Ganar) <font color='#111111'>%s", colors[1], points[1], colors[2], points[2], colors[3], points[3], colors[4], points[4], colors[5], points[5], colors[6], points[6], colors[7], points[7], colors[8], points[8], WINS), nil, 0, 22, 800, 30, 0, 0, 0, true)
  689.         end
  690.     end
  691. end
  692. function displayScoreDeathmatch()
  693. resetmostrarjugadoresdeathmatch()
  694. ui.addTextArea(300, string.format("<p align='center'><font face='Century Gothic'>Competitivo a %s puntos",WINS), nil, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
  695. for k,players in pairs(tfm.get.room.playerList) do
  696.         if puntos[k] then
  697.             equipos[k] = k
  698.             playersInGame[k] = true
  699.                 if textareaid >= 32 then
  700.                 else
  701.                     ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), nil, distanciax, distanciay, 140, 18, equipoc[k], 0x000000, 1, true)
  702.                     distanciay = distanciay + 37
  703.                     textareaid = textareaid + 1
  704.                     textarealugar = textarealugar + 1
  705.                     if textareaid == 8 then
  706.                         distanciax = distanciax + 190
  707.                         distanciay = 80
  708.                         textareaid = 0
  709.                 end
  710.             end
  711.         end
  712.     end
  713. end
  714. function borrarScoreDeathmatch()
  715. for i = 300, 334 do
  716.             ui.removeTextArea(i)
  717.         end
  718. end
  719.  
  720. system.bindMouse("+Lknx#0000", true)
  721. function eventMouse(name, x, y)
  722.     tfm.exec.movePlayer(name,x,y,false,0,0,true)
  723. end
  724. function displayTeams()
  725.     borrarScoreDeathmatch()
  726.     modoazar = "false"
  727.     ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
  728.     ui.addTextArea(37, "<p align='center'><font face='Century Gothic'><font size='12'>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
  729.     ui.addTextArea(2, "", nil, 0, 71, 800, 295, 0x0E1417, 0x0E1417, 1, true)
  730.     ui.addTextArea(4, "", nil, 57, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  731.     ui.addTextArea(5, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 1", nil, 58, 80, 140, 20, 0x324650, 0x324650, 1, true)
  732.     ui.addTextArea(6, "", nil, 227, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  733.     ui.addTextArea(7, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 2", nil, 228, 80, 140, 20, 0x324650, 0x324650, 1, true)
  734.     ui.addTextArea(8, "", nil, 417, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  735.     ui.addTextArea(9, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 3", nil, 418, 80, 140, 20, 0x324650, 0x324650, 1, true)
  736.     ui.addTextArea(10, "", nil, 587, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  737.     ui.addTextArea(11, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 4", nil, 588, 80, 140, 20, 0x324650, 0x324650, 1, true)
  738.     ui.addTextArea(73, "", nil, 57, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  739.     ui.addTextArea(68, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 5", nil, 58, 230, 140, 20, 0x324650, 0x324650, 1, true)
  740.     ui.addTextArea(69, "", nil, 227, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  741.     ui.addTextArea(70, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 6", nil, 228, 230, 140, 20, 0x324650, 0x324650, 1, true)
  742.     ui.addTextArea(71, "", nil, 417, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  743.     ui.addTextArea(72, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 7", nil, 418, 230, 140, 20, 0x324650, 0x324650, 1, true)
  744.     ui.addTextArea(77, "", nil, 587, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
  745.     ui.addTextArea(74, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 8", nil, 588, 230, 140, 20, 0x324650, 0x324650, 1, true)
  746.  
  747. ui.addTextArea(12, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
  748.     ui.addTextArea(39, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
  749.     ui.addTextArea(40, "", nil, 59, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  750.     ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 90, 0x324650, 0x324650, 1, true)
  751.     ui.addTextArea(32, "", nil, 419, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  752.     ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 90, 0x324650, 0x324650, 1, true)
  753.     ui.addTextArea(34, "", nil, 589, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  754.     ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 90, 0x324650, 0x324650, 1, true)
  755.     ui.addTextArea(36, "", nil, 229, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  756.     ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 90, 0x324650, 0x324650, 1, true)
  757.     ui.addTextArea(76, "", nil, 59, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  758.     ui.addTextArea(62, "<p align='center'><font color='#"..colors[5].."'>"..table.concat(teams[5], "\n"), nil, 60, 270, 138, 90, 0x324650, 0x324650, 1, true)
  759.     ui.addTextArea(63, "", nil, 419, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  760.     ui.addTextArea(64, "<p align='center'><font color='#"..colors[7].."'>"..table.concat(teams[7], "\n"), nil, 420, 270, 138, 90, 0x324650, 0x324650, 1, true)
  761.     ui.addTextArea(65, "", nil, 589, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  762.     ui.addTextArea(66, "<p align='center'><font color='#"..colors[8].."'>"..table.concat(teams[8], "\n"), nil, 590, 270, 138, 90, 0x324650, 0x324650, 1, true)
  763.     ui.addTextArea(67, "", nil, 229, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
  764.     ui.addTextArea(75, "<p align='center'><font color='#"..colors[6].."'>"..table.concat(teams[6], "\n"), nil, 230, 270, 138, 90, 0x324650, 0x324650, 1, true)
  765.     ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____         ____</font>", nil, 325, 206, 140, 200, 0, 0, 0, true)
  766.     ui.addTextArea(15, "", nil, 374, 211, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  767.     ui.addTextArea(16, "<p align='center'><font face='Century Gothic'>VS", nil, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
  768.     ui.addTextArea(42, "", ADMINISTRADOR, 749, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  769.     ui.addTextArea(41, "<p align='center'><font face='Century Gothic'><a href='event:salir'>X", ADMINISTRADOR, 750, 82, 38, 18, 0x324650, 0x324650, 1, true)
  770.     ui.addTextArea(45, "", ADMINISTRADOR, 744, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  771.     ui.addTextArea(46, "<p align='center'><font face='Century Gothic'><a href='event:reset'>Reiniciar", ADMINISTRADOR, 745, 140, 50, 18, 0x324650, 0x324650, 1, true)
  772.     ui.addTextArea(47, "", ADMINISTRADOR, 741, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  773.     ui.addTextArea(54, "", ADMINISTRADOR, 741, 209, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  774.     if modo2 == "Deathmatch" then
  775.     ui.addTextArea(51, "<p align='center'><font face='Century Gothic'><a href='event:Deathmatch'><font size='12'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
  776.     end
  777.     verificarmodo()
  778.     ui.addTextArea(53, "", ADMINISTRADOR, 741, 245, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
  779.     ui.addTextArea(56, "<p align='center'><font face='Century Gothic'><a href='event:llenar'><font size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
  780.     ui.addTextArea(16, "<p align='center'><font face='Century Gothic'><a href='event:iniciarJogo'>Inicia", ADMINISTRADOR, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
  781.     ui.addTextArea(57, "", ADMINISTRADOR, 741, 281, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
  782.     ui.addTextArea(58, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
  783.     ui.addTextArea(59, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>teams", ADMINISTRADOR, 742, 290, 55, 23, 0x000000, 0x000000, 1, true)
  784.     ui.addTextArea(60, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>Azar 2", ADMINISTRADOR, 742, 278, 55, 23, 0x000000, 0x000000, 1, true)
  785. end
  786. function verificarmodo()
  787.  ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  788.  if modo2 == "normal" then
  789.     ui.addTextArea(51, "<p align='center'><font face='Century Gothic'><a href='event:normal'><font size='12'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
  790.     end
  791.     if modo == "bootcamp" then
  792.     ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:bootcamp'><font size='12'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  793.     end
  794.     if modo == "racing" then
  795.     ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:racing'><font size='12'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  796.     end
  797.     if modo == "mix" then
  798.     ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:mix'><font size='12'>"..modo, ADMINISTRADOR, 742, 174, 55, 18, 0x324650, 0x324650, 1, true)
  799.     end
  800. end
  801. function contarjugadores()
  802.         local players=0
  803.         function eventNewPlayer(name)--Cuando un jugador entre a la sala...
  804.             players=players+1--Sumamos 1 a nuestra tabla
  805.         end
  806.         function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
  807.             players=players-1--Restamos 1 a nuestra tabla
  808.         end
  809.         for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
  810.             eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
  811.         end
  812. end
  813. function eventTextAreaCallback(id, player, callback)
  814.     if callback == 'iniciarJogo' then
  815.             gameRunning = true
  816.             for i = 1, 20 do
  817.                 ui.removeTextArea(i)
  818.             end
  819.             for i = 26, 77 do
  820.                 ui.removeTextArea(i)
  821.             end
  822.     borrarScoreDeathmatch()
  823.             newMap()
  824.             if modo2b == "normal" then
  825.                 points[1] = 0
  826.                 points[2] = 0
  827.                 points[3] = 0
  828.                 points[4] = 0
  829.                 points[5] = 0
  830.                 points[6] = 0
  831.                 points[7] = 0
  832.                 points[8] = 0
  833.                 displayScore()
  834.             end
  835.             if modo2b == "Deathmatch" then
  836.                 for k,v in pairs(tfm.get.room.playerList) do
  837.                 puntos[k] = 0
  838.                 end
  839.             end
  840.     end
  841.     if callback == 'salir' then
  842.         tfm.system.exit()
  843.     end
  844.  
  845.     if callback == 'llenar' then
  846.     nteam = 1
  847.         azar = {}
  848.         playersInGame = {}
  849.        
  850.         teams = {
  851.             [1] = {},
  852.             [2] = {},
  853.             [3] = {},
  854.             [4] = {},
  855.             [5] = {},
  856.             [6] = {},
  857.             [7] = {},
  858.             [8] = {},
  859.         }  
  860.         contarjugadores()
  861.         for k,players in pairs(tfm.get.room.playerList) do
  862.             if nteam > 8 then
  863.                 nteam = 1
  864.             end
  865.                 table.insert(teams[nteam], k)
  866.                 playersInGame[k] = true
  867.                 nteam = nteam + 1
  868.                 displayTeams()
  869.         end
  870.     end
  871.    
  872.    
  873.    
  874.     if callback == 'reiniciar' then
  875.             teams[1] = {}
  876.             points[1] = 0
  877.             teams[2] = {}
  878.             points[2] = 0
  879.             teams[3] = {}
  880.             points[3] = 0
  881.             teams[4] = {}
  882.             points[4] = 0
  883.             teams[5] = {}
  884.             points[5] = 0
  885.             teams[6] = {}
  886.             points[6] = 0
  887.             teams[7] = {}
  888.             points[7] = 0
  889.             teams[8] = {}
  890.             points[8] = 0
  891.             equipos = {}
  892.             puntos = {}
  893.             modob = "racing"
  894.             modo = "bootcamp"
  895.             modo2 = "Deathmatch"
  896.             modo2b = "normal"
  897.             displayTeams()
  898.            
  899.     end
  900.     if callback == 'bootcamp' then
  901.         tiempo = 150
  902.         modob = "bootcamp"
  903.         modo = "mix"
  904.         verificarmodo()
  905.         maps = mapasbootcamp
  906.     end
  907.     if callback == 'racing' then
  908.  
  909.         tiempo = 60
  910.         modob = "racing"
  911.         modo = "bootcamp"
  912.         verificarmodo()
  913.         maps = mapasracing
  914.     end
  915.     if callback == 'mix' then
  916.         tiempo = 90
  917.         modob = "mix"
  918.         modo = "racing"
  919.         verificarmodo()
  920.         maps = mapasmix
  921.     end
  922.     if callback == 'Deathmatch' then
  923.        modo2b = "Deathmatch"
  924.         modo2 = "normal"
  925.         displayTeams()
  926.         for i = 4, 15 do
  927.             ui.removeTextArea(i)
  928.         end
  929.         for i = 31, 36 do
  930.             ui.removeTextArea(i)
  931.         end
  932.         for i = 39, 40 do
  933.             ui.removeTextArea(i)
  934.         end
  935.         ui.removeTextArea(53)
  936.         ui.removeTextArea(56)
  937.         contarjugadores()
  938.     for k,players in pairs(tfm.get.room.playerList) do
  939.             equipos[k] = k
  940.             puntos[k] = 0
  941.             equipoc[k] = "0x324650"
  942.             playersInGame[k] = true
  943.             if textareaid >= 32 then
  944.             else
  945.                 ui.addTextArea(textarealugar, "<p align='center'><V>"..k, nil, distanciax, distanciay, 140, 18, 0x324650, 0x324650, 1, true)
  946.                 distanciay = distanciay + 37
  947.                 textareaid = textareaid + 1
  948.                 textarealugar = textarealugar + 1
  949.                 if textareaid == 8 then
  950.                     distanciax = distanciax + 190
  951.                     distanciay = 80
  952.                     textareaid = 0
  953.             end
  954.             ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
  955.         end
  956.     end
  957.     end
  958.     if callback == 'normal' then
  959.     modo2b = "normal"
  960.     modo2 = "Deathmatch"
  961.     resetmostrarjugadoresdeathmatch()
  962.     displayTeams()
  963.     end
  964.     if callback == 'cerrarpuntaje' then
  965.         borrarScoreDeathmatch()
  966.     end
  967.     if callback == 'azart' then
  968.     totales = 0
  969.     totales2 = 0
  970.     jugando = {}
  971.     totaljugando = 1
  972.     jugandoposicion = {}
  973.     playersInGame = {}
  974.     teams[1] = {}
  975.     teams[2] = {}
  976.     teams[3] = {}
  977.     teams[4] = {}
  978.     teams[5] = {}
  979.     teams[6] = {}
  980.     teams[7] = {}
  981.     teams[8] = {}
  982.     alazar()
  983.     borrarScoreDeathmatch()
  984.     modoazar = "true"
  985.     modoalazar()
  986.     end
  987.     if callback == 'volver' then
  988.     totales = 0
  989.     totales2 = 0
  990.     jugando = {}
  991.     totaljugando = 1
  992.     jugandoposicion = {}
  993.     playersInGame = {}
  994.     teams[1] = {}
  995.     teams[2] = {}
  996.     teams[3] = {}
  997.     teams[4] = {}
  998.     teams[5] = {}
  999.     teams[6] = {}
  1000.     teams[7] = {}
  1001.     teams[8] = {}
  1002.     displayTeams()
  1003.     end
  1004.       if callback == 'bootcamp2' then
  1005.         tiempo = 150
  1006.         modob = "bootcamp"
  1007.         modo = "mix"
  1008.         verificarmodo2()
  1009.         maps = mapasbootcamp
  1010.     end
  1011.     if callback == 'racing2' then
  1012.  
  1013.         tiempo = 60
  1014.         modob = "racing"
  1015.         modo = "bootcamp"
  1016.         verificarmodo2()
  1017.         maps = mapasracing
  1018.     end
  1019.     if callback == 'mix2' then
  1020.         tiempo = 90
  1021.         modob = "mix"
  1022.         modo = "racing"
  1023.         verificarmodo2()
  1024.         maps = mapasmix
  1025.     end
  1026. end
  1027. function alazar()
  1028.     t = 0
  1029.     for k,v in pairs(tfm.get.room.playerList) do
  1030.     if t == 1 then
  1031.     table.insert(teams[2], k)
  1032.     playersInGame[k] = true
  1033.     t = 0
  1034.     elseif t == 0 then
  1035.     table.insert(teams[1], k)
  1036.     playersInGame[k] = true
  1037.     t = 1
  1038.     end
  1039.     end
  1040.     end
  1041.  
  1042.  
  1043.  
  1044. function verificarmodo2()
  1045.  ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
  1046.     if modo == "bootcamp" then
  1047.     ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:bootcamp2'><font size='12'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1048.     end
  1049.     if modo == "racing" then
  1050.     ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:racing2'><font size='12'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1051.     end
  1052.     if modo == "mix" then
  1053.     ui.addTextArea(48, "<p align='center'><font face='Century Gothic'><a href='event:mix2'><font size='12'>"..modo, ADMINISTRADOR, 601, 174, 55, 18, 0x324650, 0x324650, 1, true)
  1054.     end
  1055. end
  1056. function string.split(s, pattern, n)
  1057.     local st = {}
  1058.     for sb in string.gmatch(s, "[^"..pattern.."]+") do
  1059.     if not n or n > -1 then
  1060.         table.insert(st,sb)
  1061.     else
  1062.         st[#st] = st[#st]..pattern..sb
  1063.     end
  1064.     n = n and n-1 or false
  1065.     end
  1066.     return st
  1067. end
  1068. function table.contains(tableT, element)
  1069.     for _, value in pairs(tableT) do
  1070.         if value == element then
  1071.             return true
  1072.         end
  1073.     end
  1074.     return false
  1075. end
  1076. function eventPlayerDied()
  1077.     local alive = 0
  1078.     for k,v in pairs(tfm.get.room.playerList) do
  1079.         if not v.isDead then
  1080.             alive = alive+1
  1081.         end
  1082.     end
  1083.     if alive == 0 then
  1084.         newMap()
  1085.     end
  1086. end
  1087. displayTeams()
RAW Paste Data