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

Imereth Popis

dopera.sytes.net
Joined
Jan 30, 2017
Messages
111
Solutions
1
Reaction score
12
Location
Spain
Hello guys,

The Znote Shop could make a pack item offer? I mean, the style of buying 1 item it's ok. But I want to know If I can put a pack like "Mage set" with 4-5 items and when "!shop" receive it all.

Thanks
 
Solution
Yes you can using custom offer types.

By default, Znote AAC uses type 1 - 6. So 7+ can be used for whatever you want.
Lets use type 7:

In config.php under $config['shop_offers'], add a "bundle offer".
ZnoteAAC/config.php at master · Znote/ZnoteAAC · GitHub
PHP:
        21 => array(
            'type' => 7, // type 7+ is for custom stuff
            'itemid' => itemid, // itemid of etc a bag or present, to show item image
            'count' => 1,
            'description' => "Item bundle",
            'points' => 100,
        ),

In the shop Lua script, code the logic for type 7 orders:
ZnoteAAC/znoteshop.lua at master · Znote/ZnoteAAC · GitHub
Lua:
if q_type == 7 then
    -- Get wheight
    local item1 = 1234
    local...
Yes you can using custom offer types.

By default, Znote AAC uses type 1 - 6. So 7+ can be used for whatever you want.
Lets use type 7:

In config.php under $config['shop_offers'], add a "bundle offer".
ZnoteAAC/config.php at master · Znote/ZnoteAAC · GitHub
PHP:
        21 => array(
            'type' => 7, // type 7+ is for custom stuff
            'itemid' => itemid, // itemid of etc a bag or present, to show item image
            'count' => 1,
            'description' => "Item bundle",
            'points' => 100,
        ),

In the shop Lua script, code the logic for type 7 orders:
ZnoteAAC/znoteshop.lua at master · Znote/ZnoteAAC · GitHub
Lua:
if q_type == 7 then
    -- Get wheight
    local item1 = 1234
    local item2 = 2345
    local weight = ItemType(item1):getWeight(1) + ItemType(item2):getWeight(1)
    if player:getFreeCapacity() >= weight then
        db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
        player:addItem(item1, 1)
        player:addItem(item2, 1)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. ItemType(item1):getName() .. " and " .. ItemType(item2):getName() .. "!")
    else
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!")
    end
end
 
Last edited:
Solution
Yes you can using custom offer types.

By default, Znote AAC uses type 1 - 6. So 7+ can be used for whatever you want.
Lets use type 7:

In config.php under $config['shop_offers'], add a "bundle offer".
ZnoteAAC/config.php at master · Znote/ZnoteAAC · GitHub
PHP:
        21 => array(
            'type' => 7, // type 7+ is for custom stuff
            'itemid' => itemid, // itemid of etc a bag or present, to show item image
            'count' => 1,
            'description' => "Item bundle",
            'points' => 100,
        ),

In the shop Lua script, code the logic for type 7 orders:
ZnoteAAC/znoteshop.lua at master · Znote/ZnoteAAC · GitHub
Lua:
if q_type == 7 then
    -- Get wheight
    local item1 = 1234
    local item2 = 2345
    local weight = ItemType(item1):getWeight(1) + ItemType(item2):getWeight(1)
    if player:getFreeCapacity() >= weight then
        db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
        player:addItem(item1, 1)
        player:addItem(item2, 1)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. ItemType(item1):getName() .. " and " .. ItemType(item2):getName() .. "!")
    else
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!")
    end
end

I'm gonna try this, I'm sure It's gonna work! Thanks a lot
 
Yes you can using custom offer types.

By default, Znote AAC uses type 1 - 6. So 7+ can be used for whatever you want.
Lets use type 7:

In config.php under $config['shop_offers'], add a "bundle offer".
ZnoteAAC/config.php at master · Znote/ZnoteAAC · GitHub
PHP:
        21 => array(
            'type' => 7, // type 7+ is for custom stuff
            'itemid' => itemid, // itemid of etc a bag or present, to show item image
            'count' => 1,
            'description' => "Item bundle",
            'points' => 100,
        ),

In the shop Lua script, code the logic for type 7 orders:
ZnoteAAC/znoteshop.lua at master · Znote/ZnoteAAC · GitHub
Lua:
if q_type == 7 then
    -- Get wheight
    local item1 = 1234
    local item2 = 2345
    local weight = ItemType(item1):getWeight(1) + ItemType(item2):getWeight(1)
    if player:getFreeCapacity() >= weight then
        db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
        player:addItem(item1, 1)
        player:addItem(item2, 1)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. ItemType(item1):getName() .. " and " .. ItemType(item2):getName() .. "!")
    else
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!")
    end
end
As I thought It's working fine. Thanks you!
 
Back
Top