SA-MP Forums Archive
/radio command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /radio command (/showthread.php?tid=80654)



/radio command - Omecken - 05.06.2009

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?



Re: /radio command - Omecken - 05.06.2009

DELETE


Re: /radio command - Omecken - 05.06.2009

DELETE


Re: /radio command - [TouchX]Ash - 05.06.2009

Cybermen suck.


Re: /radio command - yezizhu - 06.06.2009

post ur
OnPlayerText and SendRadioMessage