Tectoon

[TFM] Modo Mulodrome (Período de Teste)

Aug 4th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. azul={[[JOGADORES DO AZUL = true]]}
  2. vermelho={[[JOGADORES DO VERMELHO = true]]}
  3. tfm.exec.disableAfkDeath(true)
  4. pontoazul=0;
  5. pontoverm=0;
  6. rod=0;
  7. pos=0;
  8. vivo=0;
  9. tfm.exec.disableAutoNewGame(true)
  10. tfm.exec.disableAutoShaman(true)
  11. tfm.exec.disableAutoScore(true)
  12. system.disableChatCommandDisplay("tempo", true)
  13. system.disableChatCommandDisplay("resetrod", true)
  14. system.disableChatCommandDisplay("rod10", true)
  15. mapas={"1", "2", "6", "8", "14", "11", "19", "22", "55", "122", "121", "123", "70", "27", "28", "29", "@201606", "@191070", "@3637041", "@1162611", "@178657", "@1506007", "@2106576"}
  16. function eventNewGame()
  17.     rod=rod+1;
  18.     pos=0;
  19.     vivo=0;
  20.     vrod10(rod)
  21.     tfm.exec.setGameTime(45)
  22.     if rod == 1 and pontoazul > pontoverm then
  23.         ui.addPopup(0, 0, "Parabéns, equipe azul! Você venceu com "..pontoazul.." pontos!", NIL, 350, 30, 200, true)
  24.     elseif rod == 1 and pontoverm > pontoazul then
  25.         ui.addPopup(0, 0, "Parabéns, equipe vermelha! Você venceu com "..pontoverm.." pontos!", NIL, 350, 30, 200, true)
  26.     end
  27.     if vermelho[playerName] == true then
  28.         tfm.exec.setNameColor(playerName, 0xff0000)
  29.     elseif azul[playerName] == true then
  30.         tfm.exec.setNameColor(playerName, 0x0080ff)
  31.     end
  32.     for name,player in pairs(tfm.get.room.playerList) do
  33.         vivo=vivo+1
  34.     end
  35. end
  36. function vrod10()
  37.     if rod== 11 then
  38.         rod=1;
  39.     end
  40. end
  41. function nextRound()
  42.     tfm.exec.newGame(mapas[math.random(#mapas)]);
  43.    
  44. end  
  45. function eventLoop(tempoPassado, tempoFaltando)
  46.     if vivo == 0 or tempoFaltando <= 200 then
  47.         nextRound();
  48.     end
  49.     tfm.exec.setUIMapName("<CH>Rodada: <V>"..rod.."/10 <BL> |  <CH>Placar: <BL>"..pontoazul.." <J>X <R>"..pontoverm.."<BL>")
  50.     if tempoFaltando >= 35000 and tempoFaltando <= 36000 and rod == 1 then
  51.         pontoazul=0;
  52.         pontoverm=0;
  53.         for name,player in pairs(tfm.get.room.playerList) do
  54.             tfm.exec.setPlayerScore(name,0,false)
  55.         end
  56.     end
  57. end
  58. nextRound();
  59. function eventChatCommand(playerName,message)
  60.     if message== "tempo" then
  61.         ui.addPopup(0, 2, "Digite o tempo:", playerName, 350, 175, 100)
  62.     end
  63.     if message== "resetrod" then
  64.         rod=0;
  65.         tfm.exec.newGame(mapas[math.random(#mapas)]);
  66.     end
  67.     if message== "rod10" then
  68.         rod=9;
  69.         tfm.exec.newGame(mapas[math.random(#mapas)]);
  70.     end
  71. end
  72. function eventPopupAnswer(id, player, answer)
  73.     if id == 0 then
  74.         tempo=answer
  75.     end
  76. end
  77. function eventPlayerWon(playerName)
  78.         pos=pos+1
  79.         vivo=vivo-1
  80.         if azul[playerName] == true then
  81.             if pos == 1 then
  82.                 pontoazul=pontoazul+5
  83.                 tfm.exec.setPlayerScore(playerName,5,true)
  84.             elseif pos == 2 then
  85.                 pontoazul=pontoazul+4
  86.                 tfm.exec.setPlayerScore(playerName,4,true)
  87.             elseif pos == 3 then
  88.                 pontoazul=pontoazul+3
  89.                 tfm.exec.setPlayerScore(playerName,3,true)
  90.             elseif pos == 4 then
  91.                 pontoazul=pontoazul+2
  92.                 tfm.exec.setPlayerScore(playerName,2,true)
  93.             else
  94.                 pontoazul=pontoazul+1
  95.                 tfm.exec.setPlayerScore(playerName,1,true)
  96.             end
  97.         end
  98.         if vermelho[playerName] == true then
  99.             if pos == 1 then
  100.                 pontoverm=pontoverm+5
  101.                 tfm.exec.setPlayerScore(playerName,5,true)
  102.             elseif pos == 2 then
  103.                 pontoverm=pontoverm+4
  104.                 tfm.exec.setPlayerScore(playerName,4,true)
  105.             elseif pos == 3 then
  106.                 pontoverm=pontoverm+3
  107.                 tfm.exec.setPlayerScore(playerName,3,true)
  108.             elseif pos == 4 then
  109.                 pontoverm=pontoverm+2
  110.                 tfm.exec.setPlayerScore(playerName,2,true)
  111.             else
  112.                 pontoverm=pontoverm+1
  113.                 tfm.exec.setPlayerScore(playerName,1,true)
  114.             end
  115.         end
  116. end
  117. function eventPlayerDied(p)
  118.     vivo=vivo-1
  119. end
  120. for name,player in pairs(tfm.get.room.playerList) do
  121.         vivo=vivo+1
  122.         tfm.exec.setPlayerScore(name,0,false)
  123. end
Advertisement
Add Comment
Please, Sign In to add comment