Thread: Admin Chat
View Single Post
Old 06/01/2011, 06:44 AM   #7
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 273
Default Re: Admin Chat

Even better, don't use commands for admin chat use OnPlayerText like this,
pawn Code:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#' && Spieler[playerid][AdminLevel] > 0)
    {
        new
            pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName , MAX_PLAYER_NAME);
        format(text,128 ,"|ADMIN CHAT| %s: %s", pName, text[1]);
        for(new i; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i))continue;
            if(Spieler[i][AdminLevel] > 0)
                SendClientMessage(i, COLOR_LIGHTGREEN, text);
        }
        return 0;
    }
    return 1;
}
Most admin systems use this method. Anything typed after '#' will be sent to admins.
iggy1 is offline