• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction !buypremium "Days

tatu hunter

Insane Mind~
Joined
Jun 6, 2007
Messages
354
Reaction score
23
Location
Itaporã, Brazil
Hello, I made some changes in the buyprem of forgotten server and I think its more better ;P

go to data/talkactions/buyprem.lua and replace with this one:
Code:
function onSay(cid, words, param)
    if getPlayerPremiumDays(cid) <= 365 then
        --- Config here the price per day
        local priceDay = 2000 -- Price per Day
        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.")
            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.")
            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
To buy premium just type:
!buypremium "5
5 is the days of premium you will buy, just change the number.
I hope someone like it ;P

Edit...
Bugs Fixed thx to babalow
 
Last edited:
oh nice idea =]

but it don't work if you say '!buypremium' without param

i changed somethings to work

Code:
function onSay(cid, words, param)
    if getPlayerPremiumDays(cid) <= 365 then
local priceDay = 2000 -- Price per Day
        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.")
            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.")
            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 yeah .. rep ++ =]
 
Last edited:
Nice Script

Lua:
local priceDay = 2000 -- Price per Day
function onSay(cid, words, param)
    if getPlayerPremiumDays(cid) <= 365 then
        if param == "" then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not a valid param.")
	return TRUE
	end
        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.")
            else
                doPlayerSendCancel(cid, "You don't have enough money.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            end
        else
            doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        end   
    else
        doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
    return TRUE
end
 
Go go go, do 500 re-scripts... There's easiest way to make it shorter ;)
 
Back
Top