• 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...
CONFIG.PHP
Change
LUA:
        'characterAuction' => true, // Enable/disable this system
To
LUA:
        'characterAuction' => false, // Enable/disable this system
Or try adding this in your database sql
Code:
drop table znote_auction_player
and adding it again
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 ;
 
i wanna use it put true in config.php and it does not work :) how can i fix it? also i added it to database and still same anyone can help me with this there is nothing for this in forum.....
 

Attachments

Last edited:
ok and how about the comment !shop i dont recieve the items i buy on my site
talkactions.xml
XML:
    <talkaction words="!shop" script="znoteshop.lua"/>
in data/talkactions/scripts create a lua called znoteshop.lua and add following code :
LUA:
-- Znote Shop v1.0 for Znote AAC on TFS 1.0+.
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.
    local player = Player(cid)
    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
in globalevents.xml :
XML:
        <globalevent name="Znote Shop" interval="30000" script="shop.lua" />
and create file in data/globalevents/scripts called shop.lua and add following :
LUA:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 36
-- ### END OF CONFIG ###
function onThink(interval)
    local deliveryInterval = interval / 1000
    local resultId = db.storeQuery("SELECT * FROM z_ots_comunication")
    if(resultId) then
        repeat
            local id = result.getNumber(resultId, "id")
            local player = Player(result.getString(resultId, "name"))
            if(player) then
                local addItemType = result.getString(resultId, "param5")
                if(addItemType == 'item' or addItemType == 'container') then
                    local itemId = result.getNumber(resultId, "param1")
                    local itemCount = result.getNumber(resultId, "param2")
                    local containerId = result.getNumber(resultId, "param3")
                    local containerCount = result.getNumber(resultId, "param4")
                    local addItemName = result.getString(resultId, "param6")
                    local itemReceivedStatus = 0
                    local itemItemType = ItemType(itemId)
                    local containerItemType = ItemType(containerId)
                    local itemsWeight = 0
                    if(itemItemType:isRune() or itemItemType:isFluidContainer() or itemItemType:getCharges() > 0) then
                        itemsWeight = itemItemType:getWeight(1)
                    else
                        itemsWeight = itemItemType:getWeight(itemCount)
                    end
                    if(addItemType == 'container') then
                        itemsWeight = itemsWeight * containerCount + containerItemType:getWeight(1)
                    end
                    local freeCapacity = player:getFreeCapacity()
                    if(itemsWeight <= freeCapacity) then
                        local itemForPlayer = 0
                        if(addItemType == 'container') then
                            itemForPlayer = Container(doCreateItemEx(containerId, 1))
                            itemForPlayer:setAttribute("description", containerItemType:getDescription() .. "\nBought by " .. player:getName() .. ".")
                            local innerContainerItem = 0
                            for i = 1, containerCount do
                                innerContainerItem = Item(doCreateItemEx(itemId, itemCount))
                                if(not itemItemType:isRune() and not itemItemType:isFluidContainer() and not itemItemType:isStackable()) then
                                    innerContainerItem:setAttribute("description", itemItemType:getDescription() .. "\nBought by " .. player:getName() .. ".")
                                end
                                itemForPlayer:addItemEx(innerContainerItem)
                            end
                        else
                            itemForPlayer = Item(doCreateItemEx(itemId, itemCount))
                            if(not itemItemType:isRune() and not itemItemType:isFluidContainer() and not itemItemType:isStackable()) then
                                itemForPlayer:setAttribute("description", itemItemType:getDescription() .. "\nBought by " .. player:getName() .. ".")
                            end
                        end
                        itemReceivedStatus = player:addItemEx(itemForPlayer, false)
                        if(type(itemReceivedStatus) == "number" and itemReceivedStatus == 0) then
                            player:sendTextMessage(SHOP_MSG_TYPE, 'You received >> '.. addItemName ..' << from OTS shop.')
                            db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                            db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                        else
                            player:sendTextMessage(SHOP_MSG_TYPE, '>> '.. addItemName ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. deliveryInterval ..' seconds to get it.')
                        end
                    else
                        player:sendTextMessage(SHOP_MSG_TYPE, '>> '.. addItemName ..' << from OTS shop is waiting for you. It weight is '.. (itemsWeight / 100) ..' oz., you have only '.. (freeCapacity / 100) ..' oz. free capacity. Put some items in depot and wait about '.. deliveryInterval ..' seconds to get it.')
                    end
                end
            end
        until not result.next(resultId)
        result.free(resultId)
    end
    return true
end
Also please everytime you ask for help tell us whats your distro. This is working on TFS 1.x
 
Last edited:
Try adding this

CREATE TABLE `znote_shop` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`type` int(11) NOT NULL,

`itemid` int(11) DEFAULT NULL,

`count` int(11) NOT NULL DEFAULT '1',

`describtion` varchar(255) NOT NULL,

`points` int(11) NOT NULL DEFAULT '10',

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE `znote_shop_logs` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`account_id` int(11) NOT NULL,

`player_id` int(11) NOT NULL,

`type` int(11) NOT NULL,

`itemid` int(11) NOT NULL,

`count` int(11) NOT NULL,

`points` int(11) NOT NULL,

`time` int(11) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE `znote_shop_orders` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`account_id` int(11) NOT NULL,

`type` int(11) NOT NULL,

`itemid` int(11) NOT NULL,

`count` int(11) NOT NULL,

`time` int(11) NOT NULL DEFAULT '0',

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



[/code]
Also try dropping than adding them again
 
Back
Top