• 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

Gesior ALWAYS help us? Are you sure? I'm not, now I'm sure Gesior wont help ya because he dont know how :(. We don't get the orange message? Rotfl, its not enought, we dont receive any items :cool:.

Actually its just about the login.lua, because the item its in queqe to be sent in z_offer~ (the sql table)
 
I put this directory: C:/Documents and Settings/Administrador/Escritorio/Eclipse - Real Map/TFS 0.3 rev. 815
and..



STEP 1
Check server configuration
Can't load file config.lua from C:/Documents and Settings/Administrador/Escritorio/Eclipse - Real Map/TFS 0.3 rev. 815/config.lua File doesn't exist in selected directory. Go to STEP 1 - select other directory.
 
I put this directory: C:/Documents and Settings/Administrador/Escritorio/Eclipse - Real Map/TFS 0.3 rev. 815
and..



STEP 1
Check server configuration
Can't load file config.lua from C:/Documents and Settings/Administrador/Escritorio/Eclipse - Real Map/TFS 0.3 rev. 815/config.lua File doesn't exist in selected directory. Go to STEP 1 - select other directory.

make the url tiner.
like C:/ot
 
U want this? C:/Eclipse - Real Map/TFS 0.3 rev. 815/config.lua

U want what i put this?
 
U want this? C:/Eclipse - Real Map/TFS 0.3 rev. 815/config.lua

U want what i put this?

humm, try change folder of your server directory, for example from Eclipse - Real Map/TFS 0.3 rev. to TFS <_<
 
I try Buy always give me a error oMG CAN change for other CONFIG.lua?
 
gesior say me what dowload notepad ++ and delete all green but doesn't work this xD

I need one solution
 
gesior say me what dowload notepad ++ and delete all green but doesn't work this xD

I need one solution

Ah, I know what he mean.. if you download notpad ++ then just open in it your config.lua and delete comment to functions (green font).

For example:

displayGamemastersWithOnlineCommand = "no" --rotfl, ownzo0r, pwnz0or

* Thats comment.
 
This Seems Very Complicated to Use.

I wish you didnt have to add all that stuff in the database...

Is it possible for you to make a script that adds it all by itself?
 
Elf rewriten login.lua script for LUA without SQL :)
I must ask him again for link, test on new trunk rev and post.



well its nice to get a response from you and i hope that soon you can get the updated version up for us all to enjoy.. Nice work on the AAC and this BTW
 
With me not work
Say

To: From: Offer name Bought on page Received on OTS
CM Big Net Your account 8x Golden Armor 15 June 2008, 14:38:47 Not realized yet.
CM Big Net Your account 50x Chicken Feather 15 June 2008, 15:52:17 Not realized yet.
CM Big Net Your account 50x Chicken Feather 16 June 2008, 12:29:31 Not realized yet.
 
bugvo7.jpg


I got this bug on 0.3 version. Here is my login.lua:


Code:
-- ### 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
	if getPlayerStorageValue(cid, 30001) == -1 then
		setPlayerStorageValue(cid, 30001, 1)
		doPlayerPopupFYI(cid, "Bem-Vindo ao Mastriny World. \n\n Mastriny é um mundo cheio de magia, onde você pode encontrar o que deve procurar a tempos: seriedade misturado com diversão. \n Abaixo daremos algumas informações que serão importante para o seu jogo: \n\n - O Mastriny World usa um mapa próprio, porém Mategaard se assemelha a Rookgaard (Tendo apenas essa cidade como excessão). Ou seja, \n     ao sair de Mategaard, você irá se deparar com um mundo novo. \n - Se você for se tornar um sorcerer ou druid, procure na sua cidade um NPC que lhe dará ou uma rod ou uma wand, dependendo de sua vocação. \n\n Se você tem mais alguma dúvida sobre o jogo, sinta-se livre para perguntar no Help Channel.")
	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, MESSAGE_INFO_DESCR, 'You received >> '.. add_item_name ..' << from Mastriny 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 Mastriny 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 Mastriny 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 Mastriny 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 Mastriny 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
 
Read all posts -.-, It doesnt work on 0.3 you need to re-write login.lua because 0.3 doesnt support luasql. =]
 
Can't someone rewrite it? I really don't understand about those things...
 
Back
Top