Curt Posted December 26, 2010 Posted December 26, 2010 I have modified a version of Lithium's Item Market mod. Original Post and mod can be found here : [mccode 1.x & 2.x] Item market I did not create this feature from scratch, I simply modified Lithium's version to include the following features: - SHOWS ONLY ITEMS ON MARKET - ITEM QUANTITY - SAME PRICE ITEMS BY SAME USER STACKS - SELL ITEMS FOR MONEY AND/OR POINTS I did develop this feature to use with my new game BushidoBattle.com so you will see that crystals are called points...but the database query's still reference crystals from the database... Any problems post them and I will see about fixing them...as of it works good for me on my offline server :) Here ya go enjoy and big thanks to Lithium for creating most of it :P SQL ENTRIES - Two additions to the itemmarket table - one for points and one for quanity You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. itemmarket.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Next post will be the imadd.php page as it needed to be edited aswell... Quote
Curt Posted December 26, 2010 Author Posted December 26, 2010 imadd.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Hope some of you will find it useful :) Quote
Zan Posted December 26, 2010 Posted December 26, 2010 Woooh...Nice upfate..i tested this in my mccodes v2 game...and its working..no bugs..Nice work pal..Shall i post screenies? Quote
Uridium Posted December 26, 2010 Posted December 26, 2010 Nice work Curt :) can i make a suggestion.. Regards the points (crystals) Wouldnt this feature work better if the current buy rate from the points/crystals market also made an impact on the items market if you choose to buy by points/crystals what i mean is say i put a sword up for 100 points/crystals and no-one buys it for 3 weeks and the average selling per point/crystal on the points/crystal market has risen then buying from the items market wouldnt be true to the selling part... Quote
halfbaked Posted December 26, 2010 Posted December 26, 2010 Can someone help me merge this with the crystal market? I have tried merging files before but still learning and i had major issues with last merge. Quote
Jordan Palmer Posted December 26, 2010 Posted December 26, 2010 Can someone help me merge this with the crystal market? I have tried merging files before but still learning and i had major issues with last merge. What do you mean Merge? Quote
Lithium Posted December 26, 2010 Posted December 26, 2010 I think halfbaked means making item market and crystal market the same, which as it is now... it would need a big rewrite of the code. @Curt: Nice job :) Quote
Curt Posted December 26, 2010 Author Posted December 26, 2010 Nice work Curt :) can i make a suggestion.. Regards the points (crystals) Wouldnt this feature work better if the current buy rate from the points/crystals market also made an impact on the items market if you choose to buy by points/crystals what i mean is say i put a sword up for 100 points/crystals and no-one buys it for 3 weeks and the average selling per point/crystal on the points/crystal market has risen then buying from the items market wouldnt be true to the selling part... I dont think i understand fully what you mean ? So what your saying is...if someone posts a item for 100 points/crystals and at the time of posting the points average value is say 100$ per point... Then 3 weeks later points value will be 250$...your saying the posted market price should raise too ? I think this should be the sellers responsibility personally :P But it is an interesting thought ;) Thanks everyone for positive replies :D Quote
halfbaked Posted December 26, 2010 Posted December 26, 2010 I was thinking it would be nice to be able to sell the crystals/points in the item market like you could weapons and such thought it would be like 3 lines of code but that could be why i messed up last merge but this does work great the way it is. Thanks Lithium for letting me know it would be a major rewrite. Quote
Diesl Posted December 26, 2010 Posted December 26, 2010 Just a little optimization note. When you are doing a SELECT, only grab the columns that you need, not all. It will decrease the time needed for a database query. You won't much of a difference if you are pulling up a few rows, but once you get into the hundreds, and possibly add on a few more columns, you will notice a difference. ex. use ---> SELECT imQTY FROM itemmarket ......... instead of --> SELECT * FROM itemmarket Quote
Curt Posted December 26, 2010 Author Posted December 26, 2010 Just a little optimization note. When you are doing a SELECT, only grab the columns that you need, not all. It will decrease the time needed for a database query. You won't much of a difference if you are pulling up a few rows, but once you get into the hundreds, and possibly add on a few more columns, you will notice a difference. ex. use ---> SELECT imQTY FROM itemmarket ......... instead of --> SELECT * FROM itemmarket Hello, Thanks, i am aware of the optimization methods. I did not optimize this mod to the fullest it could have been but why should I do all the work for you guys :P.. btw should not be much of a speed difference seeing as there is few data columns in the itemmarket... but thanks for the thought :) Quote
Curt Posted December 26, 2010 Author Posted December 26, 2010 Small bug fixed. line 83: change : You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. to: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Top post updated... Thanks everyone. Quote
Curt Posted December 27, 2010 Author Posted December 27, 2010 lol...i am surprised no one noticed this :P ANOTHER BUG - MAJOR BUG !!! line 62: mysql_query("UPDATE `users` SET `money`=`money`+$MONEYBACK, `crystals`=`crystals`+$POINTSBACK WHERE `userid`={$ir['userid']}",$c); remove that entire query...my fault guys..lol I had it when a player removed their items it would credit them the price they set for their item...lol This could have been a real economy killer... Top post updated Quote
Menice Posted December 27, 2010 Posted December 27, 2010 em Market Select the item type you want to buy from the dropdown boxes. If there is any item fro sale it will show you the links to it. Warning: Invalid argument supplied for foreach() in /home/pete/public_html/itemmarket.php on line 376 Thats what i get? Quote
Curt Posted December 27, 2010 Author Posted December 27, 2010 Hey, did you add these data rows to your itemmarket table in your database ? You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Menice Posted December 27, 2010 Posted December 27, 2010 Hey, did you add these data rows to your itemmarket table in your database ? You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Yes I did I've tried everything to get it fixed it's weird I've never seen that error before on anything. Quote
Lithium Posted December 27, 2010 Posted December 27, 2010 Check your items names for ' in the middle of the names or some odd character, if you have them you need to escape it \ ... or simply paste the code to see where the issue resides Quote
Lithium Posted December 29, 2010 Posted December 29, 2010 Theres no link to sell the items :S It is not supposed to have it... Quote
Navid Posted December 29, 2010 Posted December 29, 2010 Then whats the point of having an item market if a player cant sell anything on it? Quote
Curt Posted December 29, 2010 Author Posted December 29, 2010 lol... click on your inventory and put an item on the market from there.... should be a link next to the item to put it on the market :P Quote
Lithium Posted December 29, 2010 Posted December 29, 2010 Then whats the point of having an item market if a player cant sell anything on it? If you already have the Sell option on your inventory, what is the point to have the same option on the market where you go to buy not to sell? Quote
ashbow97 Posted December 29, 2010 Posted December 29, 2010 Right, this looks awesome... but I'm having some problems. It might be because I'm using the lite version... but I'm told V1 and the Lite version work the same (not sure). But anyway, whenever I type in the Mysql query thing, it keeps saying thay yje table ...itemmarket doesn't exist :S Any help? Thanks, Ash :D Quote
Lithium Posted December 29, 2010 Posted December 29, 2010 Right, this looks awesome... but I'm having some problems. It might be because I'm using the lite version... but I'm told V1 and the Lite version work the same (not sure). But anyway, whenever I type in the Mysql query thing, it keeps saying thay yje table ...itemmarket doesn't exist :S Any help? Thanks, Ash :D Quite right. Item market doesn't exist on Lite, though you have another mod from nicholas where you have the full tables to use on item market. Nicholas Mod So choose your best option, and decide. My version is plain replacement, Curt's mod has a few things added, Nichola's one has logs added to it. Nichola's one might be the best choice has you don't have the tables (sorry Curt :P) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.