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));
stock MessageToAdmin(col, string[])
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(Account[i][pAdminlevel] == 9)
{
SendClientMessage(i, col, string);
}
}
}
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.
|
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));
if(Account[playerid][pAdminlevel] == 9) |
if(Options[Readcms] == 1 && 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 Код:
|
|
That won't work as that will only check if the person that executes the command is a level 9 admin.
|