fuzzyDCR Posted April 27, 2011 Posted April 27, 2011 I would like a direct deposit option on jobs. I am wondering if anyone is interested in making this for me. What i would like it to do is have an option where you lose 5% of your daily wage from your job, but instead of having it go directly to your pocket it would deposit it in the city bank. You would have the option to turn this on or off at the bank I would think...or maybe at your job...either way Instead of having the pay be sitting in your account and vultures taking it all from you the second you get it, you would have the option to have it direct deposited. Quote
bineye Posted April 27, 2011 Posted April 27, 2011 I'd imagine an if statement would do it. Adding a field into users, for direct deposit (I know, I know, the users table has 600 million fields already) but this is directly related to the user, 0 for no and 1 for yes. Then into your day cron, if ($query['DIRECT_DEPOSIT_FIELD_NAME'] == 1) { code for updating users, setting bank money = bank money + (job money*0.95) } else { code for updating users, setting money = money + job money } Obviously this isn't the full code, but merely the jist of it, but in other posts you said you like to learn it on your own, so I left the rest for you to figure out. Any problems, I'm happy to help. Good luck =) Quote
lucky3809 Posted April 27, 2011 Posted April 27, 2011 Make a table call it direct deposit add id,userid,percentage,direct_option <--this field add enum and off,on.... Then do the $percentage=calculations then add a few querys in your job page and a few IF statements.... it's really simple... I actually am going to do this to items like roguevampires.net has... but at the moment im working on gangs... Quote
fuzzyDCR Posted April 28, 2011 Author Posted April 28, 2011 hmmm interesting Bineye when you get time stop by. I want to run a few things by you. I did something that somewhat worked, but it automatically deposited any money in pocket. I only want to happen when the job pays out at game reset. Quote
rulerofzu Posted April 28, 2011 Posted April 28, 2011 Automatically.... Jobs run in the cron hour at 5pm. So all you need do is adjust the query to deduct 5% of the amount. Either in the update query or do a new query to get the money to be paid, reduce it and then change the query so it gets deposited into their bank account rather than to hand. Optional.... Set it as a preferences option for the player which updates a new table like lucky suggested That way your not adding to the 600million :D fields in the users table. Check if set to bank or money and then continue as above. Either way it all goes in the cron. Give it a try if you cant get it working post what you tried and we can all help you adjust it! 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.