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

Ver. 0.1.0 - Gesior ITEM/PACC Shop (PHP+LUA) for TFS

Hello, i from poland. Gesior why in my acc maker (by gesior 0.3 for TFS 0.2.13) I click Login but this open "http://127.0.0.1/?subtopic=accountmanagement" and Create Account some. :/ I install only gesior shop :( Plz Help Me

Sorry for my english.

...

Ahh teraz po polsku ...


Posiadam Acc maker by gersior 0.3 (do silnika w wersji 0.2.13 ) a teraz dodalem gesior shop i gry naciskam w acc makerze Login albo Create Account to przekierowuje mnie na localhost :/ Co mam zrobic zeby dzialalo dobrze? Czy moze byc tak ze to shop mi przeszkadza? Jezeli Mozna to prosze odpowiedz po polsku :)


...

Thanks cYa

Dzieki
 
Fatal error: Call to a member function fetch() on a non-object in C:\Documents and Settings\JAVIER PLATA\Mis documentos\javier\cosas javier\xampp\htdocs\shopsystem\shopsystem.php on line 54
:S help plz
 
:S help plz
2 possible reasons:
* you did not add all tables from install tutorial in first post
* you don't have any offer in database (sampel in first post)
Someone had same problem, but I dont remember what was wrong :p
------------------------------------
About shop: I get 250+ euro in 10 days from SMSes :p
I sell pacc for 1 euro(I get ~0.25 euro)/2 weeks and addons for 0.5 euro (I get ~0.12 euro) for 1 :)
If you have any bank tranfer/SMS -> rl cash/points in shop system you can easy get cash for dedic.
Posiadam Acc maker by gersior 0.3 (do silnika w wersji 0.2.13 ) a teraz dodalem gesior shop i gry naciskam w acc makerze Login albo Create Account to przekierowuje mnie na localhost :/ Co mam zrobic zeby dzialalo dobrze? Czy moze byc tak ze to shop mi przeszkadza? Jezeli Mozna to prosze odpowiedz po polsku
Sorry for polish, but I dont answer/send priv. msgs on forum and he need help
Jak masz acc. maker 0.3 to nie musisz instalowac skryptow PHP shopa tylko w config/config.ini zmienic "shop_system" na z 0 na 1 lub z "no" na "yes"
Jesli shop dziala dobrze, a tylko to przekierowanie zle to wejdz w config/config.ini i zmien page_path = ""
na swoj adres servera, np. "http://gesiorserv.hopto.org" lub swoje IP i juz przyciski beda cie kierowac na dobry adres.
 
Last edited:
Gesior, mobileart one web for Send cash for SMS, i can be too make it?
 
I am trying the shopsystem and only it me goes of giving days of premium. For that the articles it does not give them to me?
 
PHP:
if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5')
{
	$passwordency = 'md5';
}
elseif(strtolower($config['server']['passwordType']) == 'sha1')
{
	$passwordency = 'sha1';
}
sha1 exists only on newest TFS?

#Edit:
Lol :/.
You can make two versions:
- newest TFS
- older TFS

That's really shy. :|

#Edit2:
It look how, the code writing two people.

#Edit3:
Lol, one time:
PHP:
$SQL->query($save_transaction);
and one time:
PHP:
$_GLOBAL[code=sql]->query($save_transaction);

#Edit4:
One time you use {, and one time not use. :F
 
Last edited:
htdocs\shopsystem\pot\OTS_Account.php on line 371 ;/
i use newest tfs 8.21/8.22
 
Last edited:
error:

Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\gesiorshop\shopsystem.php on line 54
 
Why With The system My Character Dosent Recive The Item That He buyed with The POints

Xanix Your account 50x Chicken Feather 23 August 2008, 15:25:47 Not realized yet.

Does Anyone Know ? i tryed relogin and still dosent work :S
 
i have TFS 0.2.12 and Gesior 0.3.0 for TFS 0.2.x

My Buy Points working and add points in account. I need shop offer. Please help my configuration. I have errors

Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\shopsystem.php on line 56

i add scripts:

\shopsystem\config\config.ini

server_path = "C:\Documents and Settings\komp\Pulpit\Mystic Spirit"
give_to_other_users = "yes"
shop_layout_name = "dirt"
admin_account = "1"

next i add:

-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 17
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
SQL_COMUNICATION_INTERVAL = SQL_interval * 1000
function onLogin(cid)
if(InitShopComunication == 0) then
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {})
InitShopComunication = eventServ
end
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end

function sql_communication(parameters)
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
result_plr = assert(con:execute("SELECT * FROM z_ots_comunication WHERE `type` = 'login';"))
todo = result_plr:fetch({}, "a")
while todo do
id = tonumber(todo.id)
action = tostring(todo.action)
delete = tonumber(todo.delete_it)
cid = getPlayerByName(tostring(todo.name))
if isPlayer(cid) == TRUE then
if action == 'show_msg' then
local msg_text = tostring(todo.param1)
local msg_type = todo.param2
doPlayerSendTextMessage(cid, msg_type, msgtext)
if delete == 1 then
delete = assert(con:execute("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";"))
end
elseif action == 'give_item' then
local itemtogive_id = tonumber(todo.param1)
local itemtogive_count = tonumber(todo.param2)
local container_id = tonumber(todo.param3)
local container_count = tonumber(todo.param4)
local add_item_type = tostring(todo.param5)
local add_item_name = tostring(todo.param6)
local b_head_slot = getPlayerSlotItem(cid, 1)
local b_necklace_slot = getPlayerSlotItem(cid, 2)
local b_backpack_slot = getPlayerSlotItem(cid, 3)
local b_armor_slot = getPlayerSlotItem(cid, 4)
local b_right_hand = getPlayerSlotItem(cid, 5)
local b_left_hand = getPlayerSlotItem(cid, 6)
local b_legs_slot = getPlayerSlotItem(cid, 7)
local b_feet_slot = getPlayerSlotItem(cid, 8)
local b_ring_slot = getPlayerSlotItem(cid, 9)
local b_arrow_slot = getPlayerSlotItem(cid, 10)
if b_arrow_slot.itemid == 0 or (b_left_hand.itemid == 0 and b_right_hand.itemid == 0) then
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeight(container_id, 1)
items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
full_weight = items_weight + container_weight
else
full_weight = getItemWeight(itemtogive_id, itemtogive_count)
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
doPlayerAddItemEx(cid, new_container)
itemtogive_id = container_id
else
local addeditem = doPlayerAddItem(cid, itemtogive_id, itemtogive_count)
end
local head_slot = getPlayerSlotItem(cid, 1)
local necklace_slot = getPlayerSlotItem(cid, 2)
local backpack_slot = getPlayerSlotItem(cid, 3)
local armor_slot = getPlayerSlotItem(cid, 4)
local right_hand = getPlayerSlotItem(cid, 5)
local left_hand = getPlayerSlotItem(cid, 6)
local legs_slot = getPlayerSlotItem(cid, 7)
local feet_slot = getPlayerSlotItem(cid, 8)
local ring_slot = getPlayerSlotItem(cid, 9)
local arrow_slot = getPlayerSlotItem(cid, 10)
if ring_slot.itemid == itemtogive_id or feet_slot.itemid == itemtogive_id or legs_slot.itemid == itemtogive_id or armor_slot.itemid == itemtogive_id or necklace_slot.itemid == itemtogive_id or head_slot.itemid == itemtogive_id or arrow_slot.itemid == itemtogive_id or left_hand.itemid == itemtogive_id or right_hand.itemid == itemtogive_id or backpack_slot.itemid == itemtogive_id then
if b_ring_slot.uid ~= ring_slot.uid or b_feet_slot.uid ~= feet_slot.uid or b_legs_slot.uid ~= legs_slot.uid or b_armor_slot.uid ~= armor_slot.uid or b_necklace_slot.uid ~= necklace_slot.uid or b_head_slot.uid ~= head_slot.uid or b_backpack_slot.uid ~= backpack_slot.uid or b_right_hand.uid ~= right_hand.uid or b_left_hand.uid ~= left_hand.uid or b_arrow_slot.uid ~= arrow_slot.uid then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop. You should re-login now to become sure your new item will not disappear if any error occur.')
delete = assert(con:execute("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";"))
assert(con:execute("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 not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'')
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 or give to friend 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. Please take items from both hands or item from arrow slot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
end
todo = result_plr:fetch (todo, "a")
end
con:close()
env:close()
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
end

i am save this and error :blink: please help me.

I am so near already. :(

I from Poland. I little speak english, sorry :(
 
You have in database table z_shop_ofert and other?
 
Hmm i have this

my.php

http://img91.imageshack.us/my.php?image=gesiorsz8.jpg

and this. This is a my offer sms shop

my.php

http://img129.imageshack.us/my.php?image=gesior2fd1.jpg

this is a Trans.Histrory I send sms on test sms

my.php

http://img233.imageshack.us/my.php?image=gesior3ac7.jpg

I am click Shop Offer and i have this error:

my.php

http://img123.imageshack.us/my.php?image=gesior4ah0.jpg

what i need make? Help please :thumbup:
 
New LUA function for TFS 0.2
PHP:
function sql_communication(parameters)
	dofile("./config.lua")
	env = assert(luasql.mysql())
	con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
    result_plr = assert(con:execute("SELECT * FROM z_ots_comunication WHERE `type` = 'login';"))
    todo = result_plr:fetch({}, "a")
    while todo do
		id = tonumber(todo.id)
        action = tostring(todo.action)
		delete = tonumber(todo.delete_it)
		cid = getPlayerByName(tostring(todo.name))
		if isPlayer(cid) == TRUE then
			local itemtogive_id = tonumber(todo.param1)
			local itemtogive_count = tonumber(todo.param2)
			local container_id = tonumber(todo.param3)
			local container_count = tonumber(todo.param4)
			local add_item_type = tostring(todo.param5)
			local add_item_name = tostring(todo.param6)
			local received_item = 0
			local full_weight = 0
			if add_item_type == 'container' then
				container_weight = getItemWeight(container_id, 1)
				items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
				full_weight = items_weight + container_weight
			else
				full_weight = getItemWeight(itemtogive_id, itemtogive_count)
			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)
					local iter = 0
					while iter ~= container_count do
						doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
						iter = iter + 1
					end
					received_item = doPlayerAddItemEx(cid, new_container)
				else
					local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
					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.')
					delete = assert(con:execute("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";"))
					assert(con:execute("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
		todo = result_plr:fetch (todo, "a")
	end
	con:close()
	env:close()
	local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
end
 
Last edited:
I can't use that if i use SQLITE?

I'm getting error when i try to put the codes into the SQLManager.

Help please?
 
Code:
Lua Script Error: [CreatureScript Interface] 
in a timer event called from: 
data/creaturescripts/scripts/login.lua:onLogin

data/creaturescripts/scripts/login.lua:50: attempt to call global 'getItemWeight' (a nil value)
stack traceback:
data/creaturescripts/scripts/login.lua:50: in function <data/creaturescripts/scripts/login.lua:17>

using tfs 0.3(alpha 1) posted by elf. (The Forgotten Server v0.3 alpha 1)
 
Code:
Lua Script Error: [CreatureScript Interface] 
in a timer event called from: 
data/creaturescripts/scripts/login.lua:onLogin

data/creaturescripts/scripts/login.lua:50: attempt to call global 'getItemWeight' (a nil value)
stack traceback:
data/creaturescripts/scripts/login.lua:50: in function <data/creaturescripts/scripts/login.lua:17>

using tfs 0.3(alpha 1) posted by elf. (The Forgotten Server v0.3 alpha 1)
If you use new TFS 0.3 you must change all:
getItemWeight(
to:
getItemWeightById(
 
Back
Top