Код:
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][pRadio] > 0 && PlayerInfo[playerid][pRChanel] > 0)
{
if(strcmp(PlayerInfo[playerid][pRPassword],RadioInfo[PlayerInfo[playerid][pRChanel]][rPassword], true ) == 0)
{
format(string, sizeof(string), "** %s(racija): %s, over. **", sendername, result);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SendRadioMessage(PlayerInfo[playerid][pRChanel], TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Yuo radio code is wrong!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Yuo didn't have a radio!");
return 1;
}
}
return 1;
}
Here is a problem, when I talk in radio and my radio code in my PlayerInfo radio code Mismach Whit RadioInfo Code, command Still works. If Someone know how to fix please help.