Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local verde = "<font color='#00C17c' size='12'>" -- 00C17c cambias eso x el color
- local fondoTextAreas = 0x2B2B2B -- color de fondo, ponelo despues del 0x
- local bordeTextAreas = 0x121212 -- color del borde
- local equipos = {{1, "Blood#3565", "Soothsayer#4890", "Benjaneitorc#0000"}, -- 1
- {2, "Misterthepro#0000", "Noob#5388", "Profeteus#0000"},
- {3, "Random#0000", "random2#5388", "random3#0000"},
- {4, "random6#0000", "random5#5388", "random4#0000"},
- {5, "random7#0000", "random8#5388", "random9#0000"},
- {6, "random12#0000", "random11#5388", "random10#0000"},
- {7, "random12#0000", "random11#5388", "random10#0000"},
- {8, "random12#0000", "random11#5388", "random10#0000"}
- }
- -----------------------
- local _, msg = pcall(nil)
- local admin = string.match(msg, "^(.-)%.")
- local admins = {
- [admin] = true, -- Este pertenece a quien cargó el lua, no es necesario que lo cambies
- ["Blood#3565"] = true,
- ["Alditohacker#0000"] = true,
- ["S_hippo#0000"] = true}
- local copy = function(list)
- local out = { }
- for k, v in next, list do
- out[k] = v
- end
- return out
- end
- local totalEquipos = copy(equipos)
- local x = 115
- local y = 90
- local countTotal = 0
- for _ in pairs(totalEquipos) do
- countTotal = countTotal + 1
- end
- local enfrentamientos = {}
- local countEnfrentamientos = 1
- local eligiendo = false
- local count = 0
- for _, i in next, totalEquipos do
- ui.addTextArea(i[1], verde .. "<p align='center'><b><a href='event:team" .. i[1] .. "'>Team" .. i[1] .. "</a>", nil, x, y, 60, 20, fondoTextAreas, bordeTextAreas, 1, true)
- y = y + 45
- if y == 270 then
- x = 645
- y = 90
- end
- end
- verIndice = function(team)
- for i, k in next, totalEquipos do
- if k[1] == team then
- return i
- end
- end
- end
- concatEnfrentamientos = function()
- local versus = "\n<textformat tabstops='[10, 95, 160]'>"
- for _, team in next, enfrentamientos do
- versus = versus .. "\n\t<a href='event:team" .. team[1] .. "'>Team" .. team[1]
- .. "</a>\t Vs \t"
- .. "<a href='event:team" .. team[2] .. "'>Team" .. team[2] .. "</a>"
- end
- return versus
- end
- eventTextAreaCallback = function (id, name, callback)
- --Callbacks de teams:
- if string.find(callback, "team") then
- local team, players = callback:gsub("team", ""), "\n\n<N><font size='12'>"
- team = tonumber(team)
- for i = 2, 4 do
- players = players .. equipos[team][i] .. "\n"
- end
- ui.addTextArea(666, verde .. "<font size='16'><p align='center'><b>Team" .. team .. players, name, 280, 270, 250, 100, 0x2B2B2B, bordeTextAreas, 1, true)
- end
- --callbacks elegir teams [admins]
- if not admins[name] then return end
- if callback == "elegirTeam" and countEnfrentamientos <= 4 then
- local team1 = math.random(1, countTotal) -- Elijo un número del 1 al total de teams
- team1 = totalEquipos[team1][1] -- elijo el team que está en el indice
- table.remove(totalEquipos, verIndice(team1))
- countTotal = countTotal - 1
- ui.removeTextArea(team1, nil)
- local team2 = math.random(1, countTotal)
- team2 = totalEquipos[team2][1]
- table.remove(totalEquipos, verIndice(team2))
- countTotal = countTotal - 1
- ui.removeTextArea(team2, nil)
- enfrentamientos[countEnfrentamientos] = {team1, team2}
- countEnfrentamientos = countEnfrentamientos + 1
- ui.updateTextArea(51, verde .. "<font size='14'><p align='center'><b>Enfrentamientos<p align='left'><font size='12'>" .."<J>" .. (concatEnfrentamientos() or ""), nil)
- end
- end
- ui.addTextArea(50, verde .. "", nil, 280, 45, 250, 190, 0x1E1E1E, 0x121212, 1, true)
- ui.addTextArea(51, verde .. "<font size='14'><p align='center'><b>Enfrentamientos<font size='12'>" .."\n\n<J>" .. (concatEnfrentamientos() or ""), nil, 290, 55, 235, 160, 0x2B2B2B, 0x2B2B2B, 1, true)
- ui.addTextArea(52, verde .. "<p align='center'><b><a href='event:elegirTeam'>Elegir team</a>", nil, 280, 230, 250, 20, fondoTextAreas, bordeTextAreas, 1, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement