01.09.2010, 09:27
Hello ya' all.
I got a simple radio command that send a radio message via SendTeamMessage and a ProxDetector message that send a message to players around...
Now to the question, I want al other players around me to be able to see what I'm typing in the radio, as you can see on the first line I gave it a try, it works but now I can see a double message of what I'm typing, I want the second message to only be viewable to players around.
Thanks
I got a simple radio command that send a radio message via SendTeamMessage and a ProxDetector message that send a message to players around...
pawn Код:
if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, " USAGE: (/r)adio [text]");
return 1;
}
if(PlayerInfo[playerid][pRank] >= 1)
{
if(gTeam[playerid] == 2)
{
format(string, sizeof(string), "** %s: %s **", sendername, result);
SendTeamMessage(2, COLOR_LIGHT_YELLOW, string);
format(string, sizeof(string), "(Radio) %s says: %s", sendername, result);
ProxDetector(20.0, giveplayerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
return 1;
}
else if(gTeam[playerid] == 3)
{
format(string, sizeof(string), "** %s: %s **", sendername, result);
SendTeamMessage(3, COLOR_LIGHT_YELLOW, string);
format(string, sizeof(string), "** %s mutters something on the radio.", sendername);
ProxDetector(30.0, playerid, string,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC);
return 1;
}
else if(gTeam[playerid] == 4)
{
format(string, sizeof(string), "** %s: %s **", sendername, result);
SendTeamMessage(4, COLOR_LIGHT_YELLOW, string);
format(string, sizeof(string), "** %s mutters something on the radio.", sendername);
ProxDetector(30.0, playerid, string,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command.");
}
}
return 1;
}
Thanks