Nottinghster
Tibia World RPG Developer
- Joined
- Oct 24, 2007
- Messages
- 1,618
- Solutions
- 6
- Reaction score
- 537
- Location
- Brazil - Rio de Janeiro
- GitHub
- Nottinghster
Hello guys!
Can someone help me ?
I'll explain how it work:
If someone have theses storages values {30010,30011,30012,30013}, they can't buy premium days by this command:
And this is the code of Storages, but I don't know where to put to work
Thank you!
Can someone help me ?
I'll explain how it work:
If someone have theses storages values {30010,30011,30012,30013}, they can't buy premium days by this command:
Code:
function onSay(cid, words, param)
if getPlayerPremiumDays(cid) <= 365 then
local priceDay = 5000
if param == "" then
cost = priceDay
oneDay = 1
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddPremiumDays(cid, oneDay)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought one day of premium account. Please login again!")
else
doPlayerSendCancel(cid, "You don't have enough money.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
if getPlayerPremiumDays(cid) + param <= 365 then
local cost = param * priceDay
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddPremiumDays(cid, param)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought ".. param .." days of premium account. Please login again!")
else
doPlayerSendCancel(cid, "You don't have enough money.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
else
doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
And this is the code of Storages, but I don't know where to put to work
Code:
if getPlayerStorageValue(cid,30010) == 1 or getPlayerStorageValue(cid,30011) == 1 or getPlayerStorageValue(cid,30012) == 1 or getPlayerStorageValue(cid,30013) == 1 then
doPlayerSendCancel(cid, "You can not buy Premium Account if you donate.")
end
Thank you!