Admin Commands
#1

Hi, I need some such thing, that if some admin command writes all the Admins will see that he used to command.

EG: I write /god. others see:

pawn Код:
Admin finelaq used the command: /god
Thanks!



used: http://translate.******.com/
Reply
#2

Create a stock with your admin loop through all players to check if the player is an admin or not , if he is an admin > 0 SendClientMessage to him , and on your /god command add sendadminmessage (the created stock about admin checking) for example my admin enum is PlayerInfo[playerid][pAdminLevel] so my stock should look like that
pawn Код:
stock SendMessageToAdmins(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)

    {
        if(PlayerInfo[i][pAdminLevel] > 0)
        {
            SendClientMessage(i, -1, text);
        }
    }
}
And on your command just add however you typed in the stock i choosed SendMessageToAdmins example.
pawn Код:
CMD:god(playerid , params[])
{
    new text[126];
    format(text,sizeof(text),"Admin %s has used command /god",playerid);
    SendMessageToAdmins(text);
    return 1;
}
P.s: Sorry for editing , i would like to give you example on /god.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)