21.05.2009, 22:29
Код:
if(!strcmp(cmd, "/suspect", true))
{
if(gTeam[playerid] == TEAM_COPS)
{
tmp = strtok(cmdtext, index);
if(!strlen(tmp))return SendClientMessage(id, 0xFFFF00AA, "-> You mean: /suspect [PlayerID] [reason]");
id = strval(tmp);
strmid(tmp, cmdtext, strlen(cmd)+strlen(tmp)+2, strlen(cmdtext));
if(IsPlayerConnected(id))
{
new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, name2, sizeof(name2));
format(string, sizeof(string), "-> Police Officer %s has suspected a %s. Reason: %s", name, name2, tmp);
SendClientMessageToAll(0xFFFF00AA, string);
SendClientMessage(id, 0xFFFF00AA, "-> You are now a police suspect, cops will try to arrest you!");
SetPlayerWantedLevel(id, 2);
}else SendClientMessage(playerid, 0xFFFF00AA, "-> Player not found");
}else SendClientMessage(playerid, 0xFFFF00AA, "-> You are not a Police Officer");
return 1;
}
