[GESIOR2012] Items Shop Installation/Administration

KOMUJ

New Member
Joined
Oct 1, 2012
Messages
14
Reaction score
1
Hey gesior.pl
i used everything to add the item to the player like u said...
i got just one problem it works fine yes but if i buy example: Mineria Wand, it not only add me 1 it add me 1 after the next... i mean this:
14:12 You received >> Mineria Wand << from OTS shop.
14:13 You received >> Mineria Wand << from OTS shop.
14:13 You received >> Mineria Wand << from OTS shop.
i just bought one and every 30 sec i get one more added ingame :S
In the globalevent script look for

db.executeQuery

and change it to

db.storeQuery

This worked for me.

Gesior I need help with adding items to the shop, here's what I got:

-Uniform Server working fine
-phpmyadmin database working fine
-aac maker working fine
-server running fine

However, I'm using [9.80-9.86] The Forgotten Server v0.2.15 (Mystic Spirit)
http://otland.net/f18/9-80-9-86-forgotten-server-v0-2-15-mystic-spirit-188228/

I followed all your instructions correctly (twice)
but when i use the command "/addshop <price> the message is just said on local chat and nothing happens
I'am not sure if it's because im using v0.2.15 and maybe the scripts work a bit different?
If that's the reason, can you please tell me how to add items to the shop with the version im running?

Thanks in advance.
Had the same problem, fixed it by doing the same thing above but in the add_shop_talkaction.lua
 
Last edited:

jepposk

New Member
Joined
Feb 24, 2009
Messages
12
Reaction score
0
[27/10/2013 12:08:59] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/add_shop_talkaction.lua:24: '=' expected near 'local'
[27/10/2013 12:08:59] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/add_shop_talkaction.lua)
[27/10/2013 12:08:59] data/talkactions/scripts/add_shop_talkaction.lua:24: '=' expected near 'local'

Followed the steps, what did i do wrong?
Thanks
 

Elexonic

Excellent OT User
Joined
Jun 18, 2008
Messages
1,921
Reaction score
55
[10/09/2010 12:14:27] [Error - GlobalEvent Interface]
[10/09/2010 12:14:27] data/globalevents/scripts/shop.lua:eek:nThink
[10/09/2010 12:14:27] Description:
[10/09/2010 12:14:28] data/globalevents/scripts/shop.lua:41: attempt to compare boolean with number
[10/09/2010 12:14:28] stack traceback:
Reloaded global events.
[10/09/2010 12:14:29] data/globalevents/scripts/shop.lua:41: in function <data/globalevents/scripts/shop.lua:7>
When player no have cap..
 

ex eclipse

Excellent OT User
Joined
Jul 15, 2007
Messages
283
Reaction score
1
Location
Brazil
how may i sell premium account in that shop cuz i cant find a way lol

the offer_types pacc, unban, namelock doesnt work.. i have in my database but the shop.php doesnt show it.. its showing only the items and containers
 
Last edited:

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,190
Reaction score
1,128
Location
Sweden
how may i sell premium account in that shop cuz i cant find a way lol

the offer_types pacc, unban, namelock doesnt work.. i have in my database but the shop.php doesnt show it.. its showing only the items and containers
There is nothing like that implanted into gesior. You would have to use an item that when used gives the player prem days via LUA.
 

Lifer420

Veteran OT User
Joined
Jul 27, 2009
Messages
1,487
Reaction score
166
@Gesior.pl i've tried this talk action many times in game, and tried editing it to work and I just cant get it.

Im using TFS 0.4 and Gesior 2012, but I need help. Can you contact me via pm?
 

velue

New Member
Joined
Feb 5, 2014
Messages
5
Reaction score
0
i cant add any offers.

14:31 /addshop 80,You see a mastermind shield (Def:37). It weighs 57.00 oz. It's an enchanted shield.
14:31 There is no moveable item in front of you or there is creature.

Where i must have item ? (OTS 10.10) TFS 0.3.7
No have any bugs or problems in console.
I cant have item in arow place or right hand.
 

HappyFeet

Premium User
Premium User
Joined
Nov 8, 2012
Messages
243
Reaction score
2
Location
Netherlands
I get this error : Fatal error: Call to undefined function getOfferArray() in D:\xampp\htdocs\pages\shopsystem.php on line 309
line 309: $offer_list = getOfferArray();

when I tried to buy something from the webshop.
I'm using this script (gesior 2012) tfs 0.3.6.
I only add 4 catagories

--edit--

Fixed
 
Last edited:

omg123

New Member
Joined
Jan 14, 2014
Messages
11
Reaction score
0
TFS 0.4 8.6
What i doing wrong ?I cannot add items.
use first script , at second have this same problem ;c
no have bugs in console

 
Last edited:

omg123

New Member
Joined
Jan 14, 2014
Messages
11
Reaction score
0
One problem fixed.I Had no GOD Acces(6) only Gm(5).
But now have next problem.
Problem is :
There is no moveable item in front of you or there is creature.
#FIXED
But i have another problem
When i buy items , to account added is 10x this same item.
#
FIXED
Next problem >
mysql_store_result<>:UPDATE'z_shop_history_item'SET 'trans_state'='realized', 'trans_real'=1393670317 where id = 4 - MYSQL ERROR <0>

where id = 4 IS 1,2,3 ERRORS

In Acc Maker History i see what i buy...
 
Last edited:

Strata

Hoster
Joined
Apr 12, 2010
Messages
124
Reaction score
6
Location
USA
data/talkactions/scripts/add_shop_talkaction.lua:46: unexpected symbol near '['

used the same code you posted and i get this error
 

cs007

Member
Joined
Dec 2, 2010
Messages
56
Reaction score
1
data/talkactions/scripts/add_shop_talkaction.lua:46: unexpected symbol near '['

used the same code you posted and i get this error

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
 

kamioool

Member
Joined
Oct 27, 2008
Messages
83
Reaction score
11
Location
Pole
Can you restore options in the future with the item type = pacc
 

k1mpan

New Member
Joined
Jan 15, 2014
Messages
2
Reaction score
0
Hello Gesior! I got some problems with your scripts. when a player purchase an item from the website they get debugg if they are logged in when they purchase but if they are offline then they get the item without problems :S do you know what could be the problem?
 

cs007

Member
Joined
Dec 2, 2010
Messages
56
Reaction score
1
Error shop.lua

Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/shop.lua:onThink
data/globalevents/scripts/shop.lua:8: attempt to call field 'getResult' (a nil value)
stack traceback:
        [C]: in function 'getResult'
        data/globalevents/scripts/shop.lua:8: in function <data/globalevents/scripts/shop.lua:7>
[Error - GlobalEvents::think] Failed to execute event: shop
 

Matty_boy88

New Member
Joined
Feb 21, 2014
Messages
2
Reaction score
0
In the globalevent script look for

db.executeQuery

and change it to

db.storeQuery

This worked for me.



Had the same problem, fixed it by doing the same thing above but in the add_shop_talkaction.lua
I was having the same problem and this fixed it for me!

In the talkaction script - add_shop_talkaction.lua find db.executeQuery which is on line 41, and change it to db.storeQuery. This will fix your problem.

That is for anyone who is just getting the message in Default channel instead of it working.

Edit: It's worth noting that I am using 8.6 TFS 0.3.6.
 

Pawelwroclaw

Member
Joined
Aug 22, 2014
Messages
34
Reaction score
0
i cant add any offers.

16:39 /addshop 80, 100 cc
16:39 There is no moveable item in front of you or there is creature.

Where i must have item ? (OTS 8.6) TFS 0.4
No have any bugs or problems in console.
I cant have item in arow place or right hand.


PLX HELP !!!!!!
 
Last edited:

Maxens

Member
Joined
Apr 9, 2009
Messages
479
Reaction score
7
Location
Germany
How can I add Premium Points to an Account with this System?

Ill do it with PHPMyAdmin :)

Thanks!
 

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,856
Reaction score
88
Location
Brazil
Hey Gesior, can you please make this script send BOUGHT ITEM(item, containers, etc) to hometown DP?
 
Top