/data/creaturescripts/scripts/nomedoscript:
function doTeleport(uid) if(not isCreature(uid)) then return true end if(getPlayerStorageValue(cid, 667) == 2) then if(getPlayerStorageValue(cid, 666) - os.time() < 1) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, 667, 0) end end return addEvent(doTeleport, 5000, uid) end function onLogin(cid) if getPlayerStorageValue(cid, 666) - os.time() > 0 and getPlayerStorageValue(cid, 667) < 2 then setPlayerStorageValue(cid, 667, 2) end doTeleport(cid) return true end
tag:
<event type="login" name="vipEnd" event="script" value="nome.lua"/>




info
Grupo: Campones
Registrado: 30/05/13
Posts: 77
Reputação: +4
Olá galera o sky me ajudou com meu sistema de vip que é por storage, o god adiciona e tal, mas o problema é que acaba a vip e os caras ficam na area vip, teria como qnd acabar o tempo da storage o player ir para 100,100,7?
storage usada: 666
talkaction de dar vip:
function onSay(cid, words, param)
local storage,days,price = 666,3,2000
if getPlayerStorageValue(cid, storage) >= os.time() then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"você ainda tem storage até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,storage))..".") return true
elseif not doPlayerRemoveMoney(cid, price) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "você precisa de "..price.." gps para comprar "..days.." dias de storage.") return true
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"você comprou "..days.." dias de storage.")
setPlayerStorageValue(cid, storage, os.time()+days*86400)
return true
end