• 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 Lua Scripts

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
Whats wrong with this code? Please help

Code:
  local accid = getAccountNumberByPlayerName(getPlayerName(cid))
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points`+2 WHERE `account_id` = " .. accid .. " LIMIT 1;")

TFS 1.0
 
Code:
local cfg =
{
  points = 25,
}
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. cfg.points .. " WHERE `account_id` = '" .. getAccountNumberByPlayerName(getCreatureName(itemEx.uid)) .. "' LIMIT 1;")

How about this?
 
Code:
local accid = Player(cid):getAccountId()
local points = 2
db.query("UPDATE `znote_accounts` SET `points` = `points` + " .. points .. " WHERE `account_id` = " .. accid)
 
Back
Top