Sistema:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}
local days = 30 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local str = 13550
local storageplayer = getPlayerStorageValue(cid, 13540)
local timenow = os.time()
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados 30 dias de VIP no seu character.")
setPlayerStorageValue(cid, 13540, time)
local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
setPlayerStorageValue(cid, str, 0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem 30 dias de VIP restantes.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
doRemoveCreature(cid)
end
return true
end
FimVip:
local default, str = 1, 13550 -- default town id / str function onLogin(cid) if getPlayerName(cid) == 'Account Manager' then return true end local timenow = os.time() local diasVip = math.floor((getPlayerStorageValue(cid, 13540) - timenow) / (3600 * 24)) if diasVip == 0 and getPlayerStorageValue(cid, str) == 0 then doPlayerSetTown(cid, default) doTeleportThing(cid, getTownTemplePosition(default)) setPlayerStorageValue(cid, str, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerPopupFYI(cid, "Sua vip Account acabou.") end return true end
EfeitoVip:
local effect = 27 -- Efeito que vai usar local storage = 13540 -- Storage que o player precisa ter local tempo = 7 -- Tempo em segundos function onLogin(cid) if getPlayerStorageValue(cid, storage) - os.time() >= 1 then SendEffect(cid) end return true end function SendEffect(cid) if not isPlayer(cid) or getPlayerStorageValue(cid, storage) - os.time() <= 0 then return false end doSendMagicEffect(getCreaturePosition(cid), effect) doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED) addEvent(SendEffect, tempo * 1000, cid) return true end




info
Grupo: Artesão
Registrado: 13/07/11
Posts: 104
Reputação: +4
Char no Tibia: Willliam Serravalle
Bom dia galera do Tk estou com um pequeno erro aki no meu endvip e efeitovip.
quando o player compra vip ele e relogado e ganha um efeito que fica saindo de cima dele dizendo que ele e vip , mas quando a vip do player acaba esse efeito nao sai ele continua e o endvip nao ta funcionando ele nao teleporta o player caso a vip do player acabe.
Agradecido desde de ja
System vip
function onUse(cid, item, fromPosition, itemEx, toPosition)
end
Endvip
local key = {13540, 13550} -- storages
end
Efeitovip
local effect = 27 -- Efeito que vai usar
end
#UP