POG1 Posted December 27, 2008 Posted December 27, 2008 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 Quote
Haunted Dawg Posted December 27, 2008 Posted December 27, 2008 Re: [mccode V2] Bank Investment Good job on this. Well done. Where's the cron or is there no need for a cron? Quote
POG1 Posted December 27, 2008 Author Posted December 27, 2008 Re: [mccode V2] Bank Investment no need for a cron ;) Quote
Haunted Dawg Posted December 27, 2008 Posted December 27, 2008 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. Quote
Lithium Posted December 27, 2008 Posted December 27, 2008 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 Quote
POG1 Posted December 27, 2008 Author Posted December 27, 2008 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 Quote
Lithium Posted December 27, 2008 Posted December 27, 2008 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! :) Quote
POG1 Posted December 27, 2008 Author Posted December 27, 2008 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 Quote
POG1 Posted December 27, 2008 Author Posted December 27, 2008 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 Quote
Zero-Affect Posted December 27, 2008 Posted December 27, 2008 Re: [mccode V2] Bank Investment interesting modification pog Quote
POG1 Posted December 27, 2008 Author Posted December 27, 2008 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. Quote
versus Posted December 28, 2008 Posted December 28, 2008 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. Quote
tobatz Posted December 28, 2008 Posted December 28, 2008 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: Quote
POG1 Posted December 28, 2008 Author Posted December 28, 2008 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. :( Quote
gurpreet Posted December 28, 2008 Posted December 28, 2008 Re: [mccode V2] Bank Investment Post a new reply with the new version. Quote
HITMAN 17 Posted December 29, 2008 Posted December 29, 2008 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 Quote
POG1 Posted December 29, 2008 Author Posted December 29, 2008 Re: [mccode V2] Bank Investment use this.. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 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.