Ir para conteúdo

Market System by www [8.6]


Posts Recomendados

Script de sistema de leilão foi feito por VDK, mas foi editado para o sistema de mercado. Testado em tfs 0.4 para tibia 8.6.

Execute o seguinte código na database -

 

CREATE TABLE `auction_system` (`id` int(11) NOT NULL auto_increment,`player` int(11),`item_id` int(11),`item_name` varchar(255),`count` int(11),`cost` int(11),`date` int(11),`playername` int(11),PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;CREATE TABLE `auction_systembuy` (`id` int(11) NOT NULL auto_increment,`player` int(11),`item_id` int(11),`item_name` varchar(255),`count` int(11),`cost` int(11),`date` int(11),`playername` int(11),PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

 



Vá em data/talkactions/scripts, crie um arquivo .lua com o nome de marketsystem e adicione isso -

 

local config = {levelRequiredToAdd = 20,maxOffersPerPlayer = 20,SendOffersOnlyInPZ = true,blocked_items = {2165, 2152, 2148, 2160, 2166, 8918, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933, 11138, 7735, 10518, 10521, 2471, 8982, 9778, 9777, 9776 }}-- CREATED AUCTION SYSTEM BY vDK EDITED FOR MARKET SYSTEM BY SZMUGROSSfunction onSay(cid, words, param, channel)if(param == '') thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")return trueendlocal t = string.explode(param, ",")if(t[1] == "add") thenif((not t[2]) or (not t[3]) or (not t[4])) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")return trueendif(not tonumber(t[3]) or (not tonumber(t[4]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.")return trueendif(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.")return trueendlocal item = getItemIdByName(t[2], false)if(not item) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")return trueendif(getPlayerLevel(cid) < config.levelRequiredToAdd) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.")return trueendif(isInArray(config.blocked_items, item)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.")return trueendif(getPlayerItemCount(cid, item) < (tonumber(t[4]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).")return trueendlocal check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";")if(check:getID() == -1) thenelseif(check:getRows(true) >= config.maxOffersPerPlayer) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")")return trueendif(config.SendOffersOnlyInPZ) thenif(not getTilePzInfo(getPlayerPosition(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")return trueendendif(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.")return trueendif(t[5] == "yes") thenlocal itemcount, costgp = math.floor(t[4]), math.floor(t[3])local any = 0doPlayerRemoveItem(cid, item, itemcount)db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`, `playername`) VALUES (" .. any .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ", " ..getPlayerGUID(cid).. ")")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." x " .. t[2] .." for " .. costgp * itemcount .. " gps to offerts database.")elselocal itemcount7, costgp2 = math.floor(t[4]), math.floor(t[3])doPlayerRemoveItem(cid, item, itemcount7)db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`, `playername`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount7 .. ", " .. costgp2 ..", " .. os.time() .. ", " ..getPlayerGUID(cid).. ")")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount7 .." x " .. t[2] .." for " .. costgp2 * itemcount7 .. " gps to offerts database.")return trueendendif(t[1] == "buy") thenif((not t[2]) or (not t[3])) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")return trueendif(not tonumber(t[2])) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")return trueendlocal buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")if(buy:getID() ~= -1) thenif(getPlayerMoney(cid) < (buy:getDataInt("cost") * tonumber(t[3]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.")buy:free()return trueendif(tonumber(t[3]) < 1) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must write count.")return trueendif(tonumber(t[3]) > buy:getDataInt("count")) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can buy only "..buy:getDataInt("count").." this item!")buy:free()return trueendif(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("playername"))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.")buy:free()return trueendif(getPlayerFreeCap(cid) < getItemWeightById(buy:getDataInt("item_id"), tonumber(t[3])))thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a "..tonumber(t[3]).." " .. buy:getDataString("item_name") .. ". It weight " .. getItemWeightById(buy:getDataInt("item_id"), tonumber(t[3])) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.")buy:free()return trueendif(config.SendOffersOnlyInPZ) thenif(not getTilePzInfo(getPlayerPosition(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")return trueendendif(isItemStackable((buy:getDataString("item_id")))) thendoPlayerAddItem(cid, buy:getDataString("item_id"), t[3])elsefor i = 1, tonumber(t[3]) dodoPlayerAddItem(cid, buy:getDataString("item_id"), 1)endendif(tonumber(t[3]) == buy:getDataInt("count")) thendoPlayerRemoveMoney(cid, (buy:getDataInt("cost") * buy:getDataInt("count")))db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") * tonumber(t[3]) .. " gps!")db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("playername") .. ";")buy:free()elsedoPlayerRemoveMoney(cid, (buy:getDataInt("cost") * tonumber(t[3])))db.executeQuery("UPDATE `auction_system` SET `count` = `count` - " .. t[3] .. " WHERE `id` = " .. t[2] .. ";")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. t[3] .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") * tonumber(t[3]) .. " gps!")db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") * tonumber(t[3]) .. " WHERE `id` = " .. buy:getDataInt("playername") .. ";")buy:free()endelsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")endendif(t[1] == "remove") thenif((not tonumber(t[2]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")return trueendif(config.SendOffersOnlyInPZ) thenif(not getTilePzInfo(getPlayerPosition(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.")return trueendendlocal delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")if(delete:getID() ~= -1) thenif(getPlayerGUID(cid) == delete:getDataInt("playername")) thendb.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")if(isItemStackable(delete:getDataString("item_id"))) thendoPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count"))elsefor i = 1, delete:getDataInt("count") dodoPlayerAddItem(cid, delete:getDataString("item_id"), 1)endenddoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.")elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!")enddelete:free()elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")endendif(t[1] == "withdraw") thenlocal balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")if(balance:getDataInt("auction_balance") < 1) thendoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.")balance:free()return trueenddoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. balance:getDataInt("auction_balance") .. " gps from auction system!")doPlayerAddMoney(cid, balance:getDataInt("auction_balance"))db.executeQuery("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. getPlayerGUID(cid) .. ";")balance:free()endif (t[1] == "buyitem") thenif((not t[2]) or (not t[3]) or (not t[4])) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")return trueendif(not tonumber(t[3]) or (not tonumber(t[4]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.")return trueendif(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.")return trueendlocal item = getItemIdByName(t[2], false)if(not item) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")return trueendif(getPlayerLevel(cid) < config.levelRequiredToAdd) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.")return trueendif(isInArray(config.blocked_items, item)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.")return trueendlocal check = db.getResult("SELECT `id` FROM `auction_systembuy` WHERE `player` = " .. getPlayerGUID(cid) .. ";")if(check:getID() == -1) thenelseif(check:getRows(true) >= config.maxOffersPerPlayer) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")")return trueendif(getPlayerMoney(cid) < (tonumber(t[4]) * tonumber(t[3]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.")return trueendif(config.SendOffersOnlyInPZ) thenif(not getTilePzInfo(getPlayerPosition(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")return trueendendif(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.")return trueendif(t[5] == "yes") thenlocal itemcount, costgp = math.floor(t[4]), math.floor(t[3])local any = 0doPlayerRemoveMoney(cid, (itemcount * costgp))db.executeQuery("INSERT INTO `auction_systembuy` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`, `playername`) VALUES (" .. any .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ", " ..getPlayerGUID(cid).. ")")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp * itemcount .. " gps to offerts database.")elselocal itemcount7, costgp2 = math.floor(t[4]), math.floor(t[3])doPlayerRemoveMoney(cid, (itemcount7 * costgp2))db.executeQuery("INSERT INTO `auction_systembuy` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`, `playername`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount7 .. ", " .. costgp2 ..", " .. os.time() .. ", " ..getPlayerGUID(cid).. ")")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount7 .." " .. t[2] .." for " .. costgp2 * itemcount7 .. " gps to offerts database.")return trueendendif(t[1] == "sell") thenif((not t[2]) or (not t[3])) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")return trueendif(not tonumber(t[2])) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")return trueendlocal buy = db.getResult("SELECT * FROM `auction_systembuy` WHERE `id` = " .. (tonumber(t[2])) .. ";")if(buy:getID() ~= -1) thenif(not isItemStackable((buy:getDataString("item_id")))) and (tonumber(t[3]) > 1 ) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can sell max 1 per once time.")return trueendif(tonumber(t[3]) < 1 or tonumber(t[3]) > 100 ) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must write count 1-100.")return trueendif(tonumber(t[3]) > buy:getDataInt("count")) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can sell only "..buy:getDataInt("count").." this item!")buy:free()return trueendif(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("playername"))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't sell item to your auction.")buy:free()return trueendlocal item = buy:getDataString("item_id")if(getPlayerItemCount(cid, item) < (tonumber(t[3]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).")return trueendif(config.SendOffersOnlyInPZ) thenif(not getTilePzInfo(getPlayerPosition(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.")return trueendendif(tonumber(t[3]) > buy:getDataInt("count")) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can sell only "..buy:getDataInt("count").." this item!")buy:free()return trueendlocal idplayer = buy:getDataString("playername")if(isItemStackable((buy:getDataString("item_id")))) thenlocal ls = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..idplayer.." ORDER BY `sid` DESC LIMIT 1")db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..idplayer..", "..(ls:getDataInt("sid")+1)..", 102, "..item..", "..tonumber(t[3])..", '"..(tonumber(t[3]) > 1 and string.format("%x",tonumber(t[3])) or '').."')")elselocal ls2 = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..idplayer.." ORDER BY `sid` DESC LIMIT 1")for i = 1, tonumber(t[3]) dodb.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..idplayer..", "..(ls2:getDataInt("sid")+1)..", 102, "..item..", "..tonumber(t[3])..", '"..(tonumber(t[3]) > 1 and string.format("%x", tonumber(t[3])) or '').."')")endendif(tonumber(t[3]) == buy:getDataInt("count")) thendoPlayerRemoveItem(cid, buy:getDataString("item_id"), buy:getDataInt("count"))db.executeQuery("DELETE FROM `auction_systembuy` WHERE `id` = " .. t[2] .. ";")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sell " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") * buy:getDataInt("count") .. " gps!")db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. getPlayerGUID(cid) ..";")buy:free()elsedoPlayerRemoveItem(cid, buy:getDataString("item_id"), tonumber(t[3]))db.executeQuery("UPDATE `auction_systembuy` SET `count` = `count` - " .. t[3] .. " WHERE `id` = " .. t[2] .. ";")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sell " .. t[3] .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") * tonumber(t[3]) .. " gps!")db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") * tonumber(t[3]) .. " WHERE `id` = " .. getPlayerGUID(cid).. ";")buy:free()endelsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")endendif(t[1] == "canceladd") thenif((not tonumber(t[2]))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")return trueendif(config.SendOffersOnlyInPZ) thenif(not getTilePzInfo(getPlayerPosition(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.")return trueendendlocal delete = db.getResult("SELECT * FROM `auction_systembuy` WHERE `id` = " .. (tonumber(t[2])) .. ";")if(delete:getID() ~= -1) thenif(getPlayerGUID(cid) == delete:getDataInt("playername")) thendb.executeQuery("DELETE FROM `auction_systembuy` WHERE `id` = " .. t[2] .. ";")if(isItemStackable(delete:getDataString("item_id"))) thendb.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. delete:getDataInt("cost") * delete:getDataInt("count") .. " WHERE `id` = " .. delete:getDataInt("playername") .. ";")elsefor i = 1, delete:getDataInt("count") dodb.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. delete:getDataInt("cost") * delete:getDataInt("count") .. " WHERE `id` = " .. delete:getDataInt("playername") .. ";")endendlocal itemids = delete:getDataInt("item_id")doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert "..delete:getDataInt("count").. "x " ..getItemNameById(itemids).. " has been deleted from offerts database.")elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!")enddelete:free()elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")endendreturn trueend

 



Agora em WWW(POLISH) -

 

<?PHP$page = $_REQUEST['page'];$offset = $page * 25;//$auctions = $SQL->query('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC')->fetchAll();$auctionsbuy = $SQL->query('SELECT `sab`.`playername` AS `player`, `sab`.`player` AS `any`, `p`.`name` AS `name`, `sab`.`id` AS `id`, `sab`.`item_name` AS `item_name`, `sab`.`item_id` AS `item_id`, `sab`.`count` AS `count`, `sab`.`cost` AS `cost`, `sab`.`date` AS `date`FROM `auction_systembuy` sabLEFT JOIN `players` p ON `p`.`id` = `sab`.`playername`ORDER BY `sab`.`id` ASCLIMIT 25 OFFSET '.$offset)->fetchAll();$auctions = $SQL->query('SELECT `sa`.`player` AS `player`, `p`.`name` AS `name`, `sa`.`id` AS `id`, `sa`.`item_name` AS `item_name`, `sa`.`item_id` AS `item_id`, `sa`.`count` AS `count`, `sa`.`cost` AS `cost`, `sa`.`date` AS `date`FROM `auction_system` saLEFT JOIN `players` p ON `p`.`id` = `sa`.`player`ORDER BY `sa`.`id` ASCLIMIT 25 OFFSET '.$offset)->fetchAll();$players = 0;$main_content .= $main_content .= '<script type="text/javascript">function pokazdiv(el){for(var i=1; i<=3; i++){old = document.getElementById(el).style.olddisplayif(el == i){document.getElementById(el).style.display = "block";}else{document.getElementById(i).style.display = "none";}}}</script>';$main_content .= '<div id="1"><button onclick="$(\'#desc1\').toggle();" >Pokaż/Uktyj Opis</button><TABLE id="desc1" BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Instrukcja<b></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><center><h2>Komendy</h2><b>!offer add, nazwaRzeczy, Cena, ilość, yes jeżeli anonimowy</b><br /><small>example: !offer add, plate armor, 500, 1, yes or empty</small><br /><br /><B>!offer buy, id_Oferty, ilośc</b><br /><small>example: !offer buy, 1943, 1</small><br /><br /><b>!offer remove, id_Oferty</b><br /><small>example: !offer remove, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Użyj tej opcji, aby wybrać pieniądze za sprzedane rzeczy.</small></center></TR></TD></TABLE><br />';if(empty($auctions)){$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Oferty</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Aktualnie nie ma żadnej aktywnej oferty.</TD></TR></TABLE>';$main_content .= '<TABLE id="gradient-styles" BORDER=0 CELLSPACING=1 CELLPADDING=4 width=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD onclick="pokazdiv(\'1\');" COLSPAN=1 CLASS=white><B>Oferty Sprzedaży</B></TD><TD onclick="pokazdiv(\'2\');" COLSPAN=1 CLASS=white><B>Oferty Kupna</B></TD></TR></table><br><br>';}else{foreach($auctions as $auction) {$players++;if(is_int($players / 2))$bgcolor = $config['site']['lightborder'];else$bgcolor = $config['site']['darkborder'];$cost = round($auction['cost']/1000, 2);$content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$auction['id'].'</center></TD><TD><center><img src="./images/items/'.$auction['item_id'].'.gif"/></center></TD><TD><center>'.$auction['item_name'].'</center></TD><TD><center>';if ($auction['player'] != '0')$content .= '<a href="?subtopic=characters&name='.urlencode($auction['name']).'">'.$auction['name'].'</a>';else$content .= '<b>Anonimowy</b>';$content .= '</center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.'k<br /><small>'.$auction['cost'].'gp</small></center></TD><TD><center>!offer buy, '.$auction['id'].'</center></TR>';}$main_content .= '<TABLE id="gradient-styles" BORDER=0 CELLSPACING=1 CELLPADDING=4 width=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD onclick="pokazdiv(\'1\');" COLSPAN=1 CLASS=white><B>Oferty Sprzedaży</B></TD><TD onclick="pokazdiv(\'2\');" COLSPAN=1 CLASS=white><B>Oferty Kupna</B></TD></TR></table><br><br>';$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>#</center></b></TD><TD class="white"><b><center>Nazwa Rzeczy</center></b></TD><TD class="white"><b><center>Gracz</center></b></TD><TD class="white"><b><center>Ilość</center></b></TD><TD class="white"><b><center>Cena</center></b></td><TD class="white"><b><center>Kup</center></b></td></TR>'.$content.'</TABLE>';$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><tr>';if($page >= 1)$main_content .= '<TD WIDTH=50% ALIGN=left VALIGN=bottom><A HREF="?subtopic='.$subtopic.'&page='.($page - 1).'" CLASS="size_xxs"><< Poprzednia Strona</A></TD>';$main_content .= '<TD WIDTH=50% ALIGN=right VALIGN=bottom><A HREF="?subtopic='.$subtopic.'&page='.($page + 1).'" CLASS="size_xxs">Nastepna Strona >> </A></TD></TR>';$main_content .= '</TABLE>';$main_content .= '<TABLE id="gradient-styles" BORDER=0 CELLSPACING=1 CELLPADDING=4 width=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD onclick="pokazdiv(\'1\');" COLSPAN=1 CLASS=white><B>Oferty Sprzedaży</B></TD><TD onclick="pokazdiv(\'2\');" COLSPAN=1 CLASS=white><B>Oferty Kupna</B></TD></TR></table><br><br>';$main_content .= '</div>';$main_content .= '<div id="2" style="display:none"><button onclick="$(\'#desc2\').toggle();" >Pokaż/Uktyj Opis</button><TABLE id="desc2" BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Instrukcja<b></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><center><h2>Komendy</h2><b>!offer buyitem, nazwaRzeczy, Cena, ilość, yes jeżeli anonimowy</b><br /><small>example: !offer add, plate armor, 500, 1, yes or empty</small><br /><br /><B>!offer sell, id_Oferty, ilośc</b><br /><small>example: !offer sell, 1943, 1</small><br /><br /><b>!offer canceladd, id_Oferty</b><br /><small>example: !offer canceladd, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Użyj tej opcji, aby wybrać pieniądze za sprzedane rzeczy.</small></center></TR></TD></TABLE><br />';if(empty($auctionsbuy)){$main_content .= '<TABLE id="gradient-styles" BORDER=0 CELLSPACING=1 CELLPADDING=4 width=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD onclick="pokazdiv(\'1\');" COLSPAN=1 CLASS=white><B>Oferty Sprzedaży</B></TD><TD onclick="pokazdiv(\'2\');" COLSPAN=1 CLASS=white><B>Oferty Kupna</B></TD></TR></table><br><br>';$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Oferty</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Aktualnie nie ma żadnej aktywnej oferty.</TD></TR></TABLE>';}else{foreach($auctionsbuy as $auctionb) {$playersb++;if(is_int($players / 2))$bgcolor = $config['site']['lightborder'];else$bgcolor = $config['site']['darkborder'];$costb = round($auctionb['cost']/1000, 2);$contentb .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$auctionb['id'].'</center></TD><TD><center><img src="./images/items/'.$auctionb['item_id'].'.gif"/></center></TD><TD><center>'.$auctionb['item_name'].'</center></TD><TD><center>';if ($auctionb['any'] != '0')$contentb .= '<a href="?subtopic=characters&name='.urlencode($auctionb['name']).'">'.$auctionb['name'].'</a>';else$contentb .= '<b>Anonimowy</b>';$contentb .= '</center></TD><TD><center>'.$auctionb['count'].'</center></TD><TD><center>'.$costb.'k<br /><small>'.$auctionb['cost'].'gp</small></center></TD><TD><center>!offer sell, '.$auctionb['id'].'</center></TR>';}$main_content .= '<TABLE id="gradient-styles" BORDER=0 CELLSPACING=1 CELLPADDING=4 width=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD onclick="pokazdiv(\'1\');" COLSPAN=1 CLASS=white><B>Oferty Sprzedaży</B></TD><TD onclick="pokazdiv(\'2\');" COLSPAN=1 CLASS=white><B>Oferty Kupna</B></TD></TR></table><br><br>';$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>#</center></b></TD><TD class="white"><b><center>Nazwa Rzeczy</center></b></TD><TD class="white"><b><center>Gracz</center></b></TD><TD class="white"><b><center>Ilość</center></b></TD><TD class="white"><b><center>Cena</center></b></td><TD class="white"><b><center>Sprzedaj</center></b></td></TR>'.$contentb.'</TABLE>';$main_content .= '<br><TABle BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><tr>';if($page >= 1)$main_content .= '<TD WIDTH=50% ALIGN=left VALIGN=bottom><A HREF="?subtopic='.$subtopic.'&page='.($page - 1).'" CLASS="size_xxs"><< Poprzednia Strona</A></TD>';$main_content .= '<TD WIDTH=50% ALIGN=right VALIGN=bottom><A HREF="?subtopic='.$subtopic.'&page='.($page + 1).'" CLASS="size_xxs">Nastepna Strona >> </A></TD></TR>';$main_content .= '</TABLE>';$main_content .= '<TABLE id="gradient-styles" BORDER=0 CELLSPACING=1 CELLPADDING=4 width=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD onclick="pokazdiv(\'1\');" COLSPAN=1 CLASS=white><B>Oferty Sprzedaży</B></TD><TD onclick="pokazdiv(\'2\');" COLSPAN=1 CLASS=white><B>Oferty Kupna</B></TD></TR></table><br><br>';$main_content .= '</div>';}}?>

 



Em talkactions.xml, adicione a seguinte tag -

<talkaction words="!offer" event="script" value="marketsystem.lua"/> 



Comandos:

!offer buy, itemName, Price, Count, yes ou empty -- !offer buy, Dragon Scale Mail, 6000, 1, yes [YES == anonimo ao postar](Expor ponto de venda)!offer buy, id offer, count -- !offer buy, 5, 1 (Para comprar um numero x de negocio do item)!offer remove, id offer -- !offer remove, 5 (Removendo ofertas)!offer buyitem, itemName, Price, Count, yes or empty -- !offer buyitem, Dragon Scale Mail, 7000, 3 , yes [YES == anonimo, se você não quer ser anonimo não coloque nada]!offer sell, id offer, count -- !offer sell, 7, 3 (venda x quantidade de oferta de compra do item)!offer canceladd, id offer -- !offer canceladd, 10 (Remoção de uma oferta para comprar item)!offer withdraw (Use essa opção para selecionar o dinheiro para os itens vendidos.)



Créditos - Szmugross

Editado por Bennyyw
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...