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

Lua Znote ACC - getdataint Problem - TFS_11 [SOLVED]

kushovu

NXA
Joined
Jan 27, 2009
Messages
75
Reaction score
13
I still getting this error, i searched a lot at the forums but not find the solution

Sin_t_tulo.jpg


TFS version: 1.1
Znote Version: Znote AAC 1.5
Client version: 10.76
and the Znoteshop.lua: http://pastebin.com/0kn2tRcE

Everything is setted up and running, with 2 or 3 bugs but this is the most important part

Please someone can help me?

Additional:

At Znote_shop DB there isn't anything, i dont get the query after buying something at shop
Sin_t_tulo2.jpg
 
Last edited by a moderator:
Solution
E
that is becase you don't have a compat.lua file in your server, use this and please tell me that TFS_11 is only an example and that you have not set it in config since it doesn't really exist, the only available option is TFS_02, TFS_03 and TFS_10

Lua:
-- Znote Shop v1.0 for Znote AAC on TFS 1.1
function onSay(player, words, param)
    local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
    local cooldown = 15 -- in seconds.

    if player:getStorageValue(storage) <= os.time() then
        player:setStorageValue(storage, os.time() + cooldown)

        -- Create the query
        local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM...
that is becase you don't have a compat.lua file in your server, use this and please tell me that TFS_11 is only an example and that you have not set it in config since it doesn't really exist, the only available option is TFS_02, TFS_03 and TFS_10

Lua:
-- Znote Shop v1.0 for Znote AAC on TFS 1.1
function onSay(player, words, param)
    local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
    local cooldown = 15 -- in seconds.

    if player:getStorageValue(storage) <= os.time() then
        player:setStorageValue(storage, os.time() + cooldown)

        -- Create the query
        local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. player:getAccountId() .. " LIMIT 1;")

        -- Detect if we got any results
        if orderQuery ~= false then
            -- Fetch order values
            local q_id = result.getNumber(orderQuery, "id")
            local q_type = result.getNumber(orderQuery, "type")
            local q_itemid = result.getNumber(orderQuery, "itemid")
            local q_count = result.getNumber(orderQuery, "count")
            result.free(orderQuery)

            -- ORDER TYPE 1 (Regular item shop products)
            if q_type == 1 then
                -- Get wheight
                if player:getFreeCapacity() >= ItemType(q_itemid):getWeight(q_count) then
                    db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                    player:addItem(q_itemid, q_count)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. q_count .. " x " .. ItemType(q_itemid):getName() .. "!")
                else
                    player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!")
                end
            end
            -- Add custom order types here
            -- Type 2 is reserved for premium days and is handled on website, not needed here.
            -- Type 3 is reserved for character gender(sex) change and is handled on website as well.
            -- So use type 4+ for custom stuff, like etc packages.
            -- if q_type == 4 then
            -- end
        else
            player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have no orders.")
        end
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. player:getStorageValue(storage) - os.time())
    end
    return false
end
 
Last edited by a moderator:
Solution
Exactly, i should change TFS Version?

in config.php at Znote www
PHP:
<?php
    // Available options: TFS_02, TFS_03
    // TFS 0.2 = TFS_02
    // TFS 0.3 = TFS_03 (If ur using 0.3.6, set $config['salt'] to false)!
    // TFS 0.4 = TFS_03
    // TFS 1.0 = TFS_10 (Under developement)
    $config['TFSVersion'] = 'TFS_10';

But in console it shows this
Sin_t_tulo3.jpg


Edit:

I tried your link of Shop.lua and it works!
Sin_t_tulo12.jpg


I have another issues but i will post it on another thread
Thanks a lot!
 
Try to change getDataInt to getNumber in znoteshop.lua, apparently this was changed between TFS 1.0 and 1.1
 
Back
Top