21.05.2009, 22:43
Код:
if(!strcmp(cmd, "/suspect", true))
{
// Checking to make sure the player is a cop
if(gTeam[playerid] != TEAM_COPS)
return SendClientMessage(playerid, 0xFF0000FF, "-> You are not a police officer.");
// Obtaining the second argument
tmp = strtok(cmdtext, index);
// Checking the second argument
if(!strlen(tmp))
return SendClientMessage(playerid, 0xFF0000FF, "-> You must specify a player ID to suspect them.");
new targetid = strval(tmp);
// Checking if the player is valid and connected
if(!IsPlayerConnected(targetid))
return SendClientMessage(playerid, 0xFF0000FF, "-> You have either entered an invalid player ID");
// Extracting the reason
strdel(cmdtext, 0, 10 + strlen(tmp));
// Checking the reason
if(strlen(cmd) < 2)
return SendClientMessage(playerid, 0xFF0000FF, "-> Please provide a reason to suspect the individual.");
// Getting the player names
new playername[MAX_PLAYER_NAME];
new targetname[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
new string[128];
format(string, 128, "-> Police Officer '%s'[ID:%d] has suspected '%s'[ID:%d] of: %s", playername, playerid, targetname, targetid, cmd);
SendClientMessageToAll(0x0000FFFF, string);
SendClientMessage(targetid, 0x0000FFFF, "-> You are now a police suspect and may be subject to arrest.");
return 1;
}

