<talkaction words="!buypremium" event="script" value="buypremium.lua"/>
local config = {
days = 90,
cost = 10000,
maxDays = 360
}
function onSay(cid, words, param, channel)
if(getPlayerPremiumDays(cid) > config.maxDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
if(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then
doPlayerSendCancel(cid, "You don't have enough money, " .. config.days .. " days premium account costs " .. config.cost .. " gold coins.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
doPlayerAddPremiumDays(cid, config.days)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.")
return TRUE
end
XML:
LUA:<talkaction words="!buypremium" event="script" value="buypremium.lua"/>
Script:
LUA:local config = { days = 90, cost = 10000, maxDays = 360 } function onSay(cid, words, param, channel) if(getPlayerPremiumDays(cid) > config.maxDays) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end if(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then doPlayerSendCancel(cid, "You don't have enough money, " .. config.days .. " days premium account costs " .. config.cost .. " gold coins.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end doPlayerAddPremiumDays(cid, config.days) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.") return TRUE end
Anyone got a premium NPC that they have tested on the newest TFS? I'd be glad if you posted it here.
Yours, Empty
This is from July 8th 2007.
(Back when Empty was a nooby) :thumbup:
Edit:
I felt bad that no one replied to it, all these years.
So I replied xd