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

Solved How to connect ingame store balance to webpage points balance.

Majster12

Member
Joined
Feb 20, 2009
Messages
134
Solutions
1
Reaction score
16
Any ideas?
9K80cER.png

mnS5R6G.png


Solved.

Code:
function Player.getCoinsBalance(self)
    resultId = db.storeQuery("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. self:getAccountId())
    if not resultId then return 0 end
    return result.getDataInt(resultId, "premium_points")
end
function Player.setCoinsBalance(self, coins)
    db.asyncQuery("UPDATE `accounts` SET `premium_points` = " .. coins .. " WHERE `id` = " .. self:getAccountId())
    return true
end
 
Last edited:
Back
Top Bottom