pawn Код:
stock GetRank(playerid)
{
new string[126];
switch(PlayerInfo[playerid][pRank]) // change to your rank variable
{
case 8: string = "Chief of Police";
case 7: string = "Assistant Chief";
case 6: string = "Commander";
case 5: string = "Captain";
case 4: string = "Lieutenant";
case 3: string = "Sergeant";
case 2: string = "Police Officer III";
case 1: string = "Police Officer II";
default: string = "Police Officer I";
// change the name of your ranks
}
return string;
}
CMD:r(playerid,params[])
{
new text[128];
if(sscanf(params,"s",text)) return SendClientMessage(playerid,COLOR_SYNTAX,"[SYNTAX]: /r [message]");
for(new i; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Group] == 1)
{
new str[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(str,sizeof(str),"[Police Radio] %s %s: %s , Over.",GetRank(playerid),pName,text);
SendClientMessage(i,COLOR_SYNTAX,str);
}
}
return 1;
}