Admin Read Help
#1

Hi I Use This
How To Set This For Just Admin Level 9 Can Read cmds
Код:
if(Options[Readcmds]==1){
	  GetPlayerName(playerid,name,sizeof(name));
	  format(string, sizeof(string), LanguageText[38],name,playerid,cmdtext);
      MessageToAdmins(COLOR_GREY,string);print(string);}
	GetPlayerName(playerid,name,sizeof(name));
And This My Admin Level System
if(Account[playerid][pAdminlevel] == 9)
Reply
#2

Can you post your "MessageToAdmins" stock?

And if you are requesting it to be created here you go

pawn Код:
stock MessageToAdmin(col, string[])
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(Account[i][pAdminlevel] == 9)
        {
            SendClientMessage(i, col, string);
        }
    }
}
Reply
#3

pawn Код:
Stock:
stock MessageToAdmins(col, string[], adminLevel)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Acccount[i][pAdminLevel] >= adminLevel)
            {
                SendClientMessage(i, col, string);
            }
        }
    }
    return 1;
}

Example usage:
MessageToAdmins(col, string, Minimum Admin Level);
MessageToAdmins(COLOR_GREY, string, 9); //Will send to all admins LEVEL 9 and above.
Reply
#4

Quote:
Originally Posted by alishvasis
Посмотреть сообщение
Hi I Use This
How To Set This For Just Admin Level 9 Can Read cmds
Код:
if(Options[Readcmds]==1){
	  GetPlayerName(playerid,name,sizeof(name));
	  format(string, sizeof(string), LanguageText[38],name,playerid,cmdtext);
      MessageToAdmins(COLOR_GREY,string);print(string);}
	GetPlayerName(playerid,name,sizeof(name));
And This My Admin Level System
if(Account[playerid][pAdminlevel] == 9)
If it is just for this command then you can just replace your if-statement to include the admin level:

pawn Код:
if(Options[Readcms] == 1 && Account[playerid][pAdminlevel] == 9) {
Reply
#5

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
If it is just for this command then you can just replace your if-statement to include the admin level:

pawn Код:
if(Options[Readcms] == 1 && Account[playerid][pAdminlevel] == 9) {
That won't work as that will only check if the person that executes the command is a level 9 admin.
Reply
#6

Quote:
Originally Posted by Smally
Посмотреть сообщение
That won't work as that will only check if the person that executes the command is a level 9 admin.
Yep, you are right. I read the command wrong. My bad
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)