Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = { "Pseudo", "Pseudo", "Pseudo" } -- Remplacez "Pseudo" par "Votre pseudo"
- mapList = { "@277994", "@2119048", "@3014000", "@3471523", "@4087743",
- "@3998852", "@3997006", "@423670", "@4672806", "@3758121",
- "@4160083", "@4057776", "@825035", "@469280", "@1081762",
- "@1933292", "@2734103", "@204059", "@251430", "@3464359",
- "@2746128", "@523865", "@3296031", "@3630912", "@1474189",
- } -- Pour ajouter vos maps : ,"@code1", "@code2"
- --------------------------------------
- -- Évitez de toucher à ce qui suit --
- --------------------------------------
- mapHistory = { 0 }
- nbMap = 0
- parametre = { autoCheese = false, autoRez = false, autoSham = true,
- autoNewGame = true, autoTimeLeft = true, autoScore = true,
- afkDeath = true,
- allVamp = false, allMeep =false, allSham = false,
- shamSkill = true , mapTime = 120
- }
- parametreJ = { sham="sham", cheese="cheese", vampire="vampire",
- meep="meep", kill="kill", respawn="respawn", win="win",
- fly="fly", tp="tp"
- }
- aff = { lJoueurs ={} , joueur = {} , param = {}
- }
- 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
- 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, 0x324650, 0x324650, 1, true)
- ui.addTextArea (2, "<p align='center'><b><a href='event:joueurs'>joueurs</a></b></p>", pseudo, 110, 30, 80, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea (3, "<p align='center'><b><a href='event:parametre'>paramètres</a></b></p>", pseudo, 205, 30, 80, 20, 0x324650, 0x324650, 1, true)
- ui.addTextArea (4, "<p align='center'><b><a href='event:map'>map</a></b></p>", pseudo, 10, 30, 35, 20, 0x324650, 0x324650, 1, 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, 300, 30, 120, 20, 0,0,1, 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, "time to set", source, 10, 70, 150, true)
- elseif callback == 'map' then
- ui.addPopup (1, 2, "map to play", 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 == "all" 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)
- 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["mapTime"] = answer
- 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'>all</a></p>", playerName, 110, 65, 80, 20, 0x324650, 0x324650, 1, 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, 1, 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+150*((b-b%6)/6), 65+35*(b % 6), 135, 20, 0x324650, 0x324650, 1, 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:"..v.."'>"..v.."</a>", playerName, 205, 30+35*c, 60, 20, 0x324650, 0x324650, 1, 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 == "autoCheese" and parametre[paraModif] then
- for k, v in pairs (joueur) do
- tfm.exec.giveCheese ( k )
- end
- elseif paraModif == "autoRez" and parametre[paraModif] then
- for k, v in pairs (joueur) do
- tfm.exec.respawnPlayer ( k )
- end
- elseif paraModif == "autoSham" then
- tfm.exec.disableAutoShaman( not parametre[paraModif] )
- elseif paraModif == "autoNewGame" then
- tfm.exec.disableAutoNewGame ( not parametre[paraModif] )
- elseif paraModif == "autoTimeLeft" then
- tfm.exec.disableAutoTimeLeft ( not parametre[paraModif] )
- elseif paraModif == "autoScore" then
- tfm.exec.disableAutoScore ( not parametre[paraModif] )
- elseif paraModif == "afkDeath" then
- tfm.exec.disableAfkDeath ( not parametre[paraModif] )
- elseif paraModif == "mapTime" then
- ui.addPopup (3, 2, "enter default map time", playerName, 200, 200, 150, true)
- elseif paraModif == "allVamp" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.setVampirePlayer ( k )
- end
- elseif paraModif == "allMeep" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.giveMeep ( k )
- end
- elseif paraModif == "allSham" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.setShaman ( k )
- end
- elseif paraModif == "shamSkill" then
- tfm.exec.disableAllShamanSkills ( not parametre[paraModif] )
- end
- end
- function paraJGestion ( playerName, action )
- if action == "cheese" then
- tfm.exec.giveCheese ( playerName )
- elseif action == "sham" then
- tfm.exec.setShaman ( playerName )
- elseif action == "vampire" then
- tfm.exec.setVampirePlayer ( playerName )
- elseif action == "meep" then
- tfm.exec.giveMeep ( playerName )
- elseif action == "kill" then
- tfm.exec.killPlayer ( playerName )
- elseif action == "respawn" 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, "Tu peux voler, appuie sur espace :)", playerName, 400, 200, 220, true)
- else
- ui.addPopup (10, 3, "Tu ne peux plus voler :(", 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, "Tu peux te téléporter, cli clic :)", playerName, 400, 200, 200, true)
- else
- ui.addPopup (10, 3, "Tu ne peux plus te téléporter :(", playerName, 400, 200, 200, true)
- end
- end
- end
- function mapGestion (action)
- if action == 'random' then
- tfm.exec.newGame(mapList[math.random(#mapList)])
- elseif action == 'repeat' then
- tfm.exec.newGame(tfm.get.room.currentMap)
- elseif action == '-1' and (nbMap + action) > 0 then
- nbMap = nbMap + action
- tfm.exec.newGame ( mapHistory[nbMap] )
- elseif action == '+1' and (nbMap + action) < #mapHistory then
- nbMap = nbMap + action
- tfm.exec.newGame ( mapHistory[nbMap] )
- 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["autoRez"] 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["autoRez"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventPlayerWon ( playerName )
- if parametre["autoRez"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventNewGame ()
- if tfm.get.room.currentMap ~= mapHistory[nbMap] then
- nbMap = nbMap+1
- mapHistory[nbMap] = tfm.get.room.currentMap
- end
- tfm.exec.setGameTime ( parametre["mapTime"] )
- for k, v in pairs ( joueur ) do
- eventPlayerRespawn ( k )
- end
- end
- function eventPlayerRespawn ( playerName )
- if parametre["autoCheese"] then
- tfm.exec.giveCheese ( playerName )
- end
- if parametre["allSham"] then
- tfm.exec.setShaman ( playerName )
- end
- if parametre["allVamp"] then
- tfm.exec.setVampirePlayer ( playerName )
- end
- if parametre["allMeep"] 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, xMousePosition, yMousePosition)
- tfm.exec.movePlayer(playerName,xMousePosition,yMousePosition,false,0,0,true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement