radio only working for id 0
#1

Can someone tell me what's wrong with this ?

I made it so there's 2 frequencies, you can only listen to the command if ur in one of these 2 frequencies, and u have a radio, but only ID 0 can read the message, and if he ain't the one sending the mssage, it doesn't gets the player name.

pawn Код:
CMD:ra(playerid, params[])
    {
    new name[MAX_PLAYER_NAME], string[128];
    if(PlayerData[playerid][LSPDRank] < 1 && PlayerData[playerid][FBIRank] < 1) return SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command ! ");
    if(PlayerData[playerid][Duty] == 0) return SendClientMessage(playerid, GRAY, "You're not on police duty ! ");
    if(PlayerData[playerid][Radio] == 0) return SendClientMessage(playerid, GRAY, "You don't have a police radio ! ");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GRAY, "Function : /ra [ text ]");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(GetDistanceBetweenPlayers(playerid, i) < 5 && PlayerData[playerid][Frequency] == 1 && i != playerid)
    {
    format(string, sizeof(string),"[LSPD Radio] %s: %s, over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(GetDistanceBetweenPlayers(playerid, i) < 5 && PlayerData[playerid][Frequency] == 2 && i != playerid)
    {
    format(string, sizeof(string),"[FBI Radio] %s: %s, over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 1 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 1 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 1 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 1 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 2 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Academy Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 2 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent in Training %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 2 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Academy Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 2 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent in Training %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 3 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 3 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Sub Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 3 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 3 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Sub Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 4 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 4 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 4 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 4 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 5 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD] Senior Lead Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 5 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 5 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Senior Lead Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 5 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 6 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Sergeant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 6 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Special Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 6 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Sergeant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 6 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Special Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 7 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Lieutenant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 7 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Section Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 7 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Lieutenant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 7 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Section Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 8 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Captain %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 8 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Chief in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 8 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Captain %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 8 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Chief in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 9 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Commander %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 9 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Deputy Assistant Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 9 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Commander %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 9 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Deputy Assistant Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 10 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Co-Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 10 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Deputy Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 10 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Co-Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 10 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Deputy Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 11 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 11 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][LSPDRank] == 11 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[i][FBIRank] == 11 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    return 1;
    }
    return 1;
    }
Help will be appreciated.
Reply
#2

Update SSCANF to the latest version.
Reply
#3

Already done, so did with ZCMD:
Reply
#4

Update your sscanf plugin and sscanf include and re-compile. I had this problem and this fixed it
Reply
#5

Ain't sscanf last version 2.6 ?

I have updated it twice already lol
Reply
#6

bump
Reply
#7

Try using the loop 'while' instead of 'for' -
pawn Код:
new i = 0;
    while(i < MAX_PLAYERS) {
    i++
dunno if this will solve the problem,but worth trying.
I guess this will,because if it only works for id 0,then the loop having an issue to continue and not the sscanf.
Reply
#8

now i dont get any messages at all

pawn Код:
CMD:ra(playerid, params[])
    {
    new name[MAX_PLAYER_NAME], string[128];
    if(PlayerData[playerid][LSPDRank] < 1 && PlayerData[playerid][FBIRank] < 1) return SendClientMessage(playerid, GRAY, "You must be a Trainee / Agent Trainee or higher to use this command ! ");
    if(PlayerData[playerid][Duty] == 0) return SendClientMessage(playerid, GRAY, "You're not on police duty ! ");
    if(PlayerData[playerid][Radio] == 0) return SendClientMessage(playerid, GRAY, "You don't have a police radio ! ");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, GRAY, "Function : /ra [ text ]");
    new i = 0;
    while(i < MAX_PLAYERS)
    {
    i++;
    if(GetDistanceBetweenPlayers(playerid, i) < 5 && PlayerData[playerid][Frequency] == 1 && i != playerid)
    {
    format(string, sizeof(string),"[LSPD Radio] %s: %s, over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(GetDistanceBetweenPlayers(playerid, i) < 5 && PlayerData[playerid][Frequency] == 2 && i != playerid)
    {
    format(string, sizeof(string),"[FBI Radio] %s: %s, over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 1 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 1 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 1 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 1 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent Trainee %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 2 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Academy Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 2 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent in Training %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 2 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Academy Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 2 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent in Training %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 3 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 3 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Sub Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 3 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Cadet %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 3 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Sub Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 4 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 4 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 4 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 4 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 5 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD] Senior Lead Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 5 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Agent in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 5 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Senior Lead Officer %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 5 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Agent in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 6 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Sergeant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 6 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Special Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 6 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Sergeant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 6 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Special Agent %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 7 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Lieutenant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 7 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Section Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 7 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Lieutenant %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 7 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Section Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 8 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Captain %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 8 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Chief in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 8 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Captain %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 8 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Chief in Charge %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 9 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Commander %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 9 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Deputy Assistant Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 9 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Commander %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 9 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Deputy Assistant Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 10 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Co-Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 10 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Deputy Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 10 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Co-Chief %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 10 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Deputy Director %s : %s , over.", name, params);
    SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 11 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Police Chief %s : %s , over.", name, params);
    if(PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1) SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 11 && PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[LSPD Radio] Director %s : %s , over.", name, params);
    if(PlayerData[i][Frequency] == 1 && PlayerData[i][Radio] == 1) SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][LSPDRank] == 11 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Police Chief %s : %s , over.", name, params);
    if(PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1) SendClientMessage(i, GRAY, string);
    return 1;
    }
    if(PlayerData[playerid][FBIRank] == 11 && PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1)
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[FBI Radio] Director %s : %s , over.", name, params);
    if(PlayerData[i][Frequency] == 2 && PlayerData[i][Radio] == 1) SendClientMessage(i, GRAY, string);
    return 1;
    }
    return 1;
    }
    return 1;
    }
Reply
#9

Not a single helpful post yet.
Remove the return 1; at the end of every if(..) in the for-loop. The return ends the loop and the command processing when the first message was sent, so just the first player will get a message.
Reply
#10

nevermind fixed, thanks alot guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)