hey guys. I have a /copradio command. But the other cops do not recieve the messages. please help:
pawn Код:
if(strcmp(cmd, "/cr", true)==0)
{
if(sapd[playerid] < 1) return SendClientMessage(playerid,COLOR_RED,"You are not a cop!");
if(!cmdtext[2]) return SendClientMessage(playerid, COLOR_RED, "USAGE: /cr [chat]");
new name[24];
GetPlayerName(playerid,name,sizeof(name));
for(new sapds;sapds < MAX_PLAYERS; sapds++)
{
if(IsPlayerConnected(sapds))
{
if(sapd[sapds] == 1)
{
format(string,sizeof(string),"Cadet %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 2)
{
format(string,sizeof(string),"Officer %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 3)
{
format(string,sizeof(string),"Senior Officer %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 4)
{
format(string,sizeof(string),"Sergeant %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 5)
{
format(string,sizeof(string),"Police Trainer %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 6)
{
format(string,sizeof(string),"Lieutenant %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 7)
{
format(string,sizeof(string),"Captain%s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
else if(sapd[sapds] == 8)
{
format(string,sizeof(string),"Deputy Chief %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
return 1;
}
else if(sapd[sapds] == 9)
{
format(string,sizeof(string),"Chief %s Says: %s",name,cmdtext[3]);
SendClientMessage(sapds,COLOR_YELLOW,string);
return 1;
}
return 1;
}
return 1;
}