Advertisement
Guest User

ERRO TEAM BATTLE

a guest
Oct 25th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. --[[
  2.  
  3. Real Team Battle Event
  4. Desenvolvido por VΓ­tor Bertolucci (Killua)
  5.  
  6. ]]
  7.  
  8. function onCombat(cid, target)
  9. if isPlayer(cid) and isPlayer(target) then
  10. local sto = getPlayerStorageValue(cid, realTeamBattle.teamStorage)
  11. if sto > 0 then
  12. if sto == getPlayerStorageValue(target, realTeamBattle.teamStorage) then
  13. return false
  14. end
  15. end
  16. end
  17. return true
  18. end
  19.  
  20. function onTarget(cid, target)
  21. if isPlayer(cid) and isPlayer(target) then
  22. local sto = getPlayerStorageValue(cid, realTeamBattle.teamStorage)
  23. if sto > 0 then
  24. if sto == getPlayerStorageValue(target, realTeamBattle.teamStorage) then
  25. doPlayerSendCancel(cid,"VocΓͺ nΓ£o pode atacar seu companheiro de time.")
  26. return false
  27. end
  28. end
  29. end
  30. return true
  31. end
  32.  
  33. function onPrepareDeath(cid, deathList)
  34. if isPlayer(cid) then
  35. local sto = getPlayerStorageValue(cid,realTeamBattle.teamStorage)
  36. if sto > 0 then
  37. local times = {"Red Assassins", "Blue Norsemen", "Black Hunters", "Green Beggars"}
  38. realTeamBattle.broadcast(MESSAGE_STATUS_CONSOLE_ORANGE,"[Team Battle] O jogador "..getCreatureName(cid).." do time "..times[sto].." foi morto!")
  39. doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"[Team Battle] You are dead!")
  40. realTeamBattle.cleanPlayer(cid)
  41. realTeamBattle.checkTeams()
  42. end
  43. end
  44. return true
  45. end
  46.  
  47. function onLogin(cid)
  48. doPlayerSetStorageValue(cid, realTeamBattle.teamStorage,-1)
  49. registerCreatureEvent(cid, "realTeamBattleDeath")
  50. registerCreatureEvent(cid, "realTeamBattleCombat")
  51. registerCreatureEvent(cid, "realTeamBattleTarget")
  52. return true
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement