shrek1609 Posted May 31, 2009 Posted May 31, 2009 Re: Using time? isn't there a typo here... if(!$ir['item_recieved']) { if(date('g') <= 7 && date('g') >= 9) { echo 'You landed it, and it is the right time! You just found item x'; item_add($ir['userid'], 59, 1); } } shouldn't it be if(!$ir['item_recieved']) { if(date('h') <= 7 && date('h') >= 9) { echo 'You landed it, and it is the right time! You just found item x'; item_add($ir['userid'], 59, 1); } } g next to h typo me thinks :-D Quote
Haunted Dawg Posted May 31, 2009 Posted May 31, 2009 Re: Using time? No, date('g') is 7, date('h') is 07 Quote
shrek1609 Posted May 31, 2009 Posted May 31, 2009 Re: Using time? sorry haunted i thought it was just h for time... shouldn't the cron query be setting item_received back to 0 ready for the next day and a sql query in the if statement updating item_received to 1 ? Quote
Haunted Dawg Posted May 31, 2009 Posted May 31, 2009 Re: Using time? This: if(!$ir['item_recieved']) { if(date('g') <= 7 && date('g') >= 9) { echo 'You landed it, and it is the right time! You just found item x'; item_add($ir['userid'], 59, 1); } } Should be if(!$ir['item_recieved']) { if(date('g') <= 7 && date('g') >= 9) { echo 'You landed it, and it is the right time! You just found item x'; item_add($ir['userid'], 59, 1); mysql_query("UPDATE `users` SET `item_recieved` = 1 WHERE `userid` = ".$ir['userid']); } } Quote
legrolls Posted May 31, 2009 Author Posted May 31, 2009 Re: Using time? Still not working, I'm using v2, so I changed the mysql_query to $db->query, with no prevail 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.