30.05.2014, 18:35
How can i make a command that jails players and they can't get out with relog they will get out when the time is gone .. If somone have the command please give me it and instructions ..
Create a boolean variable that you set to true when you jail a player.
Save the var in the player stats, load it when the player connects, and when he connects, if it's "true", re-jail him. Set the var to "false" when you unjail the player. |
new jailtime[MAX_PLAYERS];
jailtime[targetid] = 30;
new bool:jailed;
if(jailed) // Save the var to 1 in the player stats
else // Save the var to 0 in the player stats
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);
Then use a timer.
When you jail him, use SetTimerEx to call a function which will unjail the player. |