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

znote auction problem

mirak sebata

New Member
Joined
Dec 6, 2017
Messages
135
Reaction score
0
hi i tried everything on this problem i even add it on phpmyadmin and it doesnt work


SQL:
CREATE TABLE IF NOT EXISTS `znote_auction_player` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player_id` int(11) NOT NULL,
  `account_id` int(11) NOT NULL,
  `bidder_id` int(11) NOT NULL,
  `vocation` int(11) NOT NULL,
  `level` int(11) NOT NULL,
  `image` varchar(255) NOT NULL,
  `price` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 
Last edited by a moderator:
Solution
no in game i dont get anything not you have no orders when i say !shop
i get this message..... :
Can only be executed once every 15 seconds. Remaining cooldown: 13
15:02 Hello [8]: !shop

Hmm, its probably stuck on that type then.

Try this:
LUA:
-- 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...
You have added an lua in talkactions go there , its located in data/talkactions/scripts/znoteshop or shop idk how did u added it there is local storage count how much numbers is there and try adding some other numbers with same count. Example if there is 12345 try to make 7384 <----- if theres 5 numbers you must make it be 5 too just change numbers
 
NEXT thing is how to get addons when buying from shop i dont get them look pls???

Add to (or make sure you have in) your shop script:
q_type == 5
LUA:
-- ORDER TYPE 5 (Outfit and addon)
if q_type == 5 then
    -- Make sure player don't already have this outfit and addon
    if not canPlayerWearOutfit(cid, q_itemid, q_count) then
        db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
        doPlayerAddOutfit(cid,q_itemid,q_count)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have received a new outfit!")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already have this outfit and addon!")
    end
end
 
Add to (or make sure you have in) your shop script:
q_type == 5
LUA:
-- ORDER TYPE 5 (Outfit and addon)
if q_type == 5 then
    -- Make sure player don't already have this outfit and addon
    if not canPlayerWearOutfit(cid, q_itemid, q_count) then
        db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
        doPlayerAddOutfit(cid,q_itemid,q_count)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have received a new outfit!")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already have this outfit and addon!")
    end
end


shop.lua?
 
Yes, the official scripts supports outfits and mounts. (Havent tested it myself). Let me know if there are any errors.
 
[Error - TalkAction Interface]
[04/01/2018 18:39:30] data/talkactions/scripts/znoteshop.lua:eek:nSay
[04/01/2018 18:39:30] Description:
[04/01/2018 18:39:30] data/talkactions/scripts/znoteshop.lua:52: attempt to call global 'getPlayerMount' (a nil value)
[04/01/2018 18:39:30] stack traceback:
[04/01/2018 18:39:30] data/talkactions/scripts/znoteshop.lua:52: in function <data/talkactions/scripts/znoteshop.lua:2>



error in both scripts
 
Where, on the website?

You probably removed too much from config.php and broke the array

no in game i dont get anything not you have no orders when i say !shop
i get this message..... :
Can only be executed once every 15 seconds. Remaining cooldown: 13
15:02 Hello [8]: !shop
 
Last edited:
no in game i dont get anything not you have no orders when i say !shop
i get this message..... :
Can only be executed once every 15 seconds. Remaining cooldown: 13
15:02 Hello [8]: !shop

Hmm, its probably stuck on that type then.

Try this:
LUA:
-- 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 and getTileInfo(getCreaturePosition(cid)).protection then
                        --backpack check
                        local backpack = getPlayerSlotItem(cid, 3)
                        local gotItem = false
                        if(backpack and backpack.itemid > 0) then
                            local received = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, q_itemid,q_count)
                            if(received ~= false) then
                                db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemNameById(q_itemid).."(s)!")
                                gotItem = true
                            end
                        end

                        if(not gotItem) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no available space in backpack to receive that item.")
                        end                      
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP and Need ProtectZone!")
                    end
            end
            -- ORDER TYPE 5 (Outfit and addon)
            if q_type == 5 then
                -- Make sure player don't already have this outfit and addon
                if not canPlayerWearOutfit(cid, q_itemid, q_count) then
                    db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                    doPlayerAddOutfit(cid,q_itemid,q_count)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have received a new outfit!")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already have this outfit and addon!")
                end
            end

            -- ORDER TYPE 6 (Mounts)
            if q_type == 6 then
                db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry! No mounts on this server.")
            end
          
            -- Add custom order types here
            -- Type 1 is for itemids (Already coded here)
            -- Type 2 is for premium (Coded on web)
            -- Type 3 is for gender change (Coded on web)
            -- Type 4 is for character name change (Coded on web)
            -- Type 5 is for character outfit and addon (Already coded here)
            -- Type 6 is for mounts (Already coded here)
            -- So use type 7+ for custom stuff, like etc packages.
            -- if q_type == 7 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
 
Solution
Back
Top