SA-MP Forums Archive
Admin Read Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin Read Help (/showthread.php?tid=497702)



Admin Read Help - alishvasis - 28.02.2014

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)


Re: Admin Read Help - MattTucker - 28.02.2014

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);
        }
    }
}



Re: Admin Read Help - Smally - 28.02.2014

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.



Re: Admin Read Help - mamorunl - 28.02.2014

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) {



Re: Admin Read Help - Smally - 28.02.2014

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.


Re: Admin Read Help - mamorunl - 28.02.2014

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