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

Gesior ACC Epic shop system!!!

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
Hello, as I promise I realise my shop system. I'm not good programmer so code can be optimised I think, but anyway it working perfectly.

Here is few photo:

0zzx4kk.png


gwhbIHE_.png



N-5tkoxf.png



create Mysql table:


CREATE TABLE IF NOT EXISTS `znote_shop_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`type` int(11) NOT NULL,
`itemid` int(11) NOT NULL,
`count` int(11) NOT NULL,
`time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

config-shop.php file put into config folder
shopsystem.php put into pages folder


Thats it enjoy your shopsystem. You can edit whatever you want. Anyway if you change something in shopsystem.php file you need change config/shop-system.php file aswell :)
 

Attachments

I didn't tested it but it looks awesome! Good job!
Hope it's useful for someone. :)
 
Thanks for znote. Thats why in gesior is a little bit znote :)

Code talkactions
Code:
-- Znote Shop v1.0 for Znote AAC on TFS 1.0+.
function onSay(cid, words, param)
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
local cooldown = 15 -- in seconds.
local player = Player(cid)
if player:getStorageValue(storage) <= os.time() then
player:setStorageValue(storage, os.time() + cooldown)
-- Create the query
local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. player:getAccountId() .. " LIMIT 1;")
-- Detect if we got any results
if orderQuery ~= false then
-- Fetch order values
local q_id = result.getDataInt(orderQuery, "id")
local q_type = result.getDataInt(orderQuery, "type")
local q_itemid = result.getDataInt(orderQuery, "itemid")
local q_count = result.getDataInt(orderQuery, "count")
result.free(orderQuery)
-- ORDER TYPE 1 (Regular item shop products)
if q_type == 1 then
-- Get wheight
if player:getFreeCapacity() >= ItemType(q_itemid):getWeight(q_count) then
db.query("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
player:addItem(q_itemid, q_count)
player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You have received " .. q_count .. " x " .. ItemType(q_itemid):getName() .. "!")
else
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Need more CAP!")
end
end
-- Add custom order types here
-- Type 2 is reserved for premium days and is handled on website, not needed here.
-- Type 3 is reserved for character gender(sex) change and is handled on website as well.
-- So use type 4+ for custom stuff, like etc packages.
-- if q_type == 4 then
-- end
else
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have no orders.")
end
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. player:getStorageValue(storage) - os.time())
end
return false
end
 
So you are using the command !shop which checks for orders (which is in znote aac) on a gesior aac which has a config of delivering items in 30 seconds (after that time you automatically get that item), I haven't tested this but I guess cloning items will be permeable since in gesior's config it delivers after 30 seconds and znote delivers once you say !shop, so to clone items you will wait for 30 seconds exactly after you buy and say !shop which will duplicate the item you receive since gesior's config will send you the item & so will the znote part... Quite ridiculous if you ask me, this !shop part is not needed.
 
Just took an look into the codes, idk if I would call this "epic" ..
Anyhow, thanks for your contribution keep improve.
 
So you are using the command !shop which checks for orders (which is in znote aac) on a gesior aac which has a config of delivering items in 30 seconds (after that time you automatically get that item), I haven't tested this but I guess cloning items will be permeable since in gesior's config it delivers after 30 seconds and znote delivers once you say !shop, so to clone items you will wait for 30 seconds exactly after you buy and say !shop which will duplicate the item you receive since gesior's config will send you the item & so will the znote part... Quite ridiculous if you ask me, this !shop part is not needed.
Really mate I don't know what about you talking, i'm 100% sure you can't dublicate items, because I create this script by myself. (ALL Shopsystem.php file) didnt coppied or something. So I know what i'm doing. I dont care which gesior acc has delivery item function, but I don't care. Simple thing. You buy an item, you put into database and with this function !shop u took it. Simple like 2+2.
 
Well no offence but I expected it to be better, you should try to look at the default script gesior uses and use parts of that, its alot easier if you use the globalevent type to load from database insted of a talkaction script.
And its not tapped that good at all.
Well try to give it another try with more of the gesior codes.
 
Nice shop but have a little bug. When you press cancel in the confirmation, the object is purchased
 
Back
Top