Code:
CMD:r(playerid, params[]) return cmd_radio(playerid, params);
CMD:radio(playerid, params[])
{
new string[128], text[128], ctext[60], pname[MAX_PLAYER_NAME+1];//establishes a few things needed to tell the players name, rank, and the text he has written.
GetPlayerName(playerid, pname, sizeof(pname));//gets the name of the player using /radio
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /r(adio) [text]");//if /r is not used correctly it will tell you the correct way to use it
if(pInfo[playerid][Faction] == 1)//checks if the player is in the first faction
{
if(pInfo[playerid][FactionTier] == 1){ ctext = "Chief"; }//all of these check the players rank and
if(pInfo[playerid][FactionTier] == 2){ ctext = "Deputy Chief"; }// sets each rank to a specific name
if(pInfo[playerid][FactionTier] == 3){ ctext = "Squad Commander"; }
if(pInfo[playerid][FactionTier] == 4){ ctext = "Captain"; }
if(pInfo[playerid][FactionTier] == 5){ ctext = "Lieutenant"; }
if(pInfo[playerid][FactionTier] == 6){ ctext = "Public Relations Officer"; }
if(pInfo[playerid][FactionTier] == 7){ ctext = "Traffic Officer"; }
if(pInfo[playerid][FactionTier] == 8){ ctext = "Special Weapons Officer"; }
if(pInfo[playerid][FactionTier] == 9){ ctext = "Senior Officer"; }
if(pInfo[playerid][FactionTier] == 10){ ctext = "Trainee Officer"; }
format(string, sizeof(string), "(Radio) %s %s: %s", ctext, pname, text);
if(pInfo[playerid][Faction] > 0)//if the player is not in a faction it will not send him any messages
{
SendCopMessage(COLOR_PDRAD, string);//calls a stock below that checks who the /r should be sent to
}
}
return 1;
}
This is my police faction radio chat but what i cant make is a department chat to keep all emergency service in contact like police contact the EMS....