06.12.2015, 15:12
I would save the current-time (using gettime()) and add the jailtime (60 seconds) to it and save it in a variable.
Suppose gettime() returns 500000, then save 500060 to that variable.
I would also run a permanent timer that checks every second if they're jailed (gettime() < jailtime).
And also check if they somehow left jail (exited the interior or moved further away than a certain radius) and spawns them again inside the jail to keep them there.
You can save that jailtime as well and check if they're still jailed upon connecting.
When they spawn after connecting and their jailtime hasn't ran out yet, spawn them inside the jail again.
It would be hard to cheat and stay out of jail when they're meant to be jailed that way.
Suppose gettime() returns 500000, then save 500060 to that variable.
I would also run a permanent timer that checks every second if they're jailed (gettime() < jailtime).
And also check if they somehow left jail (exited the interior or moved further away than a certain radius) and spawns them again inside the jail to keep them there.
You can save that jailtime as well and check if they're still jailed upon connecting.
When they spawn after connecting and their jailtime hasn't ran out yet, spawn them inside the jail again.
It would be hard to cheat and stay out of jail when they're meant to be jailed that way.