skydangerous

Untitled

Nov 16th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. local sky = {
  2.       level = 50, -- Level necessario que pode usar
  3.       preco = 10000, -- Preco para salvar o waypoint
  4.       tempo = 30,     -- O tempo que você usa-la novamente
  5.       storage = 5000, -- Não mecha
  6.       battle = true,   -- Se pode salvar com battle ou não
  7.       skull = true,
  8.       premmy = true
  9.      
  10. }
  11. -- Funcões para salvar a posição
  12. function doMarkPos(cid, posx, posy, posz)
  13.  
  14. setPlayerStorageValue(cid, 19000, posx)
  15. setPlayerStorageValue(cid, 19001, posy)
  16. setPlayerStorageValue(cid, 19002, posz)
  17. end
  18.  
  19. function getMarkPos(cid)
  20.  
  21. return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)}
  22. end
  23. -- Termina
  24.  
  25. --Comeco da talkaction
  26. function onSay(cid, words, param)
  27.   if getPlayerLevel(cid) < sky.level then
  28.                 return doPlayerSendCancel(cid, "Para usar o comando voce precissa"..configs.minLvL.." para usar.")
  29.     elseif not isPremium(cid) and sky.premmy then
  30.                 return doPlayerSendCancel(cid, "Apenas premmium account pode utilizar..")
  31.      elseif (sky.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
  32.                 return doPlayerSendCancel(cid,"Voce nao pode estar battle para usar o comando")      
  33.   end
  34.  
  35. local pos = getCreaturePosition(cid)
  36.  
  37.  if words == "!waypoint" then
  38.       if exhaustion.get(cid, sky.storage) == FALSE then
  39.         if getMarkPos(cid).x < 1 then
  40.          if getPlayerMoney(cid) >= sky.preco then            
  41.              doPlayerRemoveMoney(cid, sky.preco)  
  42.         exhaustion.make(cid, sky.storage, sky.tempo)
  43.         doMarkPos(cid, pos.x, pos.y, pos.z)
  44.           doPlayerSendTextMessage(cid, 4, "Você salvou posicao no mapa.")
  45.     else
  46.          doPlayerSendCancel(cid, "Você já gravou posição.")
  47.  end
  48.     else
  49.          doPlayerSendCancel(cid, "Voce nao tem dinheiro falta "..getPlayerMoney(cid) - sky.preco.." de dinheiro.")
  50.  end
  51.  
  52.     elseif words == "!back" then
  53.         if getMarkPos(cid).x > 0 then
  54.             doTeleportThing(cid, getMarkPos(cid))
  55.             doMarkPos(cid, 0, 0, 0)
  56.         else
  57.             doPlayerSendCancel(cid, "Você não gravou uma posição.")
  58. end
  59.      end
  60.  return TRUE
  61. end
  62.  end
  63.    
  64.  
Advertisement
Add Comment
Please, Sign In to add comment