Admin In chat
#3

try this:
pawn Код:
forward AdminChat(color, message[])
declare this callback above.

pawn Код:
public AdminChat(color, message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            SendClientMessage(i, color, message);
        }
    }
    return 1;
}
the actual callback. this would send the message to all admins online.

pawn Код:
command(achat, playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new message[128], string[128], playername[24];
        GetPlayerName(playerid, playername, sizeof(playername));
        if(sscanf(params, "S", message)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /achat [message]");
        format(string, sizeof(string), "[ADMIN] %s: %s", playername, message);
        AdminChat(0xFFFF00FF, string);
    }
    else SendClientMessage(playerid, 0xAAAAAAFF, "You're not an admin.");
    return 1;
}
the command, i used zcmd and sscanf for it. you can always use the default "OnPlayerCommandText" though.

hope this helps you, give me a reputation if it does, thanks!
Reply


Messages In This Thread
Admin In chat - by [LHT]Bally - 20.03.2012, 00:08
AW: Admin In chat - by Blunt P - 20.03.2012, 00:19
Re: Admin In chat - by Skribblez - 20.03.2012, 00:26
Re: Admin In chat - by MaximumGaming - 20.03.2012, 04:15
Re: Admin In chat - by Skribblez - 20.03.2012, 04:36
Re: Admin In chat - by new121 - 20.03.2012, 04:44
Re: Admin In chat - by Haydz - 20.03.2012, 05:56

Forum Jump:


Users browsing this thread: 1 Guest(s)