skydangerous

Untitled

Nov 2nd, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.91 KB | None | 0 0
  1. local sky = {
  2.         pos = {{x = 1009,y = 1025,z=7},{x = 1009,y = 1026,z=7},{x = 1009,y = 1027,z=7},{x = 1009,y = 1028,z=7}},
  3.         level = {100,200,300,400},
  4.         fight = true,
  5.         dia = 2,
  6.         premium = true,
  7.         remover = true
  8.  
  9. }
  10. function onUse(cid, item, frompos, item2, topos)
  11. level = getPlayerLevel(cid)
  12.  if (sky.fight == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
  13.                 doPlayerSendTextMessage(cid,22,"Você Precisa estar sem battle para usar o item.")      
  14.                 return FALSE
  15.  elseif not isPremium(cid) and configs.premium then
  16.                 doPlayerSendCancel(cid, "Você precisa de premium account para usar o item.")
  17.                 return FALSE
  18.    
  19.         end
  20.         if (level <= sky.level[1] ) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) and (sky.remover) then
  21.                 doRemoveItem(item.uid, 1)
  22.                 doTeleportThing(cid,sky.pos[1])
  23.                 doPlayerAddPremiumDays(cid, 2)
  24.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  25.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")    
  26.                 setPlayerStorageValue(cid, 7000, os.time()+sky.dia*3600*24)
  27.         elseif (level <= sky.level[2]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0)  and (sky.remover) then
  28.                 doRemoveItem(item.uid, 1)
  29.                 doTeleportThing(cid,sky.pos[2)
  30.                 doPlayerAddPremiumDays(cid, 2)
  31.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  32.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
  33.                 setPlayerStorageValue(cid, 7000, os.time()+sky.dia*3600*24)
  34.         elseif (level <= sky.level[3]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) and (sky.remover) then
  35.                 doRemoveItem(item.uid, 1)
  36.                 doTeleportThing(cid,sky.pos[3])
  37.                 doPlayerAddPremiumDays(cid, 2)
  38.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  39.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
  40.                 setPlayerStorageValue(cid, 7000, os.time()+sky.dia*3600*24)
  41.          elseif (level >= sky.level[4]) and (item.itemid == 2177) and (getPlayerStorageValue(cid, 7000) <= 0) and (sky.remover) then
  42.                 doRemoveItem(item.uid, 1)
  43.                 doTeleportThing(cid,sky.pos[4])
  44.                 doPlayerAddPremiumDays(cid, 2)
  45.                 doSendMagicEffect(getPlayerPosition(cid), 10)
  46.                 doPlayerSendTextMessage(cid,22,"Voce foi teleportado para um lugar secreto.")
  47.                 setPlayerStorageValue(cid, 7000, os.time()+sky.dia*3600*24)
  48.        
  49.         hora = math.floor((getPlayerStorageValue(cid, 7000) - os.time())/(3600))
  50.         minuto = math.floor((getPlayerStorageValue(cid, 7000) - os.time())/(60))
  51.        
  52.         if hora >= 1 then          
  53.         doPlayerSendCancel(cid,25, "Voce nao pode usar o item so daqui "..(minuto < 0 and 0 or minuto).." minuto")
  54.         else
  55.         doPlayerSendTextMessage(cid, 25, "Nao tem level suficiente ou seu level e maior")
  56.         end
  57. end
  58.         end
  59.  
Add Comment
Please, Sign In to add comment