Nottinghster
Tibia World RPG Developer
- Joined
- Oct 24, 2007
- Messages
- 1,575
- Solutions
- 6
- Reaction score
- 438
- Location
- Brazil - Rio de Janeiro
- GitHub
- Nottinghster
If someone need it, here's the buypremium talkaction 100% working (tested) and script shortened
Code:
function onSay(cid, words, param)
if param == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to type the parameter.")
return true
end
if getPlayerPremiumDays(cid) > 365 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not buy more than one year of Premium Account.")
return true
end
local dias, preco = tonumber(param), 1000
if doPlayerRemoveMoney(cid, dias * preco) then
doPlayerAddPremiumDays(cid, dias)
if dias > 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought ".. dias .." days of premium account. Please login again!")
elseif dias == 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parameter must be higher than 0.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought ".. dias .." day of premium account. Please login again!")
end
end
return true
end