Joshua Posted October 1, 2010 Posted October 1, 2010 Granted a lot of people are converting to time stamps which I feel is best. However, I noticed something in cron minute that is absolutely ridiculous to me and figured i'd post it up and the quick change. open cron_minute if you are still running it and find. $hc=$db->num_rows($db->query("SELECT * FROM `users` WHERE `hospital` > 0")); $jc=$db->num_rows($db->query("SELECT * FROM `users` WHERE `jail` > 0")); Now, i'm not sure why we are selecting every row in the users table here just to get a count. Simply change to $hc=$db->num_rows($db->query("SELECT `userid` FROM `users` WHERE `hospital` > 0")); $jc=$db->num_rows($db->query("SELECT `userid` FROM `users` WHERE `jail` > 0")); Nothing huge, not even minor enough to be called minor, but it bugged me >< Quote
Uridium Posted October 1, 2010 Posted October 1, 2010 im not even sure why hosp and jail are in the users table to be honest and the need of a 1 min cron you could simply create 2 new tables called hosp and jail and INSERT into with a timestamp or NOW() and let the script deduct the time then delete the user from either when times up. Quote
Joshua Posted October 1, 2010 Author Posted October 1, 2010 Agreed illusions, just something I noticed that bugged the hell out of me (: Have to take into consideration just about every game I've seen the code to uses the darn minute cron. It's a fairly high average of people Quote
Equinox Posted October 1, 2010 Posted October 1, 2010 I would do it like: Add two new rows to Users "Hospital" and "Jail" And then the timestamp would be something like: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then I would update users like such: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
mj12 Posted October 26, 2010 Posted October 26, 2010 Another way is to add add the timestamp to the hospital table, on the hospital page where you display users in the hospital do all your time calculations there to display how much longer the user will be in the hospital for. To remove them just 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.