How to make Admin Chat
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#' && PlayerInfo[playerid][pAdmin])
    {
        new str[128], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(str, sizeof(str), "(ADMIN CHAT) %s: {FFFFFF}%s", name, text[1]);
        //If you have a SendAdminMessage or something, use it here instead of the loop
        for(new i = 0; i < MAX_PLAYERS; i++) //foreach is better :)
        {
            if(!IsPlayerConnected(i)) continue;
            if(!PlayerInfo[playerid][pAdmin]) continue;
            SendClientMessage(i, -1, str); //'-1' is the color, change that to whatever you want your admin chat to be
        }
        return 0;
    }
    return 1;
}
Reply


Messages In This Thread
How to make Admin Chat - by xFirex - 29.05.2014, 12:18
Re: How to make Admin Chat - by R0 - 29.05.2014, 12:25
Re: How to make Admin Chat - by Threshold - 29.05.2014, 12:28
Re: How to make Admin Chat - by Rittik - 29.05.2014, 12:33
Re: How to make Admin Chat - by xFirex - 29.05.2014, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)