Wait.... can I actually do it with the for loop in the function that checks every 2 hours? I just need to find the final number with math.
I guess I wont host a server more than 3 months. So that would make X the final number.... It should go like this
PHP Code:
for(new i = 0; i < X; i+= 7200); // 7200 seconds is 2 hours
Thn you take the variable where the spent time is hold and check if the variable equals to i... the key for the loop
You can just replace 7200 with 60 if your plugin checks every minute.