Help admin chat
#2

Try this:
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;
}
What do you mean by 'it doesn't work'?
Reply


Messages In This Thread
Help admin chat - by BlackEvils - 17.05.2015, 19:19
Re: Help admin chat - by Threshold - 18.05.2015, 05:03
Re: Help admin chat - by BlackEvils - 18.05.2015, 19:14
Re: Help admin chat - by J0sh... - 18.05.2015, 19:20
Re: Help admin chat - by Threshold - 18.05.2015, 19:26
Re: Help admin chat - by J0sh... - 18.05.2015, 19:27
Re: Help admin chat - by Threshold - 18.05.2015, 19:30
Re: Help admin chat - by Konstantinos - 18.05.2015, 19:30
Re: Help admin chat - by J0sh... - 18.05.2015, 19:32
Re: Help admin chat - by Konstantinos - 18.05.2015, 19:48

Forum Jump:


Users browsing this thread: 1 Guest(s)