18.05.2015, 05:03
Try this:
What do you mean by 'it doesn't work'?
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '@' && PlayerInfo[playerid][Admin])
{
new playername[MAX_PLAYER_NAME], string[144];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "[{FFFFFF}ADMINCHAT{8080FF}] %s(%d): %s", playername, playerid, text[1]);
SendMessageToGangMembers(PlayerInfo[playerid][Admin], string);
return 0;
}
return 1; // Should this be 1 or 0?
}
forward SendMessageToGangMembers(colore, const string[]);
public SendMessageToGangMembers(colore, const string[])
{
for(new i = 0, j = GetPlayerPoolSize(); i < j; ++i) // If you're using 0.3.7, otherwise 'for(new i = 0; i < MAX_PLAYERS; i++)'
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][Admin]) SendClientMessage(i, colore, string);
}
return 1;
}