• 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 help as I do for an items last 30 days

merecura

New Member
Joined
Oct 22, 2014
Messages
16
Reaction score
0
hi could help me to get a items on my server only lasts 30 days is a vip items and want to have duration please help give you rep +
 
:)

You can let them decay in items.xml
Code:
    <attribute key="decayTo" value="0" />
    <attribute key="duration" value="2592000" />
brother helps me but when I create the items with the command but when I buy it by the shop offer to give me Znote aac items and will not break just says that will break in 2 minutes but it stays as it would do to configure
 
What do you mean? How did you set the time and how long did it take for the item to go away?
I 'm trying to say is that when I buy items from the shop offer never decays decays only if I think the command

You have to tell it to decay aswell;
Code:
item.decay()
where in that code go?
 
Last edited by a moderator:
Do you mean they decay when you create them with /i command but not when they are created with the script that handles the donate items on the website?
Can you post that script?
 
Do you mean they decay when you create them with /i command but not when they are created with the script that handles the donate items on the website?
Can you post that script?
yes, there will be something in the set q Database truth I have no idea that you think you can be?
 
Can you post the script that creates the donation items ingame? Also post your server version.

This is the script that I use as I use Znote talkation aac I buy items from the web and ask the command ! Shop

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

and my server is version 8.6
 
Back
Top