• 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!

Premium problem

wikutag

SoulBound 8.6 100% custom
Joined
Dec 27, 2012
Messages
305
Reaction score
0
Location
United states Kentucky
How I got this set up is they buy premium by !premium. It coast 10k a day. everything works but it just doesn't remove the days and I checked everywhere and idk why
This is all I have premium related

tfs 0.3.6 forgotten
config.lua
freePremium = false
removePremiumOnInit = true

talkactions
Code:
function onSay(cid, words, param)
    if getPlayerPremiumDays(cid) <= 100 then
local priceDay = 10000 -- 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 <= 100 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

Premium check
Code:
function onLogin(cid)
if getPlayerVipDays(cid) >= 1 then
doPlayerSetExperienceRate(cid, 1.15) -- 1.15 = +15% experience, change as you wish. Example: 2.0 = double exp
else
doPlayerSetExperienceRate(cid, 1.0) -- returns to normal rate when premium days expire
end
return true
end
 
This semm legit?
<globalevent name="premiumRemover" time="00:01" event="script" value="paccdaysremover.lua"/>

function onTimer()
db.executeQuery("UPDATE accounts SET premiumdays = premiumdays - 1 WHERE premiumdays > 0;")
return true
end
 
The vip days here are not the same as premium days. Premium days is something like in real tibia that is added by default. You need to be premium to do certain spells, get promotion etc.
Vip days are from the vip system, as extra besides normal premium.
 
[24/10/2014 00:01:00] mysql_real_query(): UPDATE accounts SET premiumdays = premiumdays - 1 WHERE premiumdays > 0; - MYSQL ERROR: Unknown column 'premiumdays' in 'where clause' (1054)

I have premium inside my character did I add it wrong?
 
[24/10/2014 00:01:00] mysql_real_query(): UPDATE accounts SET premiumdays = premiumdays - 1 WHERE premiumdays > 0; - MYSQL ERROR: Unknown column 'premiumdays' in 'where clause' (1054)

I have premium inside my character did I add it wrong?

Code:
ALTER TABLE accounts ADD premiumdays INT(11);
 

Similar threads

Back
Top