22.05.2009, 20:35
I have no idea if this will work, I found it at forum, my I think it will only send a message on the players chat. not to THE ALL TEAM :S
pawn Код:
if(strcmp(cmd,"/pr",true)==0)
{
if (gTeam[playerid] == TEAM_COPS)
{
if ((strlen(cmdtext) >= 1)&&(strlen(cmdtext) <= 3))
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Police Radio(%s):%s",name,cmdtext[128]);
SendCopMessage(0xFFFFFF, string);
}
else return SendClientMessage(playerid, 0xFFFF00AA, "-> You mean: /pr [Message]");
}
else return SendClientMessage(playerid, 0xFFFF00AA, "-> You are not a Police Officer");
}
pawn Код:
SendCopMessage(color, text[]) {
for(new i = 0; i < MAX_PLAYERS; i ++) {
if(IsPlayerConnected(i)) {
if (gTeam[i] == TEAM_COPS) {
SendClientMessage(i, color, text);
}
}
}
}