1
[Pedido] Talkaction que otorgue storage el Sáb Oct 13, 2018 5:57 pm
ElementRey

Nuevo Miembro

Espero que me puedan ayudar
Gracias
Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...
function onSay(cid, words, param, channel)
local days = 1 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 3000)
local timenow = os.time()
if getPlayerStorageValue(cid, 3000) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 3000, time)
local quantity = math.floor((getPlayerStorageValue(cid, 3000) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
return TRUE
end
function onSay(cid, words, param, channel)
if(getPlayerStorageValue(cid, 3000) ~= -1) then
doPlayerSendTextMessage(cid, 22, "Your vip time is: " .. math.ceil((getPlayerStorageValue(cid, 3000) - os.time())/(24 * 60 * 60)) .. " days.")
else
doPlayerSendTextMessage(cid, 22, "Sorry, you are not vip account.")
end
return TRUE
end
[Tienes que estar registrado y conectado para ver este vínculo] escribió:Bro ese talkaction si me funciono pero como puedo hacer para que cobre cierta cantidad de algún item?
function onSay(cid, words, param, channel)
local days = 1 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 3000)
local timenow = os.time()
if getPlayerItemCount(cid, 7634) >= 100 then
doPlayerRemoveItem(cid, 7634, 100)
if getPlayerStorageValue(cid, 3000) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 3000, time)
local quantity = math.floor((getPlayerStorageValue(cid, 3000) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
else
doPlayerSendCancel(cid, "You dont have 100 empty potion flasks!")
end
return TRUE
end
TibiaFace » Descargas de Otserv y Ayuda » Pedidos de Scripts » [Pedido] Talkaction que otorgue storage
Permisos de este foro:
No puedes responder a temas en este foro.
|
|