Jump to content
MakeWebGames

Recommended Posts

Posted

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...

Posted

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...

Posted
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

Posted

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.

Posted

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

Posted

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 :)

Posted

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.

Posted

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

Posted

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?

Posted
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.

Posted

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

Posted
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?

Posted

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

Posted
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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...