15.02.2016, 11:06
i have problem with radio faction, if im compile no prolem but in game massage cannot show to faction member this my code
and this stock for SendCopMessage
where is my mistake??
sory for my bad english
PHP код:
CMD:radio(playerid, params[])
{
new string[128], text[128], ctext[60], pname[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /r(adio) [text]");
if(PlayerInfo[playerid][pFaction] == 1)
{
if(PlayerData[playerid][pFacrank] == 1){ ctext = "Cadet"; }
if(PlayerData[playerid][pFacrank] == 2){ ctext = "Officer"; }
if(PlayerData[playerid][pFacrank] == 3){ ctext = "Senior Officer"; }
if(PlayerData[playerid][pFacrank] == 4){ ctext = "Corporal"; }
if(PlayerData[playerid][pFacrank] == 5){ ctext = "Sergeant"; }
if(PlayerData[playerid][pFacrank] == 6){ ctext = "Lieutenant"; }
if(PlayerData[playerid][pFacrank] == 7){ ctext = "Captain"; }
if(PlayerData[playerid][pFacrank] == 8){ ctext = "Commander"; }
if(PlayerData[playerid][pFacrank] == 9){ ctext = "Deputy Chief"; }
if(PlayerData[playerid][pFacrank] == 10){ ctext = "Jendral"; }
format(string, sizeof(string), "%s %s: %s", ctext, pname, text);
if(PlayerData[playerid][pFaction] > 0)
{
SendCopMessage(COLOR_PDRAD, string);
}
return 1;
}
PHP код:
stock SendCopMessage(col, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerData[i][pFaction] == 1)
SendClientMessage(i, col, string);
return 1;
}
sory for my bad english

