• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved [TFS 1.0] Premiumscroll error (supposed to give 30 points)

Napes

Owner of napes.se
Joined
May 11, 2014
Messages
63
Reaction score
2
Location
Sweden
Using TFS 1.0 & Znote AAC.

Error:
jSGbS3q.png


Code:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
local accountId = player:getAccountId()
db.query("UPDATE `znote_accounts` SET `points` = `points` + 30 WHERE `account_id` = " .. accountId)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been granted 30 shop credit to your account.")
player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_BLUE)
Item(item.uid):remove()
return true
end

Solved - correct code ^
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local accountId = player:getAccountId()
    db.query("UPDATE `znote_accounts` SET `points` = `points` + 30 WHERE `account_id` = " .. accountId)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been granted 30 shop credit to your account.")
    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_BLUE)
    Item(item.uid):remove()
    return true
end
 
Yeah and change accounts to znote_accounts
Lol, I thought I did that :P


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local accountId = player:getAccountId()
    db.query("UPDATE `znote_accounts` SET `points` = `points` + 30 WHERE `account_id` = " .. accountId)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been granted 30 shop credit to your account.")
    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_BLUE)
    Item(item.uid):remove()
    return true
end

Thanks @Ninja, works perfectly :)
 
Back
Top