/radio command
#1

Hello,

I got a problem with a /radio command.

When I type like this /radio TEST it looks like this:
** John_Smith(radio): TEST, over. **
** John_Smith(radio): TEST, over. **
I want it to come only one time!
Here's the code:
Quote:

if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/r)adio [radio chat]");
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(PlayerInfo[playerid][pRank] == 8 ) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
SendRadioMessage(1, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}

Do you know how to solve this problem?
Reply
#2

DELETE
Reply
#3

DELETE
Reply
#4

Cybermen suck.
Reply
#5

post ur
OnPlayerText and SendRadioMessage
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)