radio only working for id 0
#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


Messages In This Thread
radio only working for id 0 - by stix - 11.11.2012, 18:38
Re: radio only working for id 0 - by Elysian` - 11.11.2012, 18:38
Respuesta: radio only working for id 0 - by stix - 11.11.2012, 18:51
Re: radio only working for id 0 - by Red_Dragon. - 11.11.2012, 19:21
Respuesta: radio only working for id 0 - by stix - 11.11.2012, 20:00
Respuesta: radio only working for id 0 - by stix - 12.11.2012, 14:06
Re: radio only working for id 0 - by Skillet` - 12.11.2012, 14:20
Respuesta: radio only working for id 0 - by stix - 12.11.2012, 14:49
Re: radio only working for id 0 - by Mauzen - 12.11.2012, 15:00
Respuesta: radio only working for id 0 - by stix - 12.11.2012, 15:30

Forum Jump:


Users browsing this thread: 1 Guest(s)