Radio Help
#1

I'm having a problem with my radio. Everytime I /radio and say something like "hi", it comes out like this, Example "Larry says: (radio) hi, and I see that when I /radio and speak. The problem is I want to see it Like my rank then what I say, basically its not sending the message to me with whatever my rank is, like it shows in the code.

Code:
pawn Код:
CMD:radio(playerid, params[])
{
    new Radio[256];
    if(sscanf(params, "s[256]", Radio))
    {
        SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /r(adio) [Message]");
    }
    else if(PlayerInfo[playerid][pMember] <= 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not in any faction!");
    }
    else
    {
        if(PlayerInfo[playerid][pMember] == 1)
        {
            new string[256], RadioMessage[256];
            if(PlayerInfo[playerid][pRank] == 1)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy Sheriff Generalist %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 2)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 3)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy I %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 4)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy II %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 5)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy III %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 6)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Sergeant %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 7)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Sergeant I %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 8)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Lieutenant %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 9)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Captain %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 10)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Undersheriff %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 11)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Sheriff %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }
            format(string, sizeof(string), "%s says: (radio) %s", GPNEx(playerid), Radio);
            ProxDetector(10.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
        }
        if(PlayerInfo[playerid][pMember] == 2)
        {
            new string[256], RadioMessage[256];
            if(PlayerInfo[playerid][pRank] == 1)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Probationary Firefighter %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 2)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 3)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter I %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 4)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter II %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 5)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter III %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 6)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Paramedic %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 7)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Lieutenant %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 8)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Captain %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 9)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy Chief %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 10)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Chief %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            format(string, sizeof(string), "%s says: (radio) %s", GPNEx(playerid), Radio);
            ProxDetector(10.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
        }
    }
    return 1;
}
Heres my SendRadioMessage if you need it.
pawn Код:
public SendRadioMessage(member, color, string[])
{
    foreach(Player, i)
    {
        if(PlayerInfo[i][pMember] == member)
        {
            SendClientMessage(i, color, string);
        }
    }
}
Reply
#2

Try this

pawn Код:
CMD:radio(playerid, params[])
{
    new Radio[256];
    if(sscanf(params, "s[256]", Radio))
    {
        SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /r(adio) [Message]");
    }
    else if(PlayerInfo[playerid][pMember] <= 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not in any faction!");
    }
    else
    {
        if(PlayerInfo[playerid][pMember] == 1)
        {
            new string[256], RadioMessage[256];
            if(PlayerInfo[playerid][pRank] == 1)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy Sheriff Generalist %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 2)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 3)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy I %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 4)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy II %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }elseif(PlayerInfo[playerid][pRank] == 5)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy III %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 6)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Sergeant %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 7)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Sergeant I %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 8)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Lieutenant %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 9)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Captain %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 10)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Undersheriff %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 11)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Sheriff %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(1, RADIO, RadioMessage);
            }else {
               format(string, sizeof(string), "%s says: (radio) %s", GPNEx(playerid), Radio);
               ProxDetector(10.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            }
        }
        if(PlayerInfo[playerid][pMember] == 2)
        {
            new string[256], RadioMessage[256];
            if(PlayerInfo[playerid][pRank] == 1)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Probationary Firefighter %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 2)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }
            if(PlayerInfo[playerid][pRank] == 3)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter I %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 4)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter II %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 5)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Firefighter III %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 6)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Paramedic %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 7)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Lieutenant %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 8)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Captain %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 9)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Deputy Chief %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else if(PlayerInfo[playerid][pRank] == 10)
            {
                format(RadioMessage, sizeof(RadioMessage), " [Chief %s]: %s ", GPNEx(playerid), Radio);
                SendRadioMessage(2, RADIO, RadioMessage);
            }else {
               format(string, sizeof(string), "%s says: (radio) %s", GPNEx(playerid), Radio);
               ProxDetector(10.0, playerid, string,  COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            }
        }
    }
    return 1;
}
Reply
#3

Nope, it didn't work, same thing happens.
Reply
#4

Apparently the message comes from here:
pawn Код:
format(string, sizeof(string), "%s says: (radio) %s", GPNEx(playerid), Radio);
            ProxDetector(10.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
So get the radio lines to replace this one
Reply
#5

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
Apparently the message comes from here:
pawn Код:
format(string, sizeof(string), "%s says: (radio) %s", GPNEx(playerid), Radio);
            ProxDetector(10.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
So get the radio lines to replace this one
Finally got it to work, thanks mamo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)