30.05.2014, 19:12
In my mind, it would be
Another method working, which reffer to yours but which wastes less performances : (I consider that the "time" var already contains the jailtime in minutes)
I guess you know the gettime() function, so of course it's better performances than setting a timer whichs repeats every seconds.
PHP код:
new bool:jailed;
if(jailed) // Save the var to 1 in the player stats
else // Save the var to 0 in the player stats
PHP код:
new jailtime[MAX_PLAYERS] = 0;
// In the jail command
jailtime[targetid] = gettime() + time*60; // If time is already in seconds, don't multiply per 60
// Save the jailtime var in the targetid stats, and when he connects, after data loading
if(jailtime[playerid] > gettime()) Jail(playerid);