Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = { "Tectoon", "Theapps", "Sagazgamer" } -- Remplacez "Pseudo" par "Votre pseudo"
- --------------------------------------
- -- Evite tocar o seguinte --
- --------------------------------------
- mapHistory = { 0 }
- nbMapL = 0
- nbMapH = 0
- parametre = { ["Queijo para todos"] = false, ["Respawn auto"] = false, ["Shaman auto"] = true,
- ["Novo mapa auto"] = true, ["Tempo automático"] = true, ["Pontuação"] = true,
- ["Morte de AFK"] = true,
- ["Todos de Vamp"] = false, ["Meep para todos"] =false, ["Todos Shaman"] = false,
- ["Habilidades"] = true , ["Tempo por partidas"] = 120
- }
- aff = { lJoueurs = {} , joueur = {} , param = {} , param = {}
- }
- joueur = {}
- dernierProfil = {}
- for k, v in pairs (tfm.get.room.playerList) do
- joueur[k] = {}
- end
- for k, pseudo in pairs(admin) do
- ui.addTextArea (3, "<p align='center'><b><a href='event:parametre'>Definições</a></b></p>", pseudo, 10, 30, 80, 20, 0x000000, 0x324650, 0.75, true)
- for l, m in pairs ( aff ) do
- aff[l][pseudo] = false
- end
- end
- function eventTextAreaCallback(id, source, callback)
- if callback == 'parametre' then
- if aff["param"][source] == false then
- affParam( source )
- else
- effParam( source )
- end
- elseif parametre[callback] ~= nil then
- paraGestion(callback, source )
- ui.updateTextArea (id, callback .. ": <a href='event:" .. callback .. "'>" .. B(parametre[callback]) .. "</a>", source )
- end
- end
- function eventPopupAnswer (id, playerName, answer)
- if id == 3 then
- parametre["Tempo por partidas"] = answer
- end
- end
- function affParam(playerName)
- aff["param"][playerName] = true
- if aff["lJoueurs"][playerName] then
- effLJoueurs ( playerName )
- end
- b=0
- for k, v in pairs(parametre) do
- ui.addTextArea (b+2000, k.." : <a href='event:"..k.."'>"..B(v).."</a>" , playerName, 10+185*math.floor(b/6), 65+35*(b % 6), 170, 20, 0x324650, 0x324650, 0.75, true)
- b=b+1
- end
- end
- function effParam(playerName)
- aff["param"][playerName] = false
- for k=b,0,-1 do
- ui.removeTextArea(k+2000, playerName)
- end
- end
- function B(v)
- if type(v) == "boolean" then
- if v==true then
- return "<v><b>true</b></v>"
- else
- return "<r><b>false</b></r>"
- end
- else
- return "<b> "..v.." </b>"
- end
- end
- function paraGestion ( paraModif , playerName)
- if type(parametre[paraModif]) == "boolean" then
- parametre[paraModif] = not parametre[paraModif]
- end
- if paraModif == "Queijo para todos" and parametre[paraModif] then
- for k, v in pairs (joueur) do
- tfm.exec.giveCheese ( k )
- end
- elseif paraModif == "Respawn auto" and parametre[paraModif] then
- for k, v in pairs (joueur) do
- tfm.exec.respawnPlayer ( k )
- end
- elseif paraModif == "Shaman auto" then
- tfm.exec.disableAutoShaman( not parametre[paraModif] )
- elseif paraModif == "Novo mapa auto" then
- tfm.exec.disableAutoNewGame ( not parametre[paraModif] )
- elseif paraModif == "Tempo automático" then
- tfm.exec.disableAutoTimeLeft ( not parametre[paraModif] )
- elseif paraModif == "Pontuação" then
- tfm.exec.disableAutoScore ( not parametre[paraModif] )
- elseif paraModif == "Morte de AFK" then
- tfm.exec.disableAfkDeath ( not parametre[paraModif] )
- elseif paraModif == "Tempo por partidas" then
- ui.addPopup (3, 2, "enter default map time", playerName, 200, 200, 150, true)
- elseif paraModif == "Todos de Vamp" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.setVampirePlayer ( k )
- end
- elseif paraModif == "Meep para todos" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.giveMeep ( k )
- end
- elseif paraModif == "Todos Shaman" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.setShaman ( k )
- end
- elseif paraModif == "Habilidades" then
- tfm.exec.disableAllShamanSkills ( not parametre[paraModif] )
- end
- end
- function mapGestion (action)
- if action == 'random' then
- nbMapL = math.random(#mapList)
- tfm.exec.newGame(mapList[nbMapL])
- elseif action == 'repeat' then
- tfm.exec.newGame(tfm.get.room.currentMap)
- else
- if action == '-1' and (nbMapL + action) > 0 then
- nbMapL = nbMapL -1
- tfm.exec.newGame ( mapList[nbMapL] )
- elseif action == '+1' and (nbMapL + action) <= #mapList then
- nbMapL = nbMapL + 1
- tfm.exec.newGame ( mapList[nbMapL] )
- end
- end
- end
- function eventNewPlayer ( playerName )
- print ( playerName .. " vient d'entrer dans le salon \o/" )
- joueur[playerName] = {}
- if parametre["Respawn auto"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventPlayerLeft ( playerName )
- print ( playerName.. " vient de quitter le salon :(" )
- joueur[playerName] = nil
- end
- function eventPlayerDied ( playerName )
- if parametre["Respawn auto"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventPlayerWon ( playerName )
- if parametre["Respawn auto"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventNewGame ()
- if tfm.get.room.currentMap ~= mapHistory[nbMap] then
- nbMapH = nbMapH
- mapHistory[nbMapH] = tfm.get.room.currentMap
- end
- tfm.exec.setGameTime ( parametre["Tempo por partidas"] )
- for k, v in pairs ( joueur ) do
- eventPlayerRespawn ( k )
- end
- end
- function eventPlayerRespawn ( playerName )
- if parametre["Queijo para todos"] then
- tfm.exec.giveCheese ( playerName )
- end
- if parametre["Todos Shaman"] then
- tfm.exec.setShaman ( playerName )
- end
- if parametre["Todos de Vamp"] then
- tfm.exec.setVampirePlayer ( playerName )
- end
- if parametre["Meep para todos"] then
- tfm.exec.giveMeep ( playerName )
- end
- end
- function isAdmin ( name )
- for k, v in pairs( admin ) do
- if name == v then
- return true
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement