• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TalkActions] Advanced premium system

Delvire

°£°
Joined
Feb 24, 2008
Messages
236
Reaction score
9
Hello, people from OtLand, here is my question:

I want to make a better premium system, where the P.A price increases a bit by each level, It's like the new blessing system.
So, for example:

Level 1 to 30 - 8k
Level 31 - 9K
Level 32 - 10K
Level 33 - 11K
Level 34 - 12K
Level 35 - 13K
.
.
.
etc...

Is this possible?
 
Try this one:
Code:
local config = {
	levelMax = 30,
	price = 8000,
	priceAdd = 1000,
	days = 7
}

function onSay(cid, words, param)
	local price = config.price
	local level = getPlayerLevel(cid)
	if level > config.levelMax then
		for i = 1, level - config.levelMax do
			price = price + config.priceAdd
		end
	end
	
	if doPlayerRemoveMoney(cid, price) == TRUE then
		doPlayerAddPremiumDays(cid, config.days)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
	else
		doPlayerSendCancel(cid, "You do not have enough money.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	
	return TRUE
end
 
I see that you already got a script, but I want to release my version. ^^

You say /addpremium "Noobie, 40", and the player Noobie will get 40 premium days. Of course you pay if you give anyone else premium days. You can also write /addpremium and I will work as any other premium script. Enjoy. :)

Code:
function onSay(cid, words, param)
local costDay = 1200 --Price per premium day, 0 = free.
local autoDays = 30 --This amount of days will automatically be added if the the player didn't write to who he wants to add premium points
    if(param == "") then
        addPrem(cid, autoDays, costDay, cid)
        return TRUE
    end
   
    local t = string.explode(param, ", ")
    local days = autoDays
    if t[2] ~= nil then
        days = t[2]
    end

    local name = t[1]
    local player = getPlayerByName(name)
    if player == LUA_ERROR or getPlayerName(player) == LUA_ERROR then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "No player with that name is online.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return TRUE
    end
    addPrem(player, days, costDay, cid)
return TRUE
end

function addPrem(cid, days, cost, payer)
    if getPlayerPremiumDays(cid) <= 365 then
        if doPlayerRemoveMoney(payer, (cost*days)) == TRUE then
            doPlayerAddPremiumDays(cid, 30)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have now ".. days .." more days of premium account.")
            doSendMagicEffect(getPlayerPosition(payer), 10)
        else
            doPlayerSendCancel(payer, "You don't have enough money, ".. days .." days premium account costs ".. cost*days .." gold coins.")
            doSendMagicEffect(getPlayerPosition(payer), CONST_ME_POFF)
        end
    else
        doPlayerSendCancel(payer, "You can not buy more than one year of Premium Account.")
        doSendMagicEffect(getPlayerPosition(payer), CONST_ME_POFF)
    end
end
 
Back
Top