SA-MP Forums Archive
radio only working for id 0 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: radio only working for id 0 (/showthread.php?tid=391828)



radio only working for id 0 - stix - 11.11.2012

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.


Re: radio only working for id 0 - Elysian` - 11.11.2012

Update SSCANF to the latest version.


Respuesta: radio only working for id 0 - stix - 11.11.2012

Already done, so did with ZCMD:


Re: radio only working for id 0 - Red_Dragon. - 11.11.2012

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


Respuesta: radio only working for id 0 - stix - 11.11.2012

Ain't sscanf last version 2.6 ?

I have updated it twice already lol


Respuesta: radio only working for id 0 - stix - 12.11.2012

bump


Re: radio only working for id 0 - Skillet` - 12.11.2012

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.


Respuesta: radio only working for id 0 - stix - 12.11.2012

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;
    }



Re: radio only working for id 0 - Mauzen - 12.11.2012

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.


Respuesta: radio only working for id 0 - stix - 12.11.2012

nevermind fixed, thanks alot guys