15.03.2015, 02:49
Hi guys, I have this command for sending players to jail:
I want to remove the parameter "minute" and thus only be "/jail id" for a time of 1 minute fixed.
Here is the rest of the code:
Thanks for all the help, regards!
PHP код:
dcmd_jail(playerid, params[])
{
new jailedid, time, string[128];
if(sscanf(params, "ud", jailedid, time)) return SendClientMessage(playerid, -1, "/jail [id] [minutes]");
if(jailedid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player is not online.");
if(Jailed[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "The player is already jailed");
Jailed[playerid]=true;
SetTimerEx("Unjailtime", 60000 * time, false, "d", jailedid);
format(string, sizeof(string), "%s has been jailed", GetPlayerNameEx(jailedid));
SendClientMessageToAll(COLOR_RED, string);
SetPlayerPos(jailedid, -27.1455, 2321.1648, 24.3034);
SetPlayerInterior(jailedid, 0);
SendClientMessage(jailedid, COLOR_RED, "YOU ARE JAILED!!");
return 1;
}
Here is the rest of the code:
PHP код:
new bool:Jailed[MAX_PLAYERS];
PHP код:
forward Unjailtime(playerid);
public Unjailtime(playerid)
{
new string[128];
Jailed[playerid] = false;
SetPlayerPos(playerid, -20.8889, 2334.4663, 24.1406);
SetPlayerInterior(playerid, 0);
format(string, sizeof(string), "%s is free", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_ORANGE, string);
return 1;
}