SA-MP Forums Archive
if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - 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: if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) (/showthread.php?tid=636843)



if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - s3ek - 04.07.2017

PHP код:
    if(ServerInfo[ReadPMs] == && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
    {
        new 
string[128],recievername[MAX_PLAYER_NAME];
        
GetPlayerName(playeridstringsizeof(string)); GetPlayerName(idrecievernamesizeof(recievername));
        
format(stringsizeof(string), "***PM: %s To %s: %s"stringrecievernamegMessage);
        for (new 
0MAX_PLAYERSa++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && != playerid)
        
SendClientMessage(agreystring);
        
SaveIn("PMs"string);
    }
    
GetPlayerName(id,iName,sizeof(iName));
    
GetPlayerName(playerid,pmName,sizeof(pmName));
    
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
    
SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
    
format(Message,sizeof(Message),"** %s(%d): %s",pmName,playerid,gMessage);
    
SendClientMessage(id,PM_INCOMING_COLOR,Message);
    
PlayerPlaySound(id,1085,0.0,0.0,0.0);
    
printf("PM: %s",Message);
    return 
1;

all admin can read pms private .. or only hight level admin??


Re: if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - Meller - 04.07.2017

Explain your problem please?


Re: if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - s3ek - 04.07.2017

Quote:
Originally Posted by Meller
Посмотреть сообщение
Explain your problem please?
PHP код:
PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) 
what it mean?


Re: if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - Meller - 04.07.2017

It checks if their Level variable is not the Max Admin level, example:
Your admin level is 5, and the max level there is, it's 6.

So it'd be if 5 is NOT 6, then continue.
if(5 IS NOT 6) //


Re: if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - s3ek - 04.07.2017

Quote:
Originally Posted by Meller
Посмотреть сообщение
It checks if their Level variable is not the Max Admin level, example:
Your admin level is 5, and the max level there is, it's 6.

So it'd be if 5 is NOT 6, then continue.
if(5 IS NOT 6) //
help me to make this code all admins can read pms


Re: if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) - jlalt - 04.07.2017

Quote:
Originally Posted by s3ek
Посмотреть сообщение
help me to make this code all admins can read pms
just change this
PHP код:
(PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) 
to this
PHP код:
(PlayerInfo[a][Level] >= 1