Jump to content
MakeWebGames

Stock Market. Working + Secured


Recommended Posts

I have made this stock market for people to use, i was going to sell but then thought about rather releasing as i have been releasing alot paid lately.

I mainly made this for a client who had the old stock market but insecure and useless.

Stocks can crash on here, if a stock crashes. The user will loose their shares.

So well. Here we go.

Create file stocks.php And add:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Now Run these SQLs:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Now add this code to your five minute cron/timestamp.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Now the staff panel. Call it staff_stocks.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Links:

Stocks<hr />

-> Edit Stock

-> Add Stock

-> Delete Stock

 

This can be seen working on http://www.convictsunleashed.com/demo/ , The cron on the test site is built into the stocks.php so people can see the change.

The mod was tested by me & karlos. But created by me. Enjoy!

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

Re: [mccode v2] Stock Market. Working + Secured

Great mod as far as I can see. I found that there is 1 error. When you add a stock, lets say for 2 k for ex. When it loses a little money, the whole amount goes negative. See below, the stock is still positive, but its listed as negative.

 

Stock Name Stock Orig Price Stock Now Price Price Change View

Smigs $2,000 - $1,859 - $169 ? Buy Or View

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

Look's fine to me....

NOTE I Only just added Sake thats why it hasnt gone up or down.....

finaldestinationonline1.jpg

My one look's a little different to the original as i have changed the table's and so on to match the rest of the game.....

But all credit due to Haunted Dawg for the mod +1 HD

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

Quite nice, though i tried it, and you can win quite a load of cash, as stock prices would change upon each page refresh... not a good idea to allow this. besides that, the only note is the negative "price now". if it goes to minus, you could/should restrain it to either 0 and/or make users that have those stock shares, to lose them as price hits 0. ;)

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

first thing is he added the cron to the page to show you how it would change, that is not in the real code....

2nd there is one error if you have 100 dollars on hand and the stock is at 100 you cant buy it

it should only be a <money rather then <=money

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

@ JDS: It show's a - infront of the now price to show that the user is loosing out on cash. It never went negative.

@ Lithium: On the demo site it's setup to be on the page per load. As i do not run cron's atm on the test site. So therfor i tell people to put it in the 5 minute cron to change every five minute's.

@ Bocco: if <= is set as far as i know it's set to be if lower or equal to that price then say no.

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

Due to some of you misserable little kids/bastar*s, i have locked down almost all editing now from the demo site.

To that little person who think's they ruining my life by putting "Killah i hate you you fu**ing n00b, im going to ruin your life!" Think again.

To that little person who hate's black's. Good for you keep it to your self, IM NOT BLACK!

To that little person who hates cyanide.. goood for you, take it up to him and say it in his face.

AND!

to that little person who hates bluedevil23's gym. STFU it's better than what you could ever make in your entire life...

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

 

Stock Name Stock Orig Price Stock Now Price Price Change View

BT $2,000 - $1,651 - $205 ? Buy Or View

Microsoft $15,000 + $15,106 - $129 ? Buy Or View

Death-Wars HQ $200,000 - $199,602 - $163 ? Buy Or View

Abbey $20,000 - $19,906 - $214 ? Buy Or View

McDonalds $15,000 - $14,830 - $45 ? Buy Or View

 

Stock Name BT

Price Change + $160 ?

Original Price $2,000

Now Price $1,811

I'm guessing that's not right?

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

 

Stock Name BT

Price Change + $160 ?

Original Price $2,000

Now Price $1,811

I'm guessing that's not right?

 

This can be right... overall progression might had the stock price lowered to let's say... $1651, and at last update increased by $160 to $1811, maintining the price lower than original sell price...

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

Good job Killah :)

one thing though:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Don't declare a function inside a loop, your only slowing your script down, because the function is being called on every iteration.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

i have tried to add a limit to how many stock you can buy, but every time i try something it doesn't work, is it possible so one can add one then repost the code?

Thanks in advance

Link to comment
Share on other sites

Re: [mccode v2] Stock Market. Working + Secured

This is really good. Seems like a quality modification and unlike most "awesome coders" around here you actually give quality freebies, will totally be looking into this and learning from it. Thanks. :-D

Link to comment
Share on other sites

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