• 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 !shop dosent work - Znote Shop

kvnwpts

New Member
Joined
Jan 12, 2012
Messages
56
Reaction score
0
Hello.

When I write !shop ingame nothing happens, and just to clarify that ive installed it correctly, after I write it two times it says "Can only be executed once every 15 seconds.".

The thing is the things i buy just dosent appear in tibia."

I need help if anyone knows, thank you.

The code is here, the same as when I downloaded Znote AAC.

Edit: I run the 8.6 TFS 0.3.6 and used the TFS_03 in the AAC, i tried _02 but the same.

Code:
-- Znote Shop v1.0 for Znote AAC on TFS 0.3.6+ Crying Damson.
function onSay(cid, 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 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`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. accid .. " LIMIT 1;")
      
        -- Detect if we got any results
        if orderQuery ~= false then
            -- Fetch order values
            local q_id = result.getDataInt(orderQuery, "id")
            local q_type = result.getDataInt(orderQuery, "type")
            local q_itemid = result.getDataInt(orderQuery, "itemid")
            local q_count = result.getDataInt(orderQuery, "count")
            result.free(orderQuery)
          
            -- ORDER TYPE 1 (Regular item shop products)
            if q_type == 1 then
                -- Get wheight
                local playerCap = getPlayerFreeCap(cid)
                local itemweight = getItemWeightById(q_itemid, q_count)
                    if playerCap >= itemweight then
                        db.executeQuery("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 .." "..getItemNameById(q_itemid).."(s)!")
                    else
                        doPlayerSendTextMessage(cid, 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
            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
 
Go to your config.php scroll down most and enable


PHP:
 'useDB' => false, // Fetch offers from database, or the below config array

PHP:
   'useDB' => true, // Fetch offers from database, or the below config array
 
Still don't work.. :/

Anything else?

Go to your config.php scroll down most and enable


PHP:
 'useDB' => false, // Fetch offers from database, or the below config array

PHP:
   'useDB' => true, // Fetch offers from database, or the below config array
 
Another thing. When people order, and the thing comes up: "Your order is ready to be delivered. Write this command in-game to get it: [!shop].
Make sure you are in depot and can carry it before executing the command!" the people can just refresh the page and be able to get the item over and over again.. How to prevent it?

EDIT: Ops, didnt realize it took the points. lol, nvm. :)
 
having same problem..
!shop
23:08 Can only be executed once every 15 seconds. Remaining cooldown: 15
doent work on admin or other acc.
 
Hello Im having the same problem as you had, but mine still dosent work... How did you fix it?
Cant do it from any account

Solved!

Would you mind sharing? : <

[0:2:59.034] [Error - TalkAction Interface]
[0:2:59.037] data/talkactions/scripts/znoteshop.lua:eek:nSay
[0:2:59.039] Description:
[0:2:59.040] data/talkactions/scripts/znoteshop.lua:27: attempt to compare boolean with number
[0:2:59.047] stack traceback:
[0:2:59.048] data/talkactions/scripts/znoteshop.lua:27: in function <data/talkactions/scripts/znoteshop.lua:2>
 
Last edited:
If you're using 0.4, use the shopsystem.lua from the special folder. That's howwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
 
In the folder called "special" (which you can only access through 127.0.0.1 IP) you can convert old accounts (like god account, accounts made with gesior/modern or in-game acc manager) to work with Znote AAC by running the "database 2 znote aac" file. (database2znoteaac.php). http://127.0.0.1/special/database2znoteaac.php
 
Back
Top