08.10.2013, 21:17
In the command put:
pawn Код:
SetTimerEx("Release", 1000, false, "i", targetid); // Jail the target for 45 seconds
// Somewhere else
forward Release(playerid);
public Release(playerid)
{
if(GetPVarInt(playerid, "JailTime") <= 0)
{
// He's released from jail, do something
return 1;
}
else
{
new str[50];
format(str, sizeof(str), "You will be released in: %d", GetPVarInt(playerid, "JailTime"));
SendClientMessage(playerid, -1, str); // Change it if you want
}
SetPVarInt(playerid, "JailTime", GetPVarInt(playerid, "JailTime") - 1); // Decrease the player's jail time
SetTimerEx("Release", 1000, false, "i", playerid);
return 0;
}