Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = { "Tectoon", "Theapps", "Sagazgamer" }
- np= tfm.exec.disableAutoNewGame(true) or {[[@1703644]], [[@360778]], [[@183740]], [[@4624694]], [[@2065627]], [[@1474189]], [[@1482964]], [[@626107]], [[@4530334]], [[@2593758]], [[@524924]], [[@2722183]]}
- function eventLoop(a, b)
- local c= 0;
- table.foreach(tfm.get.room.playerList, function(i,v) c= not v.isDead and c+1 or c end)
- c= (c == 0 or b <=0) and tfm.exec.newGame(np[math.random(#np)]) or nil;
- end
- eventNewGame = function()
- sh = 2
- alive = 0
- maxscore = 0
- for i in pairs(tfm.get.room.playerList) do
- alive = alive + 1
- for l = 1,2 do
- if tfm.get.room.playerList[i].score < maxscore + 1 and sh ~= 0 then
- sh = sh - 1
- tfm.exec.setShaman(i)
- tfm.exec.setPlayerScore(i, 0, false)
- if sh == 1 then
- tfm.exec.setNameColor(i, 0xFF1100) ------- Aonde está FFAB35 você mude para outro código, outra cor, que será a cor do shaman
- tfm.exec.setUIMapName("Treinamento Shaman V1.2")
- end
- 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
- end
- end
- end
- eventLoop(0, 0)
- mapHistory = { 0 }
- nbMapL = 0
- nbMapH = 0
- parametre = { ["Shaman auto"] = true,
- ["Novo mapa auto"] = true, ["Tempo automático"] = true, ["Pontuação"] = true,
- ["Morte de AFK"] = true,
- ["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 == "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 == "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 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 eventPlayerRespawn ( playerName )
- if parametre["Todos Shaman"] then
- tfm.exec.setShaman ( playerName )
- end
- if parametre["Meep para todos"] then
- tfm.exec.giveMeep ( playerName )
- end
- end
- function isadminin ( name )
- for k, v in pairs( adminin ) do
- if name == v then
- return true
- end
- end
- return false
- end
- function eventChatCommand(p,c)
- local args={}
- for i in c:gmatch('[^%s]+') do
- table.insert(args,i)
- end
- if args[1]==[[skip]] and p==[[Sagazgamer]] then
- tfm.exec.newGame(np[math.random(#np)])
- tfm.exec.setUIMapName("<J> Treinamento Shaman V1.2")
- print("<J>Próximo mapa<n> Mapa carregado com sucesso!")
- elseif args[1]=="reset" and p==[[Sagazgamer]] then
- tfm.exec.newGame(tfm.get.room.currentMap)
- print("<J>Resetando Mapa...<n> Mapa resetado com sucesso!")
- end
- end
- for i,command in ipairs({"skip","reset"}) do
- system.disableChatCommandDisplay(command)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement