Advertisement
Eshkation-

Descubra a bandeira!

Jun 22nd, 2014
610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.49 KB | None | 0 0
  1. -- Wich flag?
  2. tfm.exec.disableAutoNewGame(true)
  3. tfm.exec.disableAutoShaman(true)
  4.  
  5. country = ""
  6. newRound = false
  7.  
  8. function newFlag()
  9. flags = {"BR","PT","FR","TR","AR","DE","AF","ZA","AL","AD","AZ","BS","NL","BO","CV","KM","ES"}
  10. countries = {"brasil","portugal","frança","turquia","argentina","alemanha","afeganistão","africa do sul","albania","andorra","azerbaijão","bahamas","belgica","holanda","bolivia","cabo verde","camboja","espanha"}
  11. ID = math.random(#flags)
  12. choosenFlag = flags[ID]
  13. country = countries[ID]
  14.  
  15. map = string.format('<C><P D="x_divers/x_drapeaux/%s.png,387,190" /><Z><S><S H="77" P="0,0,0.3,0.2,0,0,0,0" L="801" o="60606" X="399" Y="399" T="12" /><S H="10" P="0,0,0.3,0.2,0,0,0,0" L="60" o="60606" X="400" Y="225" T="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="60" o="60606" H="10" X="400" Y="175" T="12" /><S P="0,0,0.3,0.2,90,0,0,0" L="60" o="60606" H="10" X="425" Y="200" T="12" /><S P="0,0,0.3,0.2,90,0,0,0" L="60" o="60606" H="10" X="374" Y="200" T="12" /></S><D><DS Y="358" X="389" /></D><O /></Z></C>', choosenFlag)
  16. tfm.exec.newGame(map)
  17. tfm.exec.setUIMapName("Descubra o país!")
  18. end
  19.  
  20. function eventChatCommand(player,command)
  21.  
  22. if command == country and newRound == false then
  23.         tfm.exec.setUIMapName(string.format("%s descobriu a bandeira! Iniciando novo round!",player))
  24.         newRound = true
  25.         round = os.time()
  26. end
  27. end
  28.  
  29. function eventLoop()
  30. if newRound then
  31.         if round < os.time()-7000 then
  32.             newFlag()
  33.             round = os.time()
  34.             newRound = false
  35.         end
  36. end
  37. end
  38.  
  39. newFlag()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement