Dragon Blade Posted June 9, 2013 Posted June 9, 2013 Instead of the cron going work for your players why not them do it there self? So I decided to make something like that :) Also you will need to go on this thread to link into this - http://makewebgames.io/showthread.php/43543-Job-Addon Alter this - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Open up cron_hour.php and remove the job cron bit and then open up cron_day.php and add this somewhere - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Open up job.php and find - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Under that add - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then find - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Top of that add - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Replace your Job index function to this - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And your done! Quote
Dominion Posted June 9, 2013 Posted June 9, 2013 (edited) Well there is nothing wrong with this method I would like to give you some advice. I wouldn't keep adding things into the user table. For this you could create a Jobs table and store job done, when(timestamp), and remove the cron completely. might be something to think about? Edited June 9, 2013 by Dominion Quote
jay-dogg2009 Posted June 13, 2013 Posted June 13, 2013 A better way to do this is to have a modal dialog pop up when they visit jobs, prompting them to do the action, once clicked its all updated and doesn't show until the following day. Quote
KyleMassacre Posted June 14, 2013 Posted June 14, 2013 I would like to add something here too, and ill start from the top and work my way down. For your sql your adding besides it being in users table your using int 11, how big of numbers can you possibly need, 2 bill? Since you are posting this in V2 and mysql_ is going to be depreciated you can either do mysqli_query($c,"now your query"); or use $db-> query("you query here"); notice no connection var? This way since there is classes on v2 it gives people the option to switch back and forth between mysql and mysqli, in which the ladder is a bit safer and won't depreciate for a long time coming. For your functions you are adding you can get rid of the global vars your not using like for example your work () you can get rid of $c and $h. $c is your connection var which is not really needed here and $h is your header var which is commonly used for $h-endpage (), a die () replacement. and for both functions if you use the $db class you would have to add that to your global. Thats pretty much it, and I'm not nit-picking so don't take it that way I'm just letting you know for future reference cause just by looking at it this should still work. Good work and keep them coming 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.