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

[db.query] How can i add "honor" points to database?

T

tejdi

Guest
Hello i want to add "honor points" to my server, so:
1. I added this:
Code:
     `honor` INT NOT NULL DEFAULT 0,
to my mysql.sql
2. I added this to my quest:
Code:
 db.query("UPDATE `players` SET `honor` = 10")
but it's giving honor for all players on the server. when i want add for only one who is making quest, can somebody say me how can i do it? Thanks :)
 
050-function.lua
Code:
function doPlayerAddHonorPoints(cid, points)
return db.executeQuery("UPDATE `accounts` SET `honor` = `honor` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

In your quest LUA:
Code:
doPlayerAddHonorPoints(cid, amount)
 
Back
Top