Jump to content
MakeWebGames

Recommended Posts

Posted

Nothing huge but at least i am contributing! I haven't "extensively" tested this mod but it worked when have tried it out. Any improvements please suggest them :)

Create a file called "investment.php", paste this and save it

 

You're unable to view this code.

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

 

Go to phpMyadmin and run this SQL..

CREATE TABLE IF NOT EXISTS `investment` (

`user` int(11) NOT NULL,

`time` int(11) NOT NULL,

`amount` int(11) NOT NULL,

`collected` int(1) NOT NULL default '1'

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

hope it works

Posted

Re: [mccode V2] Bank Investment

Nice. I never had time to read over the code so i just asked the question insead. I see you are using time() inside the mysql function. But won't unix_timestamp()-???*??? be better? Just a simple question.

Posted

Re: [mccode V2] Bank Investment

are you sure? i see conditions where you have days count (duration of investments) and it seems you don't verify the amount of days the investment has taken... ;)

 

take 2

You have them there! sorry :D

Posted

Re: [mccode V2] Bank Investment

 

Nice. I never had time to read over the code so i just asked the question insead. I see you are using time() inside the mysql function. But won't unix_timestamp()-???*??? be better? Just a simple question.

they both do the same job ;)

 

take 2

You have them there! sorry :D

lol

Posted

Re: [mccode V2] Bank Investment

but i still have something to say! :P

ereg_replace() can and should be replaced for strtr() which is just a little bit faster, also... less print's and more formed html can speed it up! :)

Posted

Re: [mccode V2] Bank Investment

strtr looks interesting but how would i strip all non numeric chars? Also, i was going to use preg_replace but i read somewhere (cant remember) it is slower than ereg and i couldn't get the pattern to work lol

Posted

Re: [mccode V2] Bank Investment

 

I prefer

 

You're unable to view this code.

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

 

yeah i would of done something like that, or for the else set the variable to FALSE

Posted

Re: [mccode V2] Bank Investment

 

If the players want to play asshole and try and screw with the query, screw them and invest $0, blocking them from the bank for X period - always a nice touch.

good thinking lol. i will take a look at the code and post an updated version.

Posted

Re: [mccode V2] Bank Investment

 

If the players want to play asshole and try and screw with the query, screw them and invest $0, blocking them from the bank for X period - always a nice touch.

good thinking lol. i will take a look at the code and post an updated version.

And maybe add a

You're unable to view this code.

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

 

while you're add it. And also change this

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.

 

Otherwise people will only ever be able to use the investment fund once and never again.

Posted

Re: [mccode V2] Bank Investment

 

You're unable to view this code.

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

 

-i think you need to change 'collected'='0' to 'collected'='1' . The above condition will always returns "false" even if you have already invested.

-the amount of money you invest doesn't subtract from the total money you have.

nice mod though... :wink:

Posted

Re: [mccode V2] Bank Investment

 

If the players want to play asshole and try and screw with the query, screw them and invest $0, blocking them from the bank for X period - always a nice touch.

good thinking lol. i will take a look at the code and post an updated version.

And maybe add a

You're unable to view this code.

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

 

while you're add it. And also change this

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.

 

Otherwise people will only ever be able to use the investment fund once and never again.

I have made changes to it but there is no "edit" link for the first post. :(

Posted

Re: [mccode V2] Bank Investment

one other problem if you look at my investment on my game you will see that when you put an investment in it shows you the box at the bottom if you scroll down

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