• Sign up for October Mapping Competition! The prize includes Otland Premium time.
  • 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!

[GESIOR2012] Items Shop Installation/Administration

Loth Gena

Roxeria 8.60 Developer
Joined
Feb 5, 2014
Messages
246
Reaction score
21
Location
UK
Gesior can you release a tutorial for old tfs 0.2? as it doesnt have globalevents, thanks
 

Lyky

Well-Known Member
Joined
May 27, 2014
Messages
271
Solutions
8
Reaction score
77
@Gesior.pl
Hi,
I have just installed the acc maker and enabled the module on "?subtopic=shopsystem" I'm getting following:


Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 84
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 86
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 98
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 98
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 107
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 127
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 147
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 147

Have I missed something? It shouldn't just error out like that should it?
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,127
Solutions
25
Reaction score
1,352
Location
PLand
@Lyky
You should disable errors and warnings in PHP.
You can try to change index.php:
Code:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
To:
Code:
error_reporting(0);
Then it won't show any errors on website.

Acc. maker has a lot of 'small bugs'. Not related to security/functionality, just code isn't clean.
 

Webtimize

Pro Grammer
Joined
Oct 3, 2011
Messages
487
Solutions
10
Reaction score
158
Location
The Netherlands
Suppressing all errors is never a great idea, especially when you're not checking logs regularly.
It's actually a PHP > 7.2 behavior, you can prevent this by applying the following fixes:

Replace shopsystem.php > line 84:

PHP:
if( is_array($offer_list['item']) && count($offer_list['item']) > 0)

Replace shopsystem.php > line 86:

PHP:
elseif( is_array($offer_list['container']) && count($offer_list['container']) > 0)

Replace shopsystem.php > line 98:

PHP:
if( (is_array($offer_list['item'] && is_array($offer_list['container'])) && (count($offer_list['item']) > 0) or (count($offer_list['container']) > 0))

Replace shopsystem.php > line 107:

PHP:
if( is_array($offer_list['item']) && (count($offer_list['item']) > 0) and ($action == 'item'))

Replace shopsystem.php > line 127:

PHP:
if( is_array($offer_list['container']) && (count($offer_list['container']) > 0) and ($action == 'container'))

Replace shopsystem.php > line 147:

PHP:
if( (is_array($offer_list['item']) && is_array($offer_list['container'])) && (count($offer_list['item']) > 0) or (count($offer_list['container']) > 0))


I have not tested this, since I am not running any AAC. It's a pretty straight forward fix, and you can compare the current line to the new line to see what's happening if you're really wondering.

> PHP: Backward incompatible changes - Manual
> PHP: count - Manual
 
Last edited:

Tecrtr

New Member
Joined
Jan 30, 2019
Messages
12
Reaction score
0
Hello, I have ots rl map tibia 10.00 with the forgotten server engine on my server vps on ovh.

How to create a store so that you can buy points and for points to buy in the store items or in the game for mounts, outfits, xb boost, etc.

Where in what file and what should I set, what script? I am asking for a specific guide.

In the picture I'm sending like shop for me after uploading ots.

I configured it as the tutorial shows:


But I do not fully understand the last part.

And I do not know if I copied those scripts well.

1. config.php looks like this when it comes to the store:

// ---- Config Shop ----
$ outfits_list = array ();
$ loyalty_title = array (50 => 'Scout', 100 => 'Sentinel', 200 => 'Steward', 400 => 'Warden', 1000 => 'Squire', 2000 => 'Warrior', 3000 => 'Keeper', 4000 => 'Guardian', 5000 => 'Sage');
$ config ['shop'] ['newitemdays'] = 1; #days to item be new in shop


and here I added:

"$ config ['site'] ['shop_system'] = true; // show server shop only 'LUA scripts of shop'

2. where to copy:

"<globalevent name =" website_shop_item_delivery "interval =" 30 "event =" script "value =" shop.lua "/>"

I copied under "<! - Others ->" in globalevents.xml

Do you need a completely different guide?
 

Attachments

kpone1

New Member
Joined
Nov 29, 2011
Messages
1
Reaction score
0
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 171

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 172

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 173

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 175

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 201

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 221

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 242

Warning
: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 262


i have tfs system, help me fix these errors please
 

caiodaguiar

New Member
Joined
May 27, 2012
Messages
1
Reaction score
0
It's tutorial for Gesior 2012 account maker, not old one.

1. What will you need?
  • installed account maker
  • working ots based on TFS 0.3.6/0.4

Tutorial:
1. INSTALLATION OF SHOP [to make it deliver items]
Shop show images of items. It will not work, if you don't install item images! [there is tutorial how to do it]
It adds in description of all items (also in containers) name of player that bought item and unique ID of shop system transaction ^_^

1. Open account maker folder and go to folder config and edit file config.php
2. Find in it line:
PHP:
$config['site']['shop_system'] = false; // show server shop page? use only if you installed LUA scripts of shop
and change it value to true
3. Now open folder data of your ots
4. Open file globalevents.xml in folder globalevents
5.
Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
XML:
<globalevent name="website_shop_item_delivery" interval="30" event="script" value="shop.lua"/>
or:
XML:
<globalevent name="website_shop_item_delivery" interval="30000" event="script" value="shop.lua"/>
(if in that file is event 'save' with interval 3600/7200 then add 30 [it's time in seconds], if interval is very high like 3600000/7200000 then add line with interval 30000 [it's time in miliseconds - ms])
6. Create file shop.lua in folder globalevents/scripts and paste in it:
Lua:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "data/lib/000-constants.lua")
SHOP_MSG_TYPE = MESSAGE_STATUS_CONSOLE_BLUE
-- time (in seconds) between queries to MySQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
    local result_plr = db.getResult("SELECT * FROM `z_ots_comunication` WHERE `type` = 'login';")
    if(result_plr:getID() ~= -1) then
        while(true) do
            id = tonumber(result_plr:getDataInt("id"))
            action = tostring(result_plr:getDataString("action"))
            delete = tonumber(result_plr:getDataInt("delete_it"))
            cid = getCreatureByName(tostring(result_plr:getDataString("name")))
            if isPlayer(cid) == TRUE then
                local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
                local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
                local container_id = tonumber(result_plr:getDataInt("param3"))
                local container_count = tonumber(result_plr:getDataInt("param4"))
                local add_item_type = tostring(result_plr:getDataString("param5"))
                local add_item_name = tostring(result_plr:getDataString("param6"))
                local received_item = 0
                local full_weight = 0
                if add_item_type == 'container' then
                    container_weight = getItemWeightById(container_id, 1)
                    if isItemRune(itemtogive_id) == TRUE then
                        items_weight = container_count * getItemWeightById(itemtogive_id, 1)
                    else
                        items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                    full_weight = items_weight + container_weight
                else
                    full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    if isItemRune(itemtogive_id) == TRUE then
                        full_weight = getItemWeightById(itemtogive_id, 1)
                    else
                        full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                end
                local free_cap = getPlayerFreeCap(cid)
                if full_weight <= free_cap then
                    if add_item_type == 'container' then
                        local new_container = doCreateItemEx(container_id, 1)
                        doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
                        doItemSetAttribute(new_container, "tid", id)
                        local iter = 0
                        while iter ~= container_count do
                            local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                            doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
                            doItemSetAttribute(new_item, "tid", id)
                            doAddContainerItemEx(new_container, new_item)
                            iter = iter + 1
                        end
                        received_item = doPlayerAddItemEx(cid, new_container)
                    else
                        local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                        doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
                        doItemSetAttribute(new_item, "tid", id)
                        received_item = doPlayerAddItemEx(cid, new_item)
                    end
                    if received_item == RETURNVALUE_NOERROR then
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
                        doPlayerSave(cid)
                        db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                        db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                    else
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                else
                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
                end
            end
            if not(result_plr:next()) then
                break
            end
        end
        result_plr:free()
    end
    return true
end
That script should work on 0.3.6 and 0.4 without problems (made for my 0.3.6pl1 OTS and tests on 0.4 client 9.6).
Script only for OTSes that use MySQL database!


2. INSTALLATION OF 'ADD SHOP ITEMS' TALKACTION
1. Now open folder data of your ots
2. Open file talkactions.xml in folder talkactions
3.
Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
[this line is from TFS 0.4 client 9.6, it may look a bit different on old distributions, make it like other talkactions for GOD]
XML:
<talkaction log="yes" words="/addshop" access="5" event="script" value="add_shop_talkaction.lua"/>
4. Create file add_shop_talkaction.lua in folder talkactions/scripts and paste in it [tested on TFS 0.4 client 9.6, should works good with all 0.4]:
http://paste.ots.me/560784/text

If script above doesn't work for you (error in console) try SECOND script:
http://paste.ots.me/560783/text

3. SHOP ADMINISTRATION
1. Add offer
1.1
Add with first LUA 'add shop' script [first script works good on 0.4 client 9.6, but I'm not sure if it works on 0.3.6]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add IN FRONT OF YOU:


Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:


Then in SMS shop it shows:


1.2 Add with second LUA 'add shop' script [works on all TFSes 0.3.6/0.4, BUT on 9.6 you can't put all items in right hand!]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add in your right hand:


Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:


Then in SMS shop it shows [old shop images, not it shows images]:


2. Remove offer
You can remove offers in 'phpmyadmin' [database]. Remove rows from table z_shop_offer.

3. Edit offer
You can edit offers in 'phpmyadmin' [database]. Edit rows in table z_shop_offer, but it's not easy to understand, so better remove and add again.


The link's (paste.ot..) to talkaction don't work, i need for finish my project... :( Help me
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,127
Solutions
25
Reaction score
1,352
Location
PLand
The link's (paste.ot..) to talkaction don't work, i need for finish my project... :( Help me
1. Try some online website proxy like: hide.me VPN (https://hide.me/en/proxy)
paste.ots.me server works, but it's hosted on OVH webserver and I know that some users cannot connect to it - there is no route from their IP to OVH IP somehow (I get reports from yeeears).
2. http://paste.ots.me/560784/text is:
Code:
function onSay(cid, words, param, channel)
    local toPos = getCreatureLookPosition(cid) -- this function may not exists in old TFSes :/
    toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
    local params = string.explode(param, ",")
    local price = params[1]
    table.remove(params, 1)
    local desc = table.concat(params,",")
    local name = ''
    local item1 = getThingFromPos(toPos)
    local itemid1 = item1.itemid
    local count1 = item1.type
    local itemid2 = 0
    local count2 = 0

    if(itemid1 == 0 or isCreature(item1.uid)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There is no moveable item in front of you or there is creature.")
        return true
    end
    if(not price) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must set price.")
        return true
    end
    price = tonumber(price)
    local itemInfo = getItemInfo(itemid1)
    local offer_type = 'item'
    if(isContainer(item1.uid)) then
        local item2 = getContainerItem(item1.uid, 0)
        if(item2.itemid > 0) then
            count1 = getContainerCap(item1.uid)
            itemid2 = item2.itemid
            count2 = item2.type
            offer_type = 'container'
            itemInfo = getItemInfo(itemid2)
        end
    end
    local count1_desc = (count1 > 0) and count1 or 1
    local count2_desc = (count2 > 0) and count2 or 1
    if(itemid2 == 0) then
        name = count1_desc .. 'x ' .. itemInfo.name
    else
        name = count1_desc .. 'x ' .. count2_desc .. 'x ' .. itemInfo.name
    end
    db.executeQuery('INSERT INTO `z_shop_offer` (`id` ,`points` ,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`) VALUES (NULL , ' .. price .. ', ' .. itemid1 .. ', ' .. count1 .. ', ' .. itemid2 .. ', ' .. count2 .. ', \'' .. offer_type .. '\', ' .. db.escapeString(desc) .. ', ' .. db.escapeString(name) .. ');')
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item >> " .. name .. " << added to SMS shop. Price is " .. price .. " premium points.")
    return true
end
http://paste.ots.me/560783/text is:
Code:
function onSay(cid, words, param, channel)
    local params = string.explode(param, ",")
    local price = params[1]
    table.remove(params, 1)
    local desc = table.concat(params,",")
    local name = ''
    local item1 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
    local itemid1 = item1.itemid
    local count1 = item1.type
    local itemid2 = 0
    local count2 = 0

    if(itemid1 == 0) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Put item in right hand.")
        return true
    end
    if(not price) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must set price.")
        return true
    end
    price = tonumber(price)
    local itemInfo = getItemInfo(itemid1)
    local offer_type = 'item'
    if(isContainer(item1.uid)) then
        local item2 = getContainerItem(item1.uid, 0)
        if(item2.itemid > 0) then
            count1 = getContainerCap(item1.uid)
            itemid2 = item2.itemid
            count2 = item2.type
            offer_type = 'container'
            itemInfo = getItemInfo(itemid2)
        end
    end
    local count1_desc = (count1 > 0) and count1 or 1
    local count2_desc = (count2 > 0) and count2 or 1
    if(itemid2 == 0) then
        name = count1_desc .. 'x ' .. itemInfo.name
    else
        name = count1_desc .. 'x ' .. count2_desc .. 'x ' .. itemInfo.name
    end
    db.executeQuery('INSERT INTO `z_shop_offer` (`id` ,`points` ,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`) VALUES (NULL , ' .. price .. ', ' .. itemid1 .. ', ' .. count1 .. ', ' .. itemid2 .. ', ' .. count2 .. ', \'' .. offer_type .. '\', ' .. db.escapeString(desc) .. ', ' .. db.escapeString(name) .. ');')
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item >> " .. name .. " << added to SMS shop. Price is " .. price .. " premium points.")
    return true
end
 

royalmichael

New Member
Joined
Apr 21, 2020
Messages
80
Reaction score
4
It's tutorial for Gesior 2012 account maker, not old one.

1. What will you need?
  • installed account maker
  • working ots based on TFS 0.3.6/0.4

Tutorial:
1. INSTALLATION OF SHOP [to make it deliver items]
Shop show images of items. It will not work, if you don't install item images! [there is tutorial how to do it]
It adds in description of all items (also in containers) name of player that bought item and unique ID of shop system transaction ^_^

1. Open account maker folder and go to folder config and edit file config.php
2. Find in it line:
PHP:
$config['site']['shop_system'] = false; // show server shop page? use only if you installed LUA scripts of shop
and change it value to true
3. Now open folder data of your ots
4. Open file globalevents.xml in folder globalevents
5.
Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
XML:
<globalevent name="website_shop_item_delivery" interval="30" event="script" value="shop.lua"/>
or:
XML:
<globalevent name="website_shop_item_delivery" interval="30000" event="script" value="shop.lua"/>
(if in that file is event 'save' with interval 3600/7200 then add 30 [it's time in seconds], if interval is very high like 3600000/7200000 then add line with interval 30000 [it's time in miliseconds - ms])
6. Create file shop.lua in folder globalevents/scripts and paste in it:
Lua:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "data/lib/000-constants.lua")
SHOP_MSG_TYPE = MESSAGE_STATUS_CONSOLE_BLUE
-- time (in seconds) between queries to MySQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
    local result_plr = db.getResult("SELECT * FROM `z_ots_comunication` WHERE `type` = 'login';")
    if(result_plr:getID() ~= -1) then
        while(true) do
            id = tonumber(result_plr:getDataInt("id"))
            action = tostring(result_plr:getDataString("action"))
            delete = tonumber(result_plr:getDataInt("delete_it"))
            cid = getCreatureByName(tostring(result_plr:getDataString("name")))
            if isPlayer(cid) == TRUE then
                local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
                local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
                local container_id = tonumber(result_plr:getDataInt("param3"))
                local container_count = tonumber(result_plr:getDataInt("param4"))
                local add_item_type = tostring(result_plr:getDataString("param5"))
                local add_item_name = tostring(result_plr:getDataString("param6"))
                local received_item = 0
                local full_weight = 0
                if add_item_type == 'container' then
                    container_weight = getItemWeightById(container_id, 1)
                    if isItemRune(itemtogive_id) == TRUE then
                        items_weight = container_count * getItemWeightById(itemtogive_id, 1)
                    else
                        items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                    full_weight = items_weight + container_weight
                else
                    full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    if isItemRune(itemtogive_id) == TRUE then
                        full_weight = getItemWeightById(itemtogive_id, 1)
                    else
                        full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                end
                local free_cap = getPlayerFreeCap(cid)
                if full_weight <= free_cap then
                    if add_item_type == 'container' then
                        local new_container = doCreateItemEx(container_id, 1)
                        doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
                        doItemSetAttribute(new_container, "tid", id)
                        local iter = 0
                        while iter ~= container_count do
                            local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                            doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
                            doItemSetAttribute(new_item, "tid", id)
                            doAddContainerItemEx(new_container, new_item)
                            iter = iter + 1
                        end
                        received_item = doPlayerAddItemEx(cid, new_container)
                    else
                        local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                        doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
                        doItemSetAttribute(new_item, "tid", id)
                        received_item = doPlayerAddItemEx(cid, new_item)
                    end
                    if received_item == RETURNVALUE_NOERROR then
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
                        doPlayerSave(cid)
                        db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                        db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                    else
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                else
                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
                end
            end
            if not(result_plr:next()) then
                break
            end
        end
        result_plr:free()
    end
    return true
end
That script should work on 0.3.6 and 0.4 without problems (made for my 0.3.6pl1 OTS and tests on 0.4 client 9.6).
Script only for OTSes that use MySQL database!


2. INSTALLATION OF 'ADD SHOP ITEMS' TALKACTION
1. Now open folder data of your ots
2. Open file talkactions.xml in folder talkactions
3.
Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
[this line is from TFS 0.4 client 9.6, it may look a bit different on old distributions, make it like other talkactions for GOD]
XML:
<talkaction log="yes" words="/addshop" access="5" event="script" value="add_shop_talkaction.lua"/>
4. Create file add_shop_talkaction.lua in folder talkactions/scripts and paste in it [tested on TFS 0.4 client 9.6, should works good with all 0.4]:
http://paste.ots.me/560784/text

If script above doesn't work for you (error in console) try SECOND script:
http://paste.ots.me/560783/text

3. SHOP ADMINISTRATION
1. Add offer
1.1
Add with first LUA 'add shop' script [first script works good on 0.4 client 9.6, but I'm not sure if it works on 0.3.6]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add IN FRONT OF YOU:


Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:


Then in SMS shop it shows:


1.2 Add with second LUA 'add shop' script [works on all TFSes 0.3.6/0.4, BUT on 9.6 you can't put all items in right hand!]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add in your right hand:


Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:


Then in SMS shop it shows [old shop images, not it shows images]:


2. Remove offer
You can remove offers in 'phpmyadmin' [database]. Remove rows from table z_shop_offer.

3. Edit offer
You can edit offers in 'phpmyadmin' [database]. Edit rows in table z_shop_offer, but it's not easy to understand, so better remove and add again.
Zrobiłem jak należy, mam tfsa 1.2 powinno działać skoro mam acc maker 2012? mam rozumiec że potem wchodze na goda i wpisuje /addshop 50 < i to znaczy że dodaje itema którego mam w prawej ręce do shopa za 50 ptk?
 

Zeoden

New Member
Joined
Oct 15, 2016
Messages
1
Reaction score
0
@Lyky
You should disable errors and warnings in PHP.
You can try to change index.php:
Code:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
To:
Code:
error_reporting(0);
Then it won't show any errors on website.

Acc. maker has a lot of 'small bugs'. Not related to security/functionality, just code isn't clean.



love you
 

zivers

New Member
Joined
Feb 2, 2011
Messages
2
Reaction score
0
I did everything as you describe the errors "C: \ xampp \ htdocs \ pages \ Shopsystem.php". I managed to remove it by changing the index. But still when I try to add some items nothing happens. There is no mistake but it does not add to the shop

1602348110614.png
 
Last edited:
Top