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

[Znote] !shop error for tfs 1.0

xx Kami xx

Retired.
Joined
Dec 29, 2012
Messages
509
Reaction score
20
Hello and im trying to use !shop for znote account, when i do !shop i get this error

io4AhEF.png


This is my script
Code:
-- Znote Shop v1.0 for Znote AAC on TFS 0.2.13+ Mystic Spirit.
function onSay(cid, words, param)
    local storage = 39672 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
    local cooldown = 15 -- in seconds.

    if getPlayerStorageValue(cid, storage) <= os.time() then
        setPlayerStorageValue(cid, storage, os.time() + cooldown)
        local accid = getAccountNumberByPlayerName(getCreatureName(cid))
  
        -- Create the query
        local orderQuery = db.storeQuery("SELECT `id`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. accid .. " AND `type` = 1 LIMIT 1;")
  
        -- Detect if we got any results
        if orderQuery ~= false then
            -- Fetch order values
            local q_id = result.getDataInt(orderQuery, "id")
            local q_itemid = result.getDataInt(orderQuery, "itemid")
            local q_count = result.getDataInt(orderQuery, "count")
            result.free(orderQuery)

            local playerCap = getPlayerFreeCap(cid)
            local itemweight = getItemWeight(q_itemid, q_count)
                if playerCap >= itemweight then
                    db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                    doPlayerAddItem(cid, q_itemid, q_count)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemName(q_itemid).."(s)!")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP!")
                end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no orders.")
        end
  
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every "..cooldown.." seconds. Remaining cooldown: ".. getPlayerStorageValue(cid, storage) - os.time())
    end
    return false
end
 
Last edited:
Don't center the text <,<
Also don't bump a thread if you have already created a thread.
Tag me when you have removed the centering of the text.
 
Code:
-- Znote Shop v1.0 for Znote AAC on TFS 0.2.13+ Mystic Spirit.
function onSay(cid, words, param)
    local storage = 39672 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
    local cooldown = 15 -- in seconds.

    if getPlayerStorageValue(cid, storage) <= os.time() then
        setPlayerStorageValue(cid, storage, os.time() + cooldown)
        local accid = getAccountNumberByPlayerName(getCreatureName(cid))
        -- Create the query
        local orderQuery = db.storeQuery("SELECT `id`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. accid .. " AND `type` = 1 LIMIT 1;")
        -- Detect if we got any results
        if orderQuery ~= false then
            -- Fetch order values
            local q_id = result.getNumber(orderQuery, "id")
            local q_itemid = result.getNumber(orderQuery, "itemid")
            local q_count = result.getNumber(orderQuery, "count")
            result.free(orderQuery)

            local playerCap = getPlayerFreeCap(cid)
            local itemweight = getItemWeight(q_itemid, q_count)
                if playerCap >= itemweight then
                    db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                    doPlayerAddItem(cid, q_itemid, q_count)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemName(q_itemid).."(s)!")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP!")
                end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no orders.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every "..cooldown.." seconds. Remaining cooldown: ".. getPlayerStorageValue(cid, storage) - os.time())
    end
    return false
end
 
Code:
-- Znote Shop v1.0 for Znote AAC on TFS 0.2.13+ Mystic Spirit.
function onSay(cid, words, param)
    local storage = 39672 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
    local cooldown = 15 -- in seconds.

    if getPlayerStorageValue(cid, storage) <= os.time() then
        setPlayerStorageValue(cid, storage, os.time() + cooldown)
        local accid = getAccountNumberByPlayerName(getCreatureName(cid))
        -- Create the query
        local orderQuery = db.storeQuery("SELECT `id`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. accid .. " AND `type` = 1 LIMIT 1;")
        -- Detect if we got any results
        if orderQuery ~= false then
            -- Fetch order values
            local q_id = result.getNumber(orderQuery, "id")
            local q_itemid = result.getNumber(orderQuery, "itemid")
            local q_count = result.getNumber(orderQuery, "count")
            result.free(orderQuery)

            local playerCap = getPlayerFreeCap(cid)
            local itemweight = getItemWeight(q_itemid, q_count)
                if playerCap >= itemweight then
                    db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                    doPlayerAddItem(cid, q_itemid, q_count)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemName(q_itemid).."(s)!")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP!")
                end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no orders.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every "..cooldown.." seconds. Remaining cooldown: ".. getPlayerStorageValue(cid, storage) - os.time())
    end
    return false
end
same problem it says [C]: in function 'getNumber'
 
@xx Kami xx
Don't be so rude LoL!! @WibbenZ was trying to help you and now you are answering with **ill just wait till halfaway has time to help me in teamviewer :\** lol! really suck.
not trying to be rude, its just my server is already online and i have players asking me to fix it so they can get there items, i think its kinda sad nowadays to get something fixed you have to pay for it, there is no such thing as "support" anymore :\
 
There actually is, if this was a paid job I would not ask you to test it..
The error you wrote about is not the same as above, that is why I asked you to take another ss of it.
I hope you know more then to just add the compat.lua file into your talkactions file.

Once again, show me the error.
Depending on your server version that should be the fix, since they got renamed from getDataInt to getNumber.
 
There actually is, if this was a paid job I would not ask you to test it..
The error you wrote about is not the same as above, that is why I asked you to take another ss of it.
I hope you know more then to just add the compat.lua file into your talkactions file.

Once again, show me the error.
Depending on your server version that should be the fix, since they got renamed from getDataInt to getNumber.
Lol, I got getDataInt error on TFS 1.1 but Halfaway fixed it for me :p, but the sad thing is i moved every file to my friend hosting the server. :/, So maybe tomorow morning i can post it see if it works.
 
not trying to be rude, its just my server is already online and i have players asking me to fix it so they can get there items, i think its kinda sad nowadays to get something fixed you have to pay for it, there is no such thing as "support" anymore :\
And i think @WibbenZ didn't give up and told you to show him ss about another error to help you, i think in all this time he might make it work for you.
 
Back
Top