if(strcmp(cmd, "/suspect", true) == 0) { if(gTeam[playerid] == JOB_POLICE_OFFICER) { new tmp[256]; tmp = strtok(cmdtext, idx); if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_YELLOW,"[ ! ] /suspect <playerid>"); new pid = strval(tmp); if(!IsPlayerConnected(pid)) { SendClientMessage(playerid, COLOR_RED,"[ ! ] This player is not connected"); } if(GetPlayerWantedLevel(pid)) { SendClientMessage(playerid, COLOR_RED,"[ ! ] This player is already suspected"); } new string[256], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"(POLICE) %s has suspected you !",pName); SendClientMessage(pid, COLOR_LIGHTBLUE, string); SetPlayerWantedLevel(pid, 1); } else { SendClientMessage(playerid, COLOR_RED,"[ ! ] You are not in the Authorities team"); } return 1; } |
if(strcmp(cmd, "/suspect", true) == 0)
{
if(gTeam[playerid] == JOB_POLICE_OFFICER)
{
new tmp[256], tmp2[54];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_YELLOW,"[ ! ] /suspect <playerid><reason>");
new pid = strval(tmp);
if(!IsPlayerConnected(pid))
{
SendClientMessage(playerid, COLOR_RED,"[ ! ] This player is not connected");
}
if(GetPlayerWantedLevel(pid))
{
SendClientMessage(playerid, COLOR_RED,"[ ! ] This player is already suspected");
}
new string[256], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"(POLICE) %s has suspected you!, reason: %s",pName,tmp2);
SendClientMessage(pid, COLOR_LIGHTBLUE, string);
SetPlayerWantedLevel(pid, 1);
}
else
{
SendClientMessage(playerid, COLOR_RED,"[ ! ] You are not in the Authorities team");
}
return 1;
}
if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_YELLOW,"[ ! ] /suspect <playerid> <reason>");