How do I make level 1 admins secret from /admins
#2

Simple ...
Create a variable
pawn Код:
new SecretAdmin[MAX_PLAYERS];
Now as the player connects , we gonna have to set his SecretAdmin to 0 , witch means he isnt a secret admin.
pawn Код:
public OnPlayerConnecte(playerid)
{
    if(PlayerInfo[playerid][pAdmin] > 0) { SecretAdmin[playerid] = 0; }
    return 1;
}
Now, the command that will make you secret or not .

pawn Код:
if(strcmp(cmd,"/secret",true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] > 0)
    {
         if(SecretAdmin[playerid] == 0) return SecretAdmin[playerid] = 1;
         if(SecretAdmin[playerid] == 1) return SecretAdmin[playerid] = 0;
    }
    return 1;
}
now for the /admins command(fixed) .


pawn Код:
if(strcmp(cmd,"/admins",true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
          new giveplayer[MAX_PLAYER_NAME],string[256];
          SendClientMessage(playerid,COLOR_WHITE," Admins Online :");
          for(new i = 0; i < MAX_PLAYERS; i++)
          {
                if(IsPlayerConnected(i)) && PlayerInfo[i][pAdmin] > 0 && SecretAdmin[i] == 0)
                {
                      GetPlayerName(i,giveplayer,sizeof(giveplayer));
                      format(string,sizeof(string),"%d Administratior: %s",PlayerInfo[i][pAdmin],giveplayer);
                      SendClientMessage(playerid,COLOR_GREY,string);
                }
          }
    }
    return 1;
}
Reply


Messages In This Thread
How do I make level 1 admins secret from /admins - by seanny - 27.05.2011, 07:03
Re: How do I make level 1 admins secret from /admins - by Elka_Blazer - 27.05.2011, 07:17
AW: How do I make level 1 admins secret from /admins - by Arrows73 - 27.05.2011, 07:34
Re: How do I make level 1 admins secret from /admins - by Elka_Blazer - 27.05.2011, 07:39
Re: How do I make level 1 admins secret from /admins - by (SF)Noobanatior - 27.05.2011, 08:00

Forum Jump:


Users browsing this thread: 1 Guest(s)