13.11.2012, 17:48
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:
Heres my SendRadioMessage if you need it.
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;
}
pawn Код:
public SendRadioMessage(member, color, string[])
{
foreach(Player, i)
{
if(PlayerInfo[i][pMember] == member)
{
SendClientMessage(i, color, string);
}
}
}