• 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

Hmm I have problem with sms shop system. I fill all informations in buy points.php and i want to send by dotpay sms. I recieve code and when i trying to write it in input text i have error: That code is incorrect :p

In polish:
Mam aktywowaną usługę dotpay i chcę dostać PACC za sms. wszystkie pola mam wypełnione ale gdy wpisuje poprawny kod (losowany z dotpay) wyskakuje mi błąd, że kod jest niepoprawny. W kodzie nic nie zmieniałem...
 
one problem

Hello,to explain this please place where I feel sorry for my ignorance on the subject.(database?¿in xampp,server)

PHP:
When you add new PACC offer you must set in offer table in database:
id - empty (auto_incement)
points - how many points cost this offer
count1 - number of PACC days this offer give
offer_type = "pacc"
offer_description - description of new pacc offer like: "Buy 5 days of PACC. With PACC you can visit new areas, fight stronger monsters and promote your character!"
offer_name - name of new pacc offer like: "5 Days of PACC"
 
Hello :) Can someone tell me how i can change the Temple position's on Geisor account page ? :)
 
Fel
SQL-fråga:

CREATE TABLE `z_shop_offer` (

`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`points` int( 11 ) NOT NULL default '0',
`itemid1` int( 11 ) NOT NULL default '0',
`count1` int( 11 ) NOT NULL default '0',
`itemid2` int( 11 ) NOT NULL default '0',
`count2` int( 11 ) NOT NULL default '0',
`offer_type` varchar( 255 ) default NULL ,
`offer_description` text NOT NULL ,
`offer_name` varchar( 255 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ALTER TABLE `accounts` ADD `premium_points` INT( 11 ) NOT NULL DEFAULT '0';



MySQL sa:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE `accounts` ADD `premium_points` INT( 11 ) NOT NULL DEFAULT '0'' at line 14


Help ?
 
how i can make shop to work in 03 beta i know its problem with global lua because now it is in lib folder but where i can change this?
 
how i can make shop to work in 03 beta i know its problem with global lua because now it is in lib folder but where i can change this?
beta 0.3 installation (test on alpha4):
in data/globalevent/globalevents.xml add:
PHP:
	<globalevent name="shop" interval="30" script="shop.lua"/>
in data/globalevent/shop.lua paste:
PHP:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL 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)
	                    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.')
	                    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
@Ates
ALTER TABLE `accounts` ADD `premium_points` INT( 11 ) NOT NULL DEFAULT '0';
Isn't needed now. Acc. maker add it when install.
 

To add a sd or uhs in shop use this
Code:
INSERT INTO `z_shop_offer`(`id`,`points`,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`)
VALUES (NULL , '25', '2268', '5', '2003', '20', 'item', 'BP Of SD with 5 charge!', 'Buy BP of SD'):

25 = kost 25 points
2268 = sd
5 = 5 charge
2003 = gray backpack same color as sd
20 = how manny sd's in 1 backpack.
BP Of SD with 5 charge = description
Buy BP of SD = name of the item

hope this helps you
 
problem with save 0

i repair problem with triggers i use this guid
Code:
 Skills not copying from Gesior AAC?
Well if they aren't copying at all (they start at 10 to begin with) and you want them to start at the level of whatever character you have as a sample then follow this tutorial.

NOTE: This has nothing todo with triggers, quite the opposite actually, you don't want triggers in this. You are going to make skills copy from the characters, not make them from scratch.


Step 1. - Delete the trigger that copies skills...
a. Goto phpmyadmin
b. Goto query window
c. enter this:
PHP Code:
DROP TRIGGER IF EXISTS yourdatabasename.oncreate_players 
(make sure to fill in your database name)

Step 2. - Edit the account creation file...
Code:

C:\xampp\htdocs\accountmanagement.php

a. Navigate to that URL, it should be similar if not the same than the one given)
b. Edit the file in notepad, and hit: Ctrl+f then enter
Code:

$loaded_items_to_copy = $SQL->query

c. That should have brought you to this
Code:

if($player->isLoaded()) {
					$loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
					foreach($loaded_items_to_copy as $save_item) {
						$SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
					}

d. Replace that with this:
Code:

				if($player->isLoaded()) {
					$loaded_skills_to_copy = $SQL->query("SELECT * FROM player_skills WHERE player_id = ".$char_to_copy->getId()."");
					foreach($loaded_skills_to_copy as $save_skills) {
						$SQL->query("INSERT INTO `player_skills` (`player_id` ,`skillid` ,`value` ,`count`) VALUES ('".$player->getId()."', '".$save_skills['skillid']."', '".$save_skills['value']."', '".$save_skills['count']."');");
	}
}
				if($player->isLoaded()) {
					$loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
					foreach($loaded_items_to_copy as $save_item) {
						$SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
					}

NOTE: This has not been checked for bugs, but if you really need this I recommend it, for some reason the AAC won't delete the character. So disable the ability to delete characters, thats what I did... (get rid of the delete button, and action) But yeah I hope I helped someone.

but now have other o.0 when i create chars dont create with save 0
same the samples

characters create with save 1 xS

who can help me?
 
Gesior I love you, you are the best programmer I have seen in all my life. Your AAC Maker is SOOOOO NICEEEE!!! IT IS VERY USEFUL!! THANK YOU VERY MUCH FOR YOUR WORK!!! :D

But I have a question xD

How to add the images of the items and the containers in $hop Offers?

Thanks.
SamerX
 
Last edited:
i get this error when i try to enter shop offers: Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\shopsystem.php on line 59
 
Hooooly shit! This worked, never thought it would.
Since I always get buggs when I try these things, but this was...100% !

Great gesior!
/Limannen
 
This globalevents thing is making the server lag. Isn't there a way to make it less laggy? It's like when you save or clean the map, it totally freezes.
 
@Up
try changing the event name: login to shopsystem or something like that :D
 
Back
Top