pawn Код:
if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/d)epartments [department chat]");
return 1;
}
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "** You are Banned From Cop Duty!");
return 1;
}
if(//yourcode here[playerid] == // your code here)
{
if(PlayerInfo[playerid][pSwat] == 4) { format(string, sizeof(string), "Commander %s: %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pSwat] == 3) { format(string, sizeof(string), "Sub-Commander %s: %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pSwat] == 2) { format(string, sizeof(string), "Instructor %s: %s, over.", sendername, result); }
else if(PlayerInfo[playerid][pSwat] == 1) { format(string, sizeof(string), "Operative %s: %s, over.", sendername, result); }
else
{
format(string, sizeof(string), "[Unknown] %s (radio): %s, over.", sendername, result);
}
ProxDetector(7.5, playerid, string,COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SentMessage[playerid] = 1;
SendRadioMessage(3, COLOR_//, string);
SendRadioMessage(2, COLOR_//, string);
SendRadioMessage(1, COLOR_//, string);
SendRadioMessage(4, COLOR_//, string);
SendRadioMessage(12, COLOR_//, string);
SendRadioMessage(7, COLOR_//, string);
SentMessage[playerid] = 0;
return 1;
}