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

help me add premium

megazx

Graphic designer
Joined
Mar 4, 2013
Messages
444
Solutions
2
Reaction score
32
Location
Egypt
i use this script to add free points to players at levels
PHP:
	<event type="advance" name="points" event="script" value="points.lua"/>

and this in login
PHP:
registerCreatureEvent(cid,'points')

registerCreatureEvent(cid, "ReportBug")








PHP:
local t, storage = {
	{200, 5}
}, 256
 
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= SKILL__LEVEL then
        return true
    end
    for i = 1, #t do
        local v = t[i]
        if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then
            db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
            doCreatureSetStorage(cid, storage, i)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have recived '.. v[2] ..' Premium Points!')
			doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' Advenced To LeveL ' .. v[1] .. ' And Got ' .. v[2] .. ' Premium Points.')
        end
    end
    return true
end


but i have error in consol say that i dont have premium_point table in data base mysql
 
SQL:
ALTER TABLE `accounts` ADD `premium_points` INT(11) NOT NULL DEFAULT 0;
 
Back
Top