Advertisement
Tectoon

[TFM] Galeria de Mapas V1.2

Oct 23rd, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.68 KB | None | 0 0
  1. admin =                 {       "Tectoon", "Theapps", "Sagazgamer" }
  2.  
  3. np= tfm.exec.disableAutoNewGame(true) or {"6417217","6415401","6414946","6414830,"6399152","6398045","6395534","6393592","6392584","6384038","6384010","6383942","6378096","6376011","6375526","6372293","6371998","6368222","6368140","6368111","6368059","6368031","6366608","6365172","6363815","6363607","6363386","6362517","6360872","6360773","6360739","6360719","6360663","6360479","6360252","6354900","6351808","6349964","6349395","6348132","6346991","6346869","6346742","6345470","6344065","6336477","6334798","6333921","6330200","6328559","6328836","6326217","6326606","6325859","6325562","6325211","6325136","6325085","6322362","6322250","6319922","6319728","6319563","6314111","6312154","6312114","6308190","6312087","6310523","6307111","6306640","6304783","6304385","6302959","6297832","6302510","6301908","6298836","6296970","6292887","6290162","6284568","6283405","6161725","6165177","6180458","6196366","6230154","6255153","6257005","6259602","5995085","5995046","5994770","5994649","5994622","5967199","5575612","5918795","5918734","5918730","5918729","5918728","5918714","5918713","5918710","5918709","5918707","5918705","5918704","5918701","5918698","5918694","5918691","5912390","5910657","5908444","5530649","5525574","5506111","5885173","5884932","5499479","5499388","5498342","5494330","5494247","5491284","5491215","5489772","5872118","5870159","5480487","5479269","5474247","5470929","5457988","5457493","5457390","5457222","5457184","5456392","5456192","5456179","5849744","5441190","5441184","5425900","5425772","5425771","5425689","5425674","5425667","5425658","5425648","5425639","5425618","5823509","5415934","5415814","5414578","5800128","5771238","5764777","5726733","5721894","5721064","5720967","5720727","5718523","5703048","5676461","5676150","5674069","5664668","5664429","5640125","5640123","5640121","5640116","5640110","5640108","5640106"}
  4.  
  5. function eventLoop(a, b)
  6.    local c= 0;
  7.    table.foreach(tfm.get.room.playerList, function(i,v) c= not v.isDead and c+1 or c end)
  8.    c= (c == 0 or b <=0) and tfm.exec.newGame(np[math.random(#np)]) or nil;
  9. end
  10.  
  11. eventLoop(0, 0)
  12.  
  13. mapHistory =    {       0       }
  14. nbMapL = 0
  15. nbMapH = 0
  16.  
  17. parametre =     {       ["Queijo para todos"] = false, ["Respawn auto"] = false, ["Shaman auto"] = true,
  18.  
  19.                                        ["Novo mapa auto"] = true, ["Tempo automático"] = true, ["Pontuação"] = true,
  20.                                        ["Morte de AFK"] = true,
  21.  
  22.                                        ["Todos de Vamp"] = false, ["Meep para todos"] =false, ["Todos Shaman"] = false,
  23.  
  24.                                        ["Habilidades"] = true , ["Tempo por partidas"] = 120
  25.  
  26.                                }
  27.  
  28.  
  29. aff =           {       lJoueurs = {} , joueur = {} , param = {} , param = {}
  30.                                }
  31. joueur =         {}
  32. dernierProfil = {}
  33.  
  34. for k, v in pairs (tfm.get.room.playerList) do
  35.                joueur[k] = {}  
  36. end
  37.  
  38. for k, pseudo in pairs(admin) do
  39.                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)
  40.                for l, m in pairs ( aff ) do
  41.                        aff[l][pseudo] = false
  42.  
  43.                end
  44. end
  45.  
  46. function eventTextAreaCallback(id, source, callback)
  47.  
  48.                if callback == 'parametre' then
  49.  
  50.                        if aff["param"][source] == false then
  51.                                affParam( source )
  52.                        else
  53.                                effParam( source )
  54.                        end
  55.  
  56.  
  57.                elseif parametre[callback] ~= nil then
  58.  
  59.                        paraGestion(callback,  source )
  60.                        ui.updateTextArea (id, callback .. ": <a href='event:" .. callback .. "'>" .. B(parametre[callback]) .. "</a>", source )
  61.                end
  62.  
  63. end
  64.  
  65.  
  66.  
  67. function eventPopupAnswer (id, playerName, answer)
  68.  
  69.                if id == 3 then
  70.  
  71.                        parametre["Tempo por partidas"] = answer  
  72.  
  73.                end
  74. end
  75.  
  76. function affParam(playerName)
  77.                aff["param"][playerName] = true
  78.                if aff["lJoueurs"][playerName] then
  79.                        effLJoueurs ( playerName )
  80.                end
  81.  
  82.  
  83.                b=0
  84.                for k, v in pairs(parametre) do
  85.                        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)
  86.  
  87.                        b=b+1
  88.                end
  89. end
  90.  
  91.  
  92. function effParam(playerName)
  93.                aff["param"][playerName] = false
  94.                for k=b,0,-1 do
  95.                        ui.removeTextArea(k+2000, playerName)
  96.                end
  97. end
  98.  
  99. function B(v)
  100.                if type(v) == "boolean" then
  101.                        if v==true then
  102.                                return "<v><b>true</b></v>"
  103.                        else
  104.                                return "<r><b>false</b></r>"
  105.                        end
  106.                else
  107.                        return "<b>  "..v.."  </b>"
  108.                end
  109. end
  110.  
  111.  
  112. function paraGestion ( paraModif , playerName)
  113.  
  114.                if type(parametre[paraModif]) == "boolean" then
  115.                        parametre[paraModif] = not parametre[paraModif]
  116.                end
  117.  
  118.  
  119.                if paraModif == "Queijo para todos" and parametre[paraModif] then
  120.                        for k, v in pairs (joueur) do
  121.                                tfm.exec.giveCheese ( k )
  122.                        end
  123.                elseif paraModif == "Respawn auto" and parametre[paraModif] then
  124.                        for k, v in pairs (joueur) do
  125.                                tfm.exec.respawnPlayer ( k )
  126.                        end
  127.  
  128.  
  129.  
  130.                elseif paraModif == "Shaman auto" then
  131.                        tfm.exec.disableAutoShaman( not parametre[paraModif] )
  132.                elseif paraModif == "Novo mapa auto" then
  133.                        tfm.exec.disableAutoNewGame ( not parametre[paraModif] )
  134.                elseif paraModif == "Tempo automático" then
  135.                        tfm.exec.disableAutoTimeLeft ( not parametre[paraModif] )
  136.                elseif paraModif == "Pontuação" then
  137.                        tfm.exec.disableAutoScore ( not parametre[paraModif] )
  138.                elseif paraModif == "Morte de AFK" then
  139.                        tfm.exec.disableAfkDeath ( not parametre[paraModif] )
  140.                elseif paraModif == "Tempo por partidas" then
  141.                        ui.addPopup (3, 2, "enter default map time", playerName, 200, 200, 150, true)
  142.  
  143.  
  144.                elseif paraModif == "Todos de Vamp" and parametre[paraModif] then
  145.                        for k, v in pairs ( joueur ) do
  146.                                tfm.exec.setVampirePlayer ( k )
  147.                        end
  148.                elseif paraModif == "Meep para todos" and parametre[paraModif] then
  149.                        for k, v in pairs ( joueur ) do
  150.                                tfm.exec.giveMeep ( k )
  151.                        end
  152.                elseif paraModif == "Todos Shaman" and parametre[paraModif] then
  153.                        for k, v in pairs ( joueur ) do
  154.                                tfm.exec.setShaman ( k )
  155.                        end
  156.  
  157.  
  158.                elseif paraModif == "Habilidades" then
  159.                        tfm.exec.disableAllShamanSkills ( not parametre[paraModif] )
  160.                end
  161.  
  162.  
  163.  
  164.  
  165.  
  166. end
  167.  
  168. function mapGestion (action)
  169.                if action == 'random' then
  170.                        nbMapL = math.random(#mapList)
  171.                        tfm.exec.newGame(mapList[nbMapL])
  172.  
  173.                elseif action == 'repeat' then
  174.                        tfm.exec.newGame(tfm.get.room.currentMap)
  175.  
  176.                else
  177.                        if action == '-1' and (nbMapL + action) > 0 then
  178.                                nbMapL = nbMapL -1
  179.                                tfm.exec.newGame ( mapList[nbMapL] )
  180.  
  181.                        elseif action == '+1' and (nbMapL + action) <= #mapList then
  182.                                nbMapL = nbMapL + 1
  183.                                tfm.exec.newGame ( mapList[nbMapL] )
  184.                end
  185.                end
  186. end
  187.  
  188.  
  189.  
  190.  
  191. function eventNewPlayer ( playerName )
  192.  
  193.                print ( playerName .. " vient d'entrer dans le salon \o/" )
  194.                joueur[playerName] = {}
  195.  
  196.                if parametre["Respawn auto"] then
  197.                        tfm.exec.respawnPlayer ( playerName )
  198.                end
  199.  
  200. end
  201.  
  202. function eventPlayerLeft ( playerName )
  203.  
  204.                print ( playerName.. " vient de quitter le salon :(" )
  205.                joueur[playerName] = nil
  206.  
  207. end
  208.  
  209. function eventPlayerDied ( playerName )
  210.  
  211.  
  212.                if parametre["Respawn auto"] then
  213.                        tfm.exec.respawnPlayer ( playerName )
  214.                end
  215.  
  216. end
  217.  
  218.  
  219. function eventPlayerWon ( playerName )
  220.  
  221.                if parametre["Respawn auto"] then
  222.  
  223.                        tfm.exec.respawnPlayer ( playerName )
  224.                end
  225. end
  226.  
  227.  
  228.  
  229. function eventNewGame ()
  230.  
  231.                if tfm.get.room.currentMap ~= mapHistory[nbMap] then
  232.  
  233.                        nbMapH = nbMapH
  234.                        mapHistory[nbMapH] = tfm.get.room.currentMap
  235.                end
  236.  
  237.                tfm.exec.setGameTime ( parametre["Tempo por partidas"] )
  238.                 tfm.exec.setUIMapName("<J>"..tfm.get.room.xmlMapInfo.author.." <N>- <BL>@"..tfm.get.room.xmlMapInfo.mapCode.." <N>- <n>Galeria de Mapas")
  239.  
  240.                for k, v in pairs ( joueur ) do
  241.                        eventPlayerRespawn ( k )
  242.                end
  243.  
  244. end
  245.  
  246.  
  247.  
  248. function eventPlayerRespawn ( playerName )
  249.  
  250.                if parametre["Queijo para todos"] then
  251.                        tfm.exec.giveCheese ( playerName )
  252.                end
  253.                if parametre["Todos Shaman"] then
  254.                        tfm.exec.setShaman ( playerName )
  255.                end
  256.                if parametre["Todos de Vamp"] then
  257.                        tfm.exec.setVampirePlayer ( playerName )
  258.                end
  259.                if parametre["Meep para todos"] then
  260.                        tfm.exec.giveMeep ( playerName )
  261.                end
  262. end
  263.  
  264. function isAdmin ( name )
  265.                for k, v in pairs( admin ) do
  266.                        if name == v then
  267.                                return true
  268.                        end
  269.                end
  270.                return false
  271. end
  272.  
  273. print("<J> Script<ch> ON")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement