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

AAC Znote Acc - problem with premium points rune

polileusz

New Member
Joined
Feb 18, 2010
Messages
14
Reaction score
1
Hello lovely people

Me and my friend are trying to solve this problem without any luck :/

We made a premium point rune, that will add 10 points. Sadly, it won't show up on website (stays 0 all the time)

Are you able to help us in asyway?
 
Solution
Make sure that the user created their account with Znote AAC (and has an entry in znote_accounts table). Sometimes gm accounts etc are created prior to Znote AAC installation.

Bit difficult to help without any errors or information about your distro/engine.

With the assumption that you are using something similar to these souces: GitHub - otland/tfs-old-svn: TFS repository once kept private, converted from SVN

This might work:
Lua:
local cfg = {
    points = 10,
    effect = CONST_ME_GIFT_WRAPS
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isPlayer(cid) then
        return false
    end

    db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. cfg.points .. " WHERE `account_id` = '"...
I've been trying to solve this for past 6 days :/ still no luck. I can use that rune normally, but it still shows 0 points on the website
HTML:
local cfg =
{
    points = 10,
    effect = CONST_ME_GIFT_WRAPS
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(not isPlayer(itemEx.uid)) then
        return false
    end
    db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. cfg.points .. " WHERE `name` = '" .. getAccountByName(getCreatureName(itemEx.uid)) .. "' LIMIT 1;")
    doCreatureSay(cid, "You have received " .. cfg.points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
    doSendMagicEffect(toPosition, cfg.effect)
    doRemoveItem(item.uid, 1)
    return true
end
 
Last edited:
Make sure that the user created their account with Znote AAC (and has an entry in znote_accounts table). Sometimes gm accounts etc are created prior to Znote AAC installation.

Bit difficult to help without any errors or information about your distro/engine.

With the assumption that you are using something similar to these souces: GitHub - otland/tfs-old-svn: TFS repository once kept private, converted from SVN

This might work:
Lua:
local cfg = {
    points = 10,
    effect = CONST_ME_GIFT_WRAPS
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isPlayer(cid) then
        return false
    end

    db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. cfg.points .. " WHERE `account_id` = '" .. getAccountNumberByPlayerName(getCreatureName(cid)) .. "' LIMIT 1;")
    doCreatureSay(cid, "You have received " .. cfg.points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
    doSendMagicEffect(toPosition, cfg.effect)
    doRemoveItem(item.uid, 1)
    return true
end

You can use the znoteshop.lua as reference code, if your using TFS 0.3 then either this:
ZnoteAAC/znoteshop.lua at master · Znote/ZnoteAAC · GitHub

Or this should work:
ZnoteAAC/znoteshop.lua at master · Znote/ZnoteAAC · GitHub

You might need to change db.executeQuery with db.storeQuery. Just look for error messages when using the rune.
 
Solution
Back
Top