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

Here is the code from the script

Код:
if(strcmp(cmd, "/admins", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	if(PlayerInfo[playerid][pAdmin] >= 0)
	    	{
	    	    SendClientMessage(playerid, COLOR_WHITE, "Admins Online:");
	    	    //foreach(Player, i)
                for(new i; i<MAX_PLAYERS; i++)
				{
				    if(IsPlayerConnected(i))
				    {
						if(PlayerInfo[i][pAdmin] > 0)
						{
					    	GetPlayerName(i, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "%d Administrator: %s",PlayerInfo[i][pAdmin],giveplayer);
			            	SendClientMessage(playerid, COLOR_GREY, string);
						}
					}
				}
	    	}
		}
	    return 1;
Reply
#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
#3

Quote:

How do I make level 1 admins secret from /admins

Change

pawn Код:
if(PlayerInfo[i][pAdmin] > 0)
to

pawn Код:
if(PlayerInfo[i][pAdmin] > 1)
Reply
#4

Oh fail , he meant to make admins level 1 unvisiable at /admins ? lol ....

This forum requires that you wait 120 seconds between posts. Please try again in 35 seconds.BULLSHIT!!!!!!
Reply
#5

pawn Код:
if(strcmp(cmd, "/admins", true) == 0){
        if(IsPlayerConnected(playerid)){
            if(PlayerInfo[playerid][pAdmin] >= 0){
                SendClientMessage(playerid, COLOR_WHITE, "Admins Online:");
                //foreach(Player, i)
                for(new i; i<MAX_PLAYERS; i++)  {
                    if(!IsPlayerConnected(i))continue;
                    if(PlayerInfo[i][pAdmin] > 1){//here i changed 0 to 1 ie levels
                        GetPlayerName(i, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "%d Administrator: %s",PlayerInfo[i][pAdmin],giveplayer);
                        SendClientMessage(playerid, COLOR_GREY, string);
                    }
                }
            }
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)