Little Help
#1

Suppose I Created My Admin System But How Will I Make The System Like When A Player Is Using A Command Or

Writing Anything The Message Will Go To Admin And When An Admin Is Using A Command How Will It Go To Other

Admins??
Reply
#2

Example script:
pawn Код:
new AllowChat[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/disablechat", cmdtext, true) == 0)
    {
        if(AllowChat[playerid] == 1)
        {
            AllowChat[playerid]=0;
        }
        else
        {
            AllowChat[playerid]=1;
        }
        if(!IsPlayerAdmin(playerid))
        {
            new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));

            format(string, sizeof(string), "%s has used /disablechat command.", name);
            SendCommandMessageToAdmins(0xDEEE20FF, string);
        }
        return 1;
    }
    return 0;
}
Reply
#3

SendCommandMessageToAdmins(0xDEEE20FF, string);

You may wanna post the stock of it?
Reply
#4

Lol made a mistake.

Stock for SendMessageToAdmins
pawn Код:
stock SendMessageToAdmins(text[]) { for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i,blue,text); return 1; }
I have made a mistake.

It should be
pawn Код:
SendMessageToAdmins
Not
pawn Код:
SendCommandMessageToAdmins
pawn Код:
new AllowChat[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/disablechat", cmdtext, true) == 0)
    {
        if(AllowChat[playerid] == 1)
        {
            AllowChat[playerid]=0;
        }
        else
        {
            AllowChat[playerid]=1;
        }
        if(!IsPlayerAdmin(playerid))
        {
            new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));

            format(string, sizeof(string), "%s has used /disablechat command.", name);
            SendMessageToAdmins(string);
        }
        return 1;
    }
    return 0;
}
Reply
#5

If you wanna use
SendCommandMessageToAdmins, then use this code:
pawn Код:
stock SendCommandMessageToAdmins(playerid,command[]) { if(!Config[DisplayCommandMessage]) return 1; new string[256],name[24]; GetPlayerName(playerid,name,24); format(string,256,"%s has used the command \'/%s\'.",name,command); return SendMessageToAdmins(string); }
pawn Код:
new AllowChat[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/disablechat", cmdtext, true) == 0)
    {
        if(AllowChat[playerid] == 1)
        {
            AllowChat[playerid]=0;
        }
        else
        {
            AllowChat[playerid]=1;
        }
        if(!IsPlayerAdmin(playerid))
        {
        SendCommandMessageToAdmins(playerid, "DISABLECHAT");
        }
        return 1;
    }
    return 0;
}
Reply
#6

I am using ZCMD can u make it more easy please with showing me in a Filter Script in pastebin so i can easily make

it this is the one thing i don't understand in admin system
Reply
#7

Quote:
Originally Posted by Nirzor
Посмотреть сообщение
I am using ZCMD can u make it more easy please with showing me in a Filter Script in pastebin so i can easily make

it this is the one thing i don't understand in admin system
This is not a Filterscript. If you are using ZCMD just add this thing in your command:
pawn Код:
if(!IsPlayerAdmin(playerid))
        {
            new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));

            format(string, sizeof(string), "%s has used /disablechat command.", name);
            SendMessageToAdmins(string);
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)