Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ADMINISTRADOR = "+Lknx#0000"
- --[[
- Comandos:
- !saltar - Para cambiar de mapa
- !puntos - Para cambiar el puntaje, ej: !puntos team1 5
- !np @codigo - Para poner cualquier mapa
- !pausar - Para pausar el juego
- !team - Para asignar jugadores a un equipo, ej: !team1 Kmo#7926
- !resultado NUMERO - Asigna el puntaje para ganar, ej: !d 20
- !añadir team nick - Añade un jugador a el equipo especificado, ej: !añadir team4 Kmo#7926
- !reiniciar - Resetea el juego
- !quitar NOMBRE - saca a un jugador del juego
- !puntaje - para ver el puntaje [SOLO EN MODO DEATHMATCH]
- --------------------------------------------------------------------
- ]]
- -----------------------------------------------------------------------------------
- local WINS = 20 -- Puntaje para ganar.
- ------------------------------------------------------------------------------------
- ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
- system.disableChatCommandDisplay("np", true)
- system.disableChatCommandDisplay("pausar", true)
- system.disableChatCommandDisplay("saltar", true)
- system.disableChatCommandDisplay("puntaje", true)
- system.disableChatCommandDisplay("team1", true)
- system.disableChatCommandDisplay("team2", true)
- system.disableChatCommandDisplay("team3", true)
- system.disableChatCommandDisplay("team4", true)
- system.disableChatCommandDisplay("team5", true)
- system.disableChatCommandDisplay("team6", true)
- system.disableChatCommandDisplay("team7", true)
- system.disableChatCommandDisplay("team8", true)
- system.disableChatCommandDisplay("reiniciar", true)
- system.disableChatCommandDisplay("resultado", true)
- system.disableChatCommandDisplay("añadir", true)
- system.disableChatCommandDisplay("quitar", true)
- system.disableChatCommandDisplay("puntos", true)
- system.disableChatCommandDisplay("tamaño", true)
- system.disableChatCommandDisplay("tamaño5", true)
- system.disableChatCommandDisplay("tamaño4", true)
- system.disableChatCommandDisplay("tamaño3", true)
- system.disableChatCommandDisplay("tamaño2", true)
- system.disableChatCommandDisplay("tamaño1", true)
- system.disableChatCommandDisplay("tamaño0.5", true)
- system.disableChatCommandDisplay("tamaño0.4", true)
- system.disableChatCommandDisplay("tamaño0.3", true)
- system.disableChatCommandDisplay("tamaño0.2", true)
- system.disableChatCommandDisplay("tamaño0.1", true)
- system.disableChatCommandDisplay("meep", true)
- system.disableChatCommandDisplay("vampiros", true)
- system.disableChatCommandDisplay("chamanes", true)
- tfm.exec.disablePhysicalConsumables()
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoTimeLeft()
- local teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- local points = {
- [1] = 0,
- [2] = 0,
- [3] = 0,
- [4] = 0,
- [5] = 0,
- [6] = 0,
- [7] = 0,
- [8] = 0,
- }
- local equipos = {}
- local puntos = {}
- local maxPlayers = 200
- local modob = "racing"
- local modo = "bootcamp"
- local modo2 = "Deathmatch"
- local modo2b = "normal""FF0000",
- [2] = "003AFF",
- [3] = "00FF04",
- [4] = "FF9E00",
- [5] = "FBFF00",
- [6] = "AE00FF",
- [7] = "FF0097",
- [8] = "060606",
- }
- local queue = {}
- local nteam = 1
- local azar = {}
- local posicion = {}
- local modoazar = ""
- local numeroposicion = 1
- local totales = 0
- local totales2 = 0
- local jugando = {}
- local totaljugando = 1
- local jugandoposicion = {}
- function newMap()
- local mapcode = maps[math.random(#maps)]
- if #queue > 0 then
- mapcode = queue[1]
- table.remove(queue, 1)
- end
- ui.removeTextArea(100, nil)
- tfm.exec.newGame(mapcode)
- ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
- for player, data in pairs(tfm.get.room.playerList) do
- if not playersInGame[player] then
- tfm.exec.killPlayer(player)
- end
- end
- tfm.exec.setGameTime(tiempo)
- if modo2b == "Deathmatch" then
- borrarScoreDeathmatch()
- end
- end
- ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
- function modoalazar()
- ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(37, "<p align='center'><font face='Century Gothic'><font size='12'>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(2, "", nil, 142, 71, 516, 290, 0x0E1417, 0x0E1417, 1, true)
- ui.addTextArea(4, "", nil, 231, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(5, "<p align='center'><font face='Century Gothic'><font size='11'>Equipo 1", nil, 232, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(6, "", nil, 399, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(7, "<p align='center'><font face='Century Gothic'><font size='11'>Equipo 2", nil, 400, 80, 140, 20, 0x324650, 0x324650, 1, true)
- for i=8, 11 do
- ui.removeTextArea(i)
- end
- ui.addTextArea(40, "", nil, 231, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 232, 121, 138, 198, 0x324650, 0x324650, 1, true)
- for i=32, 35 do
- ui.removeTextArea(i)
- end
- ui.addTextArea(36, "", nil, 399, 120, 140, 200, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 400, 121, 138, 198, 0x324650, 0x324650, 1, true)
- ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 320, 197, 140, 200, 0, 0, 0, true)
- ui.addTextArea(15, "", nil, 367, 202, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'>VS", nil, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(42, "", ADMINISTRADOR, 600, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(41, "<p align='center'><font face='Century Gothic'><a href='event:salir'>X", ADMINISTRADOR, 601, 82, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(45, "", ADMINISTRADOR, 600, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(46, "<p align='center'><font face='Century Gothic'><a href='event:reset'>Reiniciar", ADMINISTRADOR, 601, 140, 50, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(47, "", ADMINISTRADOR, 600, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'><a href='event:iniciarJogo'>Iniciar", ADMINISTRADOR, 368, 203, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(57, "", ADMINISTRADOR, 600, 207, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(58, "<p align='center'><font face='Century Gothic'><a href='event:volver'><font size='11'>8 Teams", ADMINISTRADOR, 601, 208, 55, 23, 0x324650, 0x324650, 1, true)
- ui.removeTextArea(59)
- ui.removeTextArea(60)
- ui.removeTextArea(53)
- ui.removeTextArea(51)
- ui.removeTextArea(54)
- ui.addTextArea(56, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>Azar", ADMINISTRADOR, 601, 246, 55, 18, 0x324650, 0x324650, 1, true)
- verificarmodo2()
- end
- ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
- function eventPlayerWon(player)
- if not isfirst then
- isfirst = true
- tfm.exec.setGameTime(3)
- if modo2b == "Deathmatch" then
- if puntos[player] >= WINS - 1 then
- gameRunning = false
- winTime = os.time()
- ui.addTextArea(29, string.format("<p align='center'><font face='Century Gothic'><font size='37' color='#000000'>%s ganó", player), nil, 3, 168, 800, 500, 0, 0, 0, true)
- 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)
- 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)
- end
- tfm.exec.setGameTime(3)
- puntos[player] = puntos[player]+1
- equipoc[player] = "0x115b17"
- displayScoreDeathmatch()
- end
- if modo2b == "normal" then
- if table.contains(teams[1], player) then
- tfm.exec.setGameTime(3)
- points[1] = points[1]+1
- 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)
- elseif table.contains(teams[2], player) then
- tfm.exec.setGameTime(3)
- points[2] = points[2]+1
- 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)
- elseif table.contains(teams[3], player) then
- tfm.exec.setGameTime(3)
- points[3] = points[3]+1
- 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)
- elseif table.contains(teams[4], player) then
- tfm.exec.setGameTime(3)
- points[4] = points[4]+1
- 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)
- elseif table.contains(teams[5], player) then
- tfm.exec.setGameTime(3)
- points[5] = points[5]+1
- 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)
- elseif table.contains(teams[6], player) then
- tfm.exec.setGameTime(3)
- points[6] = points[6]+1
- 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)
- elseif table.contains(teams[7], player) then
- tfm.exec.setGameTime(3)
- points[7] = points[7]+1
- 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)
- elseif table.contains(teams[8], player) then
- tfm.exec.setGameTime(3)
- points[8] = points[8]+1
- 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)
- else
- isfirst = false
- end
- winner = false
- if points[1] >= WINS then
- winner = 1
- elseif points[2] >= WINS then
- winner = 2
- elseif points[3] >= WINS then
- winner = 3
- elseif points[4] >= WINS then
- winner = 4
- elseif points[5] >= WINS then
- winner = 5
- elseif points[6] >= WINS then
- winner = 6
- elseif points[7] >= WINS then
- winner = 7
- elseif points[8] >= WINS then
- winner = 8
- end
- if winner then
- gameRunning = false
- winTime = os.time()
- local names = {
- "rojo",
- "azul",
- "verde",
- "naranja",
- "amarillo",
- "morado",
- "rosado",
- "negro",
- }
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- end
- displayScore()
- end
- end
- end
- function eventLoop(elapsed, remain)
- if gameRunning then
- remain = remain/1000
- if remain < 0 then
- remain = 100
- newMap()
- end
- ui.setMapName("<font color='#fffff'>+Lknx#0000 Administrador Funcorp Racing")
- else
- if winTime then
- if winTime > os.time()-30000 then
- else
- winTime = false
- ui.removeTextArea(26)
- ui.removeTextArea(27)
- ui.removeTextArea(28)
- ui.removeTextArea(29)
- ui.removeTextArea(30)
- displayTeams()
- teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- points = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- playersInGame = {}
- end
- end
- end
- end
- function string.title(s)
- return string.gsub(s, "%a", function(c)
- return string.upper(c)
- end, 1)
- end
- function resetmostrarjugadoresdeathmatch()
- distanciax = 30
- distanciay = 80
- textarealugar = 302
- textareaid = 0
- end
- function eventChatCommand(player, command)
- if modo2b == "Deathmatch" then
- args = string.split(command, " ")
- if args[1] == "puntaje" then
- resetmostrarjugadoresdeathmatch()
- ui.addTextArea(300, "<p align='center'><V><a href='event:cerrarpuntaje'>X", player, 30, 50, 30, 16, 0x324650, 0x324650, 1, true)
- ui.addTextArea(301, string.format("<p align='center'><V>Todos a %s puntos",WINS), player, 80, 45, 180, 18, 0x324650, 0x000000, 1, true)
- for k,players in pairs(tfm.get.room.playerList) do
- if puntos[k] then
- equipos[k] = k
- playersInGame[k] = true
- if textareaid >= 32 then
- else
- ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), player, distanciax, distanciay, 140, 18, 0x324650, 0x000000, 1, true)
- distanciay = distanciay + 37
- textareaid = textareaid + 1
- textarealugar = textarealugar + 1
- if textareaid == 8 then
- distanciax = distanciax + 190
- distanciay = 80
- textareaid = 0
- end
- end
- end
- end
- end
- end
- if player:lower() == ADMINISTRADOR:lower() then
- args = string.split(command, " ")
- if args[1] == "team1" then
- if modo2b == "normal" then
- table.remove(args, 1)
- teams[1] = {}
- points[1] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[1], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- end
- elseif args[1] == "team2" and modo2b == "normal" then
- table.remove(args, 1)
- teams[2] = {}
- points[2] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[2], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team3" and modo2b == "normal" then
- table.remove(args, 1)
- teams[3] = {}
- points[3] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[3], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team4" and modo2b == "normal" then
- table.remove(args, 1)
- teams[4] = {}
- points[4] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[4], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team5" and modo2b == "normal" then
- table.remove(args, 1)
- teams[5] = {}
- points[5] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[5], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team6" and modo2b == "normal" then
- table.remove(args, 1)
- teams[6] = {}
- points[6] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[6], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team7" and modo2b == "normal" then
- table.remove(args, 1)
- teams[7] = {}
- points[7] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[7], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "team8" and modo2b == "normal" then
- table.remove(args, 1)
- teams[8] = {}
- points[8] = 0
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[8], player)
- playersInGame[player] = true
- end
- if modoazar == "true" then
- modoalazar()
- else
- displayTeams()
- end
- elseif args[1] == "meep" then
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.giveMeep(name)
- end
- elseif args[1] == "saltar" then
- newMap()
- elseif args[1] == "np" then
- if args[2] then
- table.insert(queue, args[2])
- end
- elseif args[1] == "tamaño" then
- print(args[1],args[2],args[3])
- tfm.exec.changePlayerSize(args[2],args[3])
- elseif args[1] == "resultado" then
- if args[2] then
- WINS = tonumber(args[2])
- displayScore()
- end
- elseif args[1] == "añadir" and modo2b == "Deathmatch" then
- if args[2] then
- table.remove(args, 1)
- for index, player in pairs(args) do
- equipos[player] = player
- puntos[player] = 0
- playersInGame[player] = true
- end
- end
- elseif args[1] == "añadir" and modo2b == "normal" then
- if args[2] and args[3] then
- if args[2] == "team1" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[1], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team2" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args, 3) do
- player = string.title(player)
- table.insert(teams[2], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team3" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[3], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team4" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[4], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team5" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[5], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team6" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[6], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team7" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[7], player)
- playersInGame[player] = true
- end
- end
- if args[2] == "team8" and modo2b == "normal" then
- table.remove(args, 1)
- table.remove(args, 1)
- for index, player in pairs(args) do
- player = string.title(player)
- table.insert(teams[8], player)
- playersInGame[player] = true
- end
- end
- end
- elseif args[1] == "quitar" then
- if args[2] then
- for index, player in pairs(args) do
- player = string.title(player)
- playersInGame[player] = false
- end
- end
- elseif args[1] == "reiniciar" then
- teams[1] = {}
- points[1] = 0
- teams[2] = {}
- points[2] = 0
- teams[3] = {}
- points[3] = 0
- teams[4] = {}
- points[4] = 0
- teams[5] = {}
- points[5] = 0
- teams[6] = {}
- points[6] = 0
- teams[7] = {}
- points[7] = 0
- teams[8] = {}
- points[8] = 0
- equipos = {}
- puntos = {}
- modob = "racing"
- modo = "bootcamp"
- modo2 = "Deathmatch"
- modo2b = "normal"
- displayTeams()
- elseif args[1] == "puntos" and modo2b == "normal" then
- if args[2] and args[3] then
- local team = tonumber(args[2]:match("team(%d+)") or 0)
- if team > 0 and team < 5 then
- local newScore = tonumber(args[3]) or points[team]
- points[team] = newScore
- displayScore()
- end
- end
- elseif args[1] == "pausar" then
- gameRunning = not gameRunning
- if not gameRunning then
- ui.addTextArea(90, "", nil, 235, 200, 302, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(91, "<p align='center'><font face='Century Gothic'> El juego ha sido pausado ", nil, 235, 200, 300, 20, 0x324650, 0x324650, 1, true)
- tfm.exec.disableAutoTimeLeft(true)
- else
- ui.removeTextArea(90)
- ui.removeTextArea(91)
- tfm.exec.disableAutoTimeLeft(false)
- end
- end
- end
- end
- function eventNewGame()
- if gameRunning then
- tfm.exec.setUIMapName("")
- if modo2b == "normal" then
- isfirst = false
- for i, p in pairs(teams[1]) do
- tfm.exec.setNameColor(p, "0x"..colors[1])
- end
- for i, p in pairs(teams[2]) do
- tfm.exec.setNameColor(p, "0x"..colors[2])
- end
- for i, p in pairs(teams[3]) do
- tfm.exec.setNameColor(p, "0x"..colors[3])
- end
- for i, p in pairs(teams[4]) do
- tfm.exec.setNameColor(p, "0x"..colors[4])
- end
- for i, p in pairs(teams[5]) do
- tfm.exec.setNameColor(p, "0x"..colors[5])
- end
- for i, p in pairs(teams[6]) do
- tfm.exec.setNameColor(p, "0x"..colors[6])
- end
- for i, p in pairs(teams[7]) do
- tfm.exec.setNameColor(p, "0x"..colors[7])
- end
- for i, p in pairs(teams[8]) do
- tfm.exec.setNameColor(p, "0x"..colors[8])
- end
- displayScore()
- end
- if modo2b == "Deathmatch" then
- isfirst = false
- for k,players in pairs(tfm.get.room.playerList) do
- tfm.exec.setNameColor(k, "0xff0000")
- equipoc[k] = "0x324650"
- end
- displayScore()
- end
- end
- end
- function displayScore()
- if modo2b == "normal" then
- if modoazar == "true" then
- ui.addTextArea(25, string.format("<p align='center'><font size='20'><font color='#%s'>%s<N> - <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)
- end
- if modoazar == "false" then
- 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)
- end
- end
- end
- function displayScoreDeathmatch()
- resetmostrarjugadoresdeathmatch()
- 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)
- for k,players in pairs(tfm.get.room.playerList) do
- if puntos[k] then
- equipos[k] = k
- playersInGame[k] = true
- if textareaid >= 32 then
- else
- ui.addTextArea(textarealugar, string.format("<p align='center'><V>%s - %s",k,puntos[k]), nil, distanciax, distanciay, 140, 18, equipoc[k], 0x000000, 1, true)
- distanciay = distanciay + 37
- textareaid = textareaid + 1
- textarealugar = textarealugar + 1
- if textareaid == 8 then
- distanciax = distanciax + 190
- distanciay = 80
- textareaid = 0
- end
- end
- end
- end
- end
- function borrarScoreDeathmatch()
- for i = 300, 334 do
- ui.removeTextArea(i)
- end
- end
- system.bindMouse("+Lknx#0000", true)
- function eventMouse(name, x, y)
- tfm.exec.movePlayer(name,x,y,false,0,0,true)
- end
- function displayTeams()
- borrarScoreDeathmatch()
- modoazar = "false"
- ui.addTextArea(38, "", nil, 235, 30, 302, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(37, "<p align='center'><font face='Century Gothic'><font size='12'>Administrador: "..ADMINISTRADOR, nil, 235, 30, 300, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(2, "", nil, 0, 71, 800, 295, 0x0E1417, 0x0E1417, 1, true)
- ui.addTextArea(4, "", nil, 57, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(5, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 1", nil, 58, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(6, "", nil, 227, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(7, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 2", nil, 228, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(8, "", nil, 417, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(9, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 3", nil, 418, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(10, "", nil, 587, 79, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(11, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 4", nil, 588, 80, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(73, "", nil, 57, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(68, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 5", nil, 58, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(69, "", nil, 227, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(70, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 6", nil, 228, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(71, "", nil, 417, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(72, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 7", nil, 418, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(77, "", nil, 587, 229, 142, 22, 0x324650, 0x5A7A8B, 1, true)
- ui.addTextArea(74, "<p align='center'><font face='Century Gothic'><font size='13'>Equipo 8", nil, 588, 230, 140, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea(12, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 210, 102, 140, 200, 0, 0, 0, true)
- ui.addTextArea(39, "<p align='center'><font color='#5A7A8B'>|</font>", nil, 450, 102, 140, 200, 0, 0, 0, true)
- ui.addTextArea(40, "", nil, 59, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(31, "<p align='center'><font color='#"..colors[1].."'>"..table.concat(teams[1], "\n"), nil, 60, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(32, "", nil, 419, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(33, "<p align='center'><font color='#"..colors[3].."'>"..table.concat(teams[3], "\n"), nil, 420, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(34, "", nil, 589, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(35, "<p align='center'><font color='#"..colors[4].."'>"..table.concat(teams[4], "\n"), nil, 590, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(36, "", nil, 229, 120, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(13, "<p align='center'><font color='#"..colors[2].."'>"..table.concat(teams[2], "\n"), nil, 230, 121, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(76, "", nil, 59, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(62, "<p align='center'><font color='#"..colors[5].."'>"..table.concat(teams[5], "\n"), nil, 60, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(63, "", nil, 419, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(64, "<p align='center'><font color='#"..colors[7].."'>"..table.concat(teams[7], "\n"), nil, 420, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(65, "", nil, 589, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(66, "<p align='center'><font color='#"..colors[8].."'>"..table.concat(teams[8], "\n"), nil, 590, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(67, "", nil, 229, 269, 140, 92, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(75, "<p align='center'><font color='#"..colors[6].."'>"..table.concat(teams[6], "\n"), nil, 230, 270, 138, 90, 0x324650, 0x324650, 1, true)
- ui.addTextArea(14, "<p align='center'><font color='#5A7A8B'>____ ____</font>", nil, 325, 206, 140, 200, 0, 0, 0, true)
- ui.addTextArea(15, "", nil, 374, 211, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'>VS", nil, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(42, "", ADMINISTRADOR, 749, 81, 40, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(41, "<p align='center'><font face='Century Gothic'><a href='event:salir'>X", ADMINISTRADOR, 750, 82, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(45, "", ADMINISTRADOR, 744, 139, 52, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(46, "<p align='center'><font face='Century Gothic'><a href='event:reset'>Reiniciar", ADMINISTRADOR, 745, 140, 50, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(47, "", ADMINISTRADOR, 741, 173, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(54, "", ADMINISTRADOR, 741, 209, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- if modo2 == "Deathmatch" then
- ui.addTextArea(51, "<p align='center'><font face='Century Gothic'><a href='event:Deathmatch'><font size='12'>"..modo2, ADMINISTRADOR, 742, 210, 55, 18, 0x324650, 0x324650, 1, true)
- end
- verificarmodo()
- ui.addTextArea(53, "", ADMINISTRADOR, 741, 245, 57, 20, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(56, "<p align='center'><font face='Century Gothic'><a href='event:llenar'><font size='12'>Llenar", ADMINISTRADOR, 742, 246, 55, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(16, "<p align='center'><font face='Century Gothic'><a href='event:iniciarJogo'>Inicia", ADMINISTRADOR, 375, 212, 38, 18, 0x324650, 0x324650, 1, true)
- ui.addTextArea(57, "", ADMINISTRADOR, 741, 281, 57, 25, 0x5A7A8B, 0x5A7A8B, 1, true)
- ui.addTextArea(58, "<p align='center'><font face='Century Gothic'><a href='event:azart'><font size='12'>", ADMINISTRADOR, 742, 282, 55, 23, 0x324650, 0x324650, 1, true)
- 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)
- 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)
- end
- function verificarmodo()
- 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)
- if modo2 == "normal" then
- 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)
- end
- if modo == "bootcamp" then
- 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)
- end
- if modo == "racing" then
- 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)
- end
- if modo == "mix" then
- 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)
- end
- end
- function contarjugadores()
- local players=0
- function eventNewPlayer(name)--Cuando un jugador entre a la sala...
- players=players+1--Sumamos 1 a nuestra tabla
- end
- function eventPlayerLeft(name)--Cuando un jugador salga de la sala...
- players=players-1--Restamos 1 a nuestra tabla
- end
- for name in pairs(tfm.get.room.playerList) do--Por cada jugador que esté en la sala...
- eventNewPlayer(name)--Le ejecutamos la función eventNewPlayer
- end
- end
- function eventTextAreaCallback(id, player, callback)
- if callback == 'iniciarJogo' then
- gameRunning = true
- for i = 1, 20 do
- ui.removeTextArea(i)
- end
- for i = 26, 77 do
- ui.removeTextArea(i)
- end
- borrarScoreDeathmatch()
- newMap()
- if modo2b == "normal" then
- points[1] = 0
- points[2] = 0
- points[3] = 0
- points[4] = 0
- points[5] = 0
- points[6] = 0
- points[7] = 0
- points[8] = 0
- displayScore()
- end
- if modo2b == "Deathmatch" then
- for k,v in pairs(tfm.get.room.playerList) do
- puntos[k] = 0
- end
- end
- end
- if callback == 'salir' then
- tfm.system.exit()
- end
- if callback == 'llenar' then
- nteam = 1
- azar = {}
- playersInGame = {}
- teams = {
- [1] = {},
- [2] = {},
- [3] = {},
- [4] = {},
- [5] = {},
- [6] = {},
- [7] = {},
- [8] = {},
- }
- contarjugadores()
- for k,players in pairs(tfm.get.room.playerList) do
- if nteam > 8 then
- nteam = 1
- end
- table.insert(teams[nteam], k)
- playersInGame[k] = true
- nteam = nteam + 1
- displayTeams()
- end
- end
- if callback == 'reiniciar' then
- teams[1] = {}
- points[1] = 0
- teams[2] = {}
- points[2] = 0
- teams[3] = {}
- points[3] = 0
- teams[4] = {}
- points[4] = 0
- teams[5] = {}
- points[5] = 0
- teams[6] = {}
- points[6] = 0
- teams[7] = {}
- points[7] = 0
- teams[8] = {}
- points[8] = 0
- equipos = {}
- puntos = {}
- modob = "racing"
- modo = "bootcamp"
- modo2 = "Deathmatch"
- modo2b = "normal"
- displayTeams()
- end
- if callback == 'bootcamp' then
- tiempo = 150
- modob = "bootcamp"
- modo = "mix"
- verificarmodo()
- maps = mapasbootcamp
- end
- if callback == 'racing' then
- tiempo = 60
- modob = "racing"
- modo = "bootcamp"
- verificarmodo()
- maps = mapasracing
- end
- if callback == 'mix' then
- tiempo = 90
- modob = "mix"
- modo = "racing"
- verificarmodo()
- maps = mapasmix
- end
- if callback == 'Deathmatch' then
- modo2b = "Deathmatch"
- modo2 = "normal"
- displayTeams()
- for i = 4, 15 do
- ui.removeTextArea(i)
- end
- for i = 31, 36 do
- ui.removeTextArea(i)
- end
- for i = 39, 40 do
- ui.removeTextArea(i)
- end
- ui.removeTextArea(53)
- ui.removeTextArea(56)
- contarjugadores()
- for k,players in pairs(tfm.get.room.playerList) do
- equipos[k] = k
- puntos[k] = 0
- equipoc[k] = "0x324650"
- playersInGame[k] = true
- if textareaid >= 32 then
- else
- ui.addTextArea(textarealugar, "<p align='center'><V>"..k, nil, distanciax, distanciay, 140, 18, 0x324650, 0x324650, 1, true)
- distanciay = distanciay + 37
- textareaid = textareaid + 1
- textarealugar = textarealugar + 1
- if textareaid == 8 then
- distanciax = distanciax + 190
- distanciay = 80
- textareaid = 0
- end
- ui.addTextArea(16, "<p align='center'><V><a href='event:iniciarJogo'>GO", ADMINISTRADOR, 375, 203, 38, 18, 0x324650, 0x324650, 1, true)
- end
- end
- end
- if callback == 'normal' then
- modo2b = "normal"
- modo2 = "Deathmatch"
- resetmostrarjugadoresdeathmatch()
- displayTeams()
- end
- if callback == 'cerrarpuntaje' then
- borrarScoreDeathmatch()
- end
- if callback == 'azart' then
- totales = 0
- totales2 = 0
- jugando = {}
- totaljugando = 1
- jugandoposicion = {}
- playersInGame = {}
- teams[1] = {}
- teams[2] = {}
- teams[3] = {}
- teams[4] = {}
- teams[5] = {}
- teams[6] = {}
- teams[7] = {}
- teams[8] = {}
- alazar()
- borrarScoreDeathmatch()
- modoazar = "true"
- modoalazar()
- end
- if callback == 'volver' then
- totales = 0
- totales2 = 0
- jugando = {}
- totaljugando = 1
- jugandoposicion = {}
- playersInGame = {}
- teams[1] = {}
- teams[2] = {}
- teams[3] = {}
- teams[4] = {}
- teams[5] = {}
- teams[6] = {}
- teams[7] = {}
- teams[8] = {}
- displayTeams()
- end
- if callback == 'bootcamp2' then
- tiempo = 150
- modob = "bootcamp"
- modo = "mix"
- verificarmodo2()
- maps = mapasbootcamp
- end
- if callback == 'racing2' then
- tiempo = 60
- modob = "racing"
- modo = "bootcamp"
- verificarmodo2()
- maps = mapasracing
- end
- if callback == 'mix2' then
- tiempo = 90
- modob = "mix"
- modo = "racing"
- verificarmodo2()
- maps = mapasmix
- end
- end
- function alazar()
- t = 0
- for k,v in pairs(tfm.get.room.playerList) do
- if t == 1 then
- table.insert(teams[2], k)
- playersInGame[k] = true
- t = 0
- elseif t == 0 then
- table.insert(teams[1], k)
- playersInGame[k] = true
- t = 1
- end
- end
- end
- function verificarmodo2()
- ui.addTextArea(50, string.format("<p align='center'><font face='Century Gothic'><font size='11'>Modo %s - %s ",modob,modo2b),nil, 235, 375, 300, 17, 0x324650, 0x324650, 1, true)
- if modo == "bootcamp" then
- 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)
- end
- if modo == "racing" then
- 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)
- end
- if modo == "mix" then
- 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)
- end
- end
- function string.split(s, pattern, n)
- local st = {}
- for sb in string.gmatch(s, "[^"..pattern.."]+") do
- if not n or n > -1 then
- table.insert(st,sb)
- else
- st[#st] = st[#st]..pattern..sb
- end
- n = n and n-1 or false
- end
- return st
- end
- function table.contains(tableT, element)
- for _, value in pairs(tableT) do
- if value == element then
- return true
- end
- end
- return false
- end
- function eventPlayerDied()
- local alive = 0
- for k,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- alive = alive+1
- end
- end
- if alive == 0 then
- newMap()
- end
- end
- displayTeams()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement