Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = { "Tectoon", "Theapps", "Sagazgamer" } -- Remplacez "Pseudo" par "Votre pseudo"
- mapList = { "@5967199", "@5575612", "@5908444", "@5884932", "@5499579",
- "@5499388", "@5498342", "@5494330", "@5494247", "@5491284",
- "@5469269", "@5870159", "@5470929", "@5457988", "@1081762",
- "@1933292", "@2734103", "@204059", "@251430", "@3464359",
- "@2746128", "@523865", "@3296031", "@3630912", "@1474189",
- } -- Para adicionar os seus mapas : ,"@code1", "@code2"
- --------------------------------------
- -- Evite tocar o seguinte --
- --------------------------------------
- cham = { "Seta", "Caixa Pequena", "Caixa Grande", "Tábua Pequena", "Tábua Grande", "Bola", "Trampolim", "Bigorna", "Cn para Cima", "Cn para baixo", "Cn para direita", "Cn para esquerda", "Bomba", "Spirit", "Portal Azul", "Portal Laranja", "Balão", "Rune", "Maçã", "Ovelha Explosiva", "Nuvem", "Caixa", "Demolição", "RIP", "<r>•</n>", "<j>•</n>", "<v>•</n>"}
- chamId = { 0,1,2,3,4,6,7,10,17,18,19,20,23,24,26,27,28,32,39,40,57,61,41,11,22,14,90}
- chamS = 0
- 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
- }
- parametreJ = { ch="Shaman", fromage="Queijo", vampire="Vampiro",
- meep="Meep", tuer="Matar", rez="Respawn", win="Vitoria",
- fly="Fly", tp="Teleport"
- }
- aff = { lJoueurs = {} , joueur = {} , param = {} , param = {} , cham = {}
- }
- all = { fly = false , tp = false }
- joueur = {}
- dernierProfil = {}
- for k, v in pairs (tfm.get.room.playerList) do
- joueur[k] = {}
- joueur[k]["fly"] = false
- joueur[k]["tp"] = false
- joueur[k]["cham"] = false
- end
- for k, pseudo in pairs(admin) do
- ui.addTextArea (1, "<p align='center'><b><a href='event:time'>time</a></b></p>", pseudo, 60, 30, 35, 20, 0xC06F6E, 0x324650, 0.75, true)
- ui.addTextArea (2, "<p align='center'><b><a href='event:joueurs'>Jogadores</a></b></p>", pseudo, 110, 30, 80, 20, 0x000000, 0x324650, 0.75, true)
- ui.addTextArea (3, "<p align='center'><b><a href='event:parametre'>Definições</a></b></p>", pseudo, 205, 30, 80, 20, 0xC06F6E, 0x324650, 0.75, true)
- ui.addTextArea (4, "<p align='center'><b><a href='event:map'>Mapa</a></b></p>", pseudo, 10, 30, 35, 20, 0x000000, 0x324650, 0.5, true)
- ui.addTextArea (5, "<font size='15' color='#1'><b> <a href='event:-1'>< </a> <a href='event:repeat'>|| </a> <a href='event:+1'>></a> <a href='event:random'>R</a></b></font>", pseudo, 345, 30, 120, 20, 0,0,1, true)
- ui.addTextArea (6, "<p align='center'><b><a href='event:cham'>Shaman</a></b></p>", pseudo, 300, 30, 40, 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 == 'time' then
- ui.addPopup (0, 2, "Tempo para definir:", source, 10, 70, 150, true)
- elseif callback == 'map' then
- ui.addPopup (1, 2, "Código do Mapa::", source, 10, 70, 150, true)
- elseif callback == 'joueurs' then
- if aff["lJoueurs"][source] == false then
- affLJoueurs ( source )
- else
- effLJoueurs ( source )
- end
- elseif 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 )
- elseif joueur[callback] ~= nil or callback == "Nomes" then
- if aff["joueur"][source] then
- effJoueur ( source )
- if callback ~= dernierProfil[source] then
- eventTextAreaCallback(id, source, callback)
- end
- else
- affJoueur(source, callback)
- ui.updateTextArea (id, "<p align='center'><b><V><a href='event:" .. callback .. "'>" .. callback .. "</a></N></b></p>", source)
- end
- dernierProfil[source] = callback
- elseif parametreJ[callback] ~= nil then
- if dernierProfil[source] == "all" then
- for k, v in pairs ( joueur ) do
- if all[callback] ~= nil then
- joueur[k][callback] = all[callback]
- end
- paraJGestion ( k, callback )
- end
- all[callback] = not all[callback]
- else
- paraJGestion ( dernierProfil[source], callback )
- end
- elseif id == 5 then
- mapGestion ( callback )
- elseif id == 6 then
- if aff [ "cham" ] [ source ] then
- ui.removeTextArea (11, source)
- aff["cham"][source] = false
- else
- lCham = ""
- for k, v in ipairs ( cham ) do
- lCham = lCham .. "<a href='event:"..chamId[k].."'>"..v.."</a> \n"
- end
- ui.addTextArea(11, lCham, source, 10, 65, 130, 290, 0x324650, 0x324650, 0.75, true)
- aff["cham"][source] = true
- end
- elseif id == 11 then
- system.bindMouse (source, true)
- chamS = callback
- joueur[source]["cham"] = true
- else
- print ( "Eu não consigo encontrar esse comando" )
- end
- end
- function eventPopupAnswer (id, playerName, answer)
- if id == 0 then
- tfm.exec.setGameTime(answer, true)
- elseif id == 1 then
- tfm.exec.newGame(answer)
- elseif id == 3 then
- parametre["Tempo por partidas"] = answer
- end
- end
- function eventChatCommand ( name, command )
- M = 1
- LM = {}
- for w in string.gmatch(command, "%a+") do
- LM[M] = w
- M = M+1
- end
- if command == "commande" then
- listeCommande = ""
- for k, v in pairs ( parametreJ ) do
- listeCommande = listeCommande.."\n!"..k.." [Pseudo] => "..v
- end
- ui.addPopup (0, 3, "Lista de comandos e seu equivalente no menu : \n"..listeCommande, name, 10, 80, 200, true)
- else
- if isAdmin ( name ) then
- if parametreJ[LM[1]] ~= nil then
- if joueur[LM[2]] ~= nil then
- paraJGestion ( LM[2], LM[1] )
- else
- ui.addPopup (0, 3, "Eu não consigo encontrar "..LM[2].." na sala de estar. \nNe me tapez pas :(", name, 515, 325, 280, true)
- end
- else
- ui.addPopup (0, 3, "Eu não sei este comando. Escreva! Comando para ver a lista de comandos.", name, 515, 325, 280, true)
- end
- else
- ui.addPopup (0, 3, "Você não tem o direito de usar este comando :/", name, 515, 340, 280, true)
- end
- end
- end
- function affLJoueurs(playerName)
- aff["lJoueurs"][playerName] = true
- if aff["param"][playerName] then
- effParam ( playerName )
- end
- ui.addTextArea(1000, "<p align='center'><a href='event:all'>Nomes</a></p>", playerName, 110, 65, 80, 20, 0x324650, 0x324650, 0.75, true)
- a=1
- for k, v in pairs(joueur) do
- ui.addTextArea(1000+a, "<p align='center'><a href='event:" ..k.. "'>" .. k .. "</a></p>", playerName, 110-100*math.floor(a/10), 65+35*(a%10), 80, 20, 0x324650, 0x324650, 0.75, true)
- a=a+1
- end
- end
- function effLJoueurs(playerName)
- aff["lJoueurs"][playerName] = false
- if aff["joueur"][playerName] then
- effJoueur ( playerName )
- end
- for k=a+1000,1000,-1 do
- ui.removeTextArea(k, playerName)
- 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 affJoueur ( playerName, callback )
- aff["joueur"][playerName] = true
- c = 0
- for k, v in pairs ( parametreJ ) do
- c = c+1
- ui.addTextArea (c+3000, "<a href='event:"..k.."'>"..v.."</a>", playerName, 205, 30+35*c, 60, 20, 0x324650, 0x324650, 0.75, true)
- end
- end
- function effJoueur ( playerName )
- aff["joueur"][playerName] = false
- for k = c, 0, -1 do
- ui.removeTextArea( k+3000, 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 paraJGestion ( playerName, action )
- if action == "fromage" then
- tfm.exec.giveCheese ( playerName )
- elseif action == "ch" then
- tfm.exec.setShaman ( playerName )
- elseif action == "vampire" then
- tfm.exec.setVampirePlayer ( playerName )
- elseif action == "meep" then
- tfm.exec.giveMeep ( playerName )
- elseif action == "tuer" then
- tfm.exec.killPlayer ( playerName )
- elseif action == "rez" then
- tfm.exec.respawnPlayer ( playerName )
- elseif action == "win" then
- tfm.exec.giveCheese ( playerName )
- tfm.exec.playerVictory ( playerName )
- elseif action == "fly" then
- joueur[playerName]["fly"] = not joueur[playerName]["fly"]
- tfm.exec.bindKeyboard (playerName, 32, true, joueur[playerName]["fly"])
- if joueur[playerName]["fly"] then
- ui.addPopup (10, 3, "Você pode vuar, Apertando Espaço! :)", playerName, 400, 200, 220, true)
- else
- ui.addPopup (10, 3, "Você não pode vuar :(", playerName, 400, 200, 220, true)
- end
- elseif action == "tp" then
- joueur[playerName]["tp"] = not joueur[playerName]["tp"]
- system.bindMouse ( playerName, joueur[playerName]["tp"] )
- if joueur[playerName]["tp"] then
- ui.addPopup (10, 3, "Você pode Teleportar, Clique na tela :)", playerName, 400, 200, 200, true)
- else
- ui.addPopup (10, 3, "Você não pode Teleportar :(", playerName, 400, 200, 200, true)
- system.bindMouse ( playerName, joueur[playerName]["cham"] )
- end
- 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] = {}
- joueur[playerName]["fly"] = all["fly"]
- joueur[playerName]["tp"] = all["tp"]
- 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 eventKeyboard (playerName, keyCode, down, xPlayerPosition, yPlayerPosition)
- if keyCode == 32 then
- tfm.exec.movePlayer(playerName,0,0,true,0,-50,false)
- end
- end
- function eventMouse (playerName, x, y)
- if joueur[playerName]["cham"] then
- tfm.exec.addShamanObject (chamS, x, y, 0, 0, 0, false)
- chamS = -1
- joueur[playerName]["cham"] = false
- system.bindMouse (playerName, joueur[playerName]["tp"])
- else
- tfm.exec.movePlayer(playerName,x,y,false,0,0,true)
- 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