[SOLVED] Quastion about police radio
#1

I'm using the radio system from GF and I just want to ask a quick quastion about it, I odnt want my currect rank to show up in the radio chat, how should I remove them, I just gets errors when I try.

Код:
 	if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: (/r)adio [radio chat]");
				return 1;
			}
			if(gTeam[playerid] == TEAM_LSPD)
			{
				if(PlayerInfo[playerid][LAERank] == 10) { format(string, sizeof(string), "Chief of Police %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 9) { format(string, sizeof(string), "Assistant Chief %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 8) { format(string, sizeof(string), "Deputy Chief %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 7) { format(string, sizeof(string), "Commander %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 6) { format(string, sizeof(string), "Captain %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 5) { format(string, sizeof(string), "Lieutenant %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 4) { format(string, sizeof(string), "Sergeant %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 3) { format(string, sizeof(string), "Detective %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 2) { format(string, sizeof(string), "Senior Lead Officer %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 1) { format(string, sizeof(string), "Police Officer %s: %s, over. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "Police Officer %s: %s, over. **", sendername, result);
				}
				SendRadioMessage(9, COLOR_BLUE, string);
				printf("%s", string);
				return 1;
			}
			else if(gTeam[playerid] == TEAM_FBI)
			{
			  if(PlayerInfo[playerid][LAERank] == 10) { format(string, sizeof(string), "Director %s: %s, over. **", sendername, result); }
        else if(PlayerInfo[playerid][LAERank] == 9) { format(string, sizeof(string), "Assistant Director %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 8) { format(string, sizeof(string), "Deputy Director %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 7) { format(string, sizeof(string), "Section Chief %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 6) { format(string, sizeof(string), "Division Chief %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 5) { format(string, sizeof(string), "Special Agent in Charge %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 4) { format(string, sizeof(string), "Supervisory Special Agent %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 3) { format(string, sizeof(string), "Special Agent %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 2) { format(string, sizeof(string), "Agent in Charge %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][LAERank] == 1) { format(string, sizeof(string), "Agent %s: %s, over. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "Intern %s: %s, over. **", sendername, result);
				}
				SendRadioMessage(9, COLOR_DARKBLUE, string);
				printf("%s", string);
				return 1;
			}
			else if(gTeam[playerid] == TEAM_LSER)
			{
				format(string, sizeof(string), "Paramedic %s: %s, over. **", sendername, result);
				SendRadioMessage(9, COLOR_LIGHTRED, string);
				printf("%s", string);
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "	You are not a Police Officer, FBI Agent or a Paramedic.");
				return 1;
			}
		}
		return 1;
	}
Thanks
Reply
#2

pawn Код:
if(PlayerInfo[playerid][LAERank] == 10) { format(string, sizeof(string), "Chief of Police %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 9) { format(string, sizeof(string), "Assistant Chief %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 8) { format(string, sizeof(string), "Deputy Chief %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 7) { format(string, sizeof(string), "Commander %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 6) { format(string, sizeof(string), "Captain %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 5) { format(string, sizeof(string), "Lieutenant %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 4) { format(string, sizeof(string), "Sergeant %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 3) { format(string, sizeof(string), "Detective %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 2) { format(string, sizeof(string), "Senior Lead Officer %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 1) { format(string, sizeof(string), "Police Officer %s: %s, over. **", sendername, result); }
Clue


Shouldnt be too hard
If you want me to do it just ask
Reply
#3

Quote:
Originally Posted by Torran
pawn Код:
if(PlayerInfo[playerid][LAERank] == 10) { format(string, sizeof(string), "Chief of Police %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 9) { format(string, sizeof(string), "Assistant Chief %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 8) { format(string, sizeof(string), "Deputy Chief %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 7) { format(string, sizeof(string), "Commander %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 6) { format(string, sizeof(string), "Captain %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 5) { format(string, sizeof(string), "Lieutenant %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 4) { format(string, sizeof(string), "Sergeant %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 3) { format(string, sizeof(string), "Detective %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 2) { format(string, sizeof(string), "Senior Lead Officer %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][LAERank] == 1) { format(string, sizeof(string), "Police Officer %s: %s, over. **", sendername, result); }
Clue


Shouldnt be too hard
If you want me to do it just ask
:P but when I'm deleting the ranks, the format:

Код:
format(string, sizeof(string), "Police Officer %s: %s, over. **", sendername, result);
Shows on every team like FBI and LSER, I want it to be different formats for each team, and when I delete the ranks, the team LSER gets the LSPD's format.
Reply
#4

Eh? I didnt mean delete them :P

pawn Код:
if(PlayerInfo[playerid][LAERank] == 10) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 9) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 8) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 7) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 6) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 5) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 4) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 3) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 2) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][LAERank] == 1) { format(string, sizeof(string), "%s: %s, over. **", sendername, result); }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)