23.01.2012, 10:28
Hello, I am trying to make a /r (radio) for every faction. Every faction radio will send a message to all online members of the faction the sender is in..
Now my problem is: Only player id 0 sees the messages...
My code:
someone know how to fix it?
Now my problem is: Only player id 0 sees the messages...
My code:
pawn Код:
CMD:r(playerid, params[])
{
if(PlayerInfo[playerid][Fmember] >= 1)
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /r [Text]");
foreach(Player, i) {
if(PlayerInfo[i][Fmember] == PlayerInfo[playerid][Fmember]) {
new
string[ 128 ], name[ MAX_PLAYER_NAME ];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (radio): %s , Over.", name, params);
SendClientMessage(i, TEAM_RADIO_COLOR, string);
return 1;
}
}
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction!");
}