Join the forums now, and start posting to receive access to our Scripts Vault!
$now = date("U");$time_passed = $now - $user[last_res];
if($time_passed >= 90){ $units = floor($time_passed / 90); $time_left = $now - $units*90; $last_res = $now - $time_left;}
yes but what if in the time between the user has upgraded the building and that would raise his production per hour...? would i just start the script again or what ?does anyone know the game travian ? how do you think they've done it...?
Uhm yeah, I'd say exactly the opposite, wakish. If the were using Cronjobs, they'd need to executed every second to calculate everything for all the users.... And this would put a lot of stress on the server.They probably update each user individually when they are part of an action (being attacked, etc.). It's not really difficult to do, it's mostly just a lot of work.