help
this cmd can use anyone
help
[pawn]else if (strcmp(cmd, "jail", true) == 0) {
IsPlayerAdmin( playerid );
{
new time[256],reason[256],plr;
tmp = strtok(cmdtext, idx),plr = FindPlayerIDFromString(tmp),time = strtok(cmdtext, idx),reason = strtok(cmdtext, idx);
if(Jail[plr] == 1) {
SendClientMessage(playerid,NOTACCES,"This Player Is In Jail !");
}
if(Jail[plr] == 0) {
if (!strlen(tmp) || !strlen(time) || !strlen(reason)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c jail [Nick] [Min] [Reason]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
new string[256];
SetPlayerRandomJailSpawns(plr);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
SetPlayerWeapon(plr,0,0);
format(string,sizeof(string),"Admin %s has jailed %s for %d minutes.",gPlayers[playerid],gPlayers[plr],strval(time));
SendClientMessageToAll(COLOR_YELLOW, string);
format(string,sizeof(string),"Reason:[ %s ].",cmdtext[strlen(tmp)+7]);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessage(plr,COLOR_YELLOW,"You have been jailed !");
SetTimer("unjail",(strval(time)*60000),false);
Jail[plr] = 1;
TogglePlayerControllable(plr,0);
}
}
}
return 1;
}
else if(strcmp(cmd, "unjail", true) == 0) {
IsPlayerAdmin( playerid );
{
tmp = strtok(cmdtext, idx); new plr = FindPlayerIDFromString(tmp);
if(Jail[plr] == 0) {
SendClientMessage(playerid,NOTACCES,"This Player Is Not In Jail !");
}
if(Jail[plr] == 1) {
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED, "USAGE: /c unjail [Nick]");
else{
if (plr != INACTIVE_PLAYER_ID) {
new string[256];
format(string,sizeof(string),"Admin %s has unjailed %s!",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerPos(plr,397.688, -471.821, 11.5172,0,0);
SendClientMessage(plr,COLOR_YELLOW,"You have been unjailed !");
Jail[plr] = 0;
TogglePlayerControllable(plr,1);
}
else SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
}
}
}
return 1;
}[/pawn]