how to integrate 2 commands [REPS!]
#1

Hello iv VIPS And Admins Command i want to make if someone type /admins show to him admins and vips both!

Here is the Cmd of Admins
Код:
CMD:admins(playerid,params[])
{
   new IsOnline = 0;
   strdel(JLstring,0,500);
   foreach(Player, i)
   {
      if (pInfo[i][pLevel] >= 1 && pInfo[i][AHide] == 0)
	  {
 		      switch(pInfo[i][pLevel])
              {
			      case 1: {
				  LevelName = ADMIN_LEVEL_1;
				  LevelColor = LEVEL_1_COLOR;
				  }
				  case 2: {
				  LevelName = ADMIN_LEVEL_2;
				  LevelColor = LEVEL_2_COLOR;
				  }
				  case 3: {
				  LevelName = ADMIN_LEVEL_4;
				  LevelColor = LEVEL_3_COLOR;
				  }
				  case 4: {
				  LevelName = ADMIN_LEVEL_3;
				  LevelColor = LEVEL_4_COLOR;
				  }
				  case 5: {
				  LevelName = ADMIN_LEVEL_5;
				  LevelColor = LEVEL_5_COLOR;
				  }
				  default: {
				  LevelName = ADMIN_LEVEL_6;
				  LevelColor = LEVEL_6_COLOR;
				  }
	          }
	          if (IsPlayerAdmin(i)) format(Jstring, 128, "{FF0000}%s - Level: %d (RCON Administrator)\n",GetName(i),pInfo[i][pLevel]);
	          else format(Jstring, 128, "%s%s - Level: %d (%s)\n",LevelColor,GetName(i),pInfo[i][pLevel],LevelName);
			  strcat(JLstring, Jstring, sizeof(JLstring));
			  IsOnline++;
		}
   }
   if (IsOnline == 0)
   ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"{00FFE6}Online admins","{FF0000}No admins are online!" ,"OK","");
   else
   {
       if(IsOnline == 1) ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"{00FFE6}1 admin online",JLstring ,"OK","");
	   else format(Jstring, 128, "{00FFE6}%d admins online",IsOnline), ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,Jstring,JLstring ,"OK","");
   }
   strdel(JLstring,0,500);
   return 1;
}
Here is the CMD of VIPS
Код:
CMD:vips(playerid,params[])
{
   new IsOnline = 0;
   strdel(JLstring,0,500);
   foreach(Player, i)
   {
      if (pInfo[i][Donator] >= 1)
	  {
 		      switch(pInfo[i][Donator])
              {
			      case 1:
				  {
					  LevelName = VIP_LEVEL_1;
					  LevelColor = VIP_1_COLOR;
				  }
				  case 2:
				  {
					  LevelName = VIP_LEVEL_2;
					  LevelColor = VIP_2_COLOR;
				  }
				  default:
				  {
					  LevelName = VIP_LEVEL_3;
					  LevelColor = VIP_3_COLOR;
				  }
	          }
			  format(Jstring, 128, "%s%s - Level: %d (%s)\n",LevelColor,GetName(i),pInfo[i][Donator],LevelName);
			  strcat(JLstring, Jstring, sizeof(JLstring));
			  IsOnline++;
		}
   }
   if (IsOnline == 0)
   ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"{00FFE6}Online V.I.P members","{FF0000}No V.I.P members online!" ,"OK","");
   else
   {
       if(IsOnline == 1) ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,"{00FFE6}1 V.I.P member online",JLstring ,"OK","");
	   else format(Jstring, 128, "{00FFE6}%d V.I.P members online",IsOnline), ShowPlayerDialog(playerid,JDIALOGS+165,DIALOG_STYLE_MSGBOX,Jstring,JLstring ,"OK","");
   }
   strdel(JLstring,0,500);
   return 1;
}
+ Rep for help ! thanks
Reply
#2

Help plz
Reply
#3

/admins command :
Код:
CMD:admins(playerid,params[])
{
    #pragma unused params
        new count = 0;
        new string[128];
        new ChangeColor;
  		SendClientMessage(playerid, green, " ");
        SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
		SendClientMessage(playerid, green, " ");
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
	 		if (IsPlayerConnected(i))
 			{
				if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0) 
 				{
					if(AccInfo[i][Level] > 5)
					{
						AdmRank = "Professional Admin";
						ChangeColor = Color_Professional_Admin;
					}
 					if(IsPlayerAdmin(i))
				  	{
				  		AdmRank = "RCON Administrator";
				  		ChangeColor = Color_RCON_Administrator;
				  	}
				    else
				    {
				 		switch(AccInfo[i][Level])
						{
							case 1: {
							AdmRank = "Basic Moderator";
							ChangeColor = Color_Basic_Moderator;
							}
							case 2: {
							AdmRank = "Moderator";
							ChangeColor = Color_Moderator;
							}
							case 3: {
							AdmRank = "Master Moderator";
							ChangeColor = Color_Master_Moderator;
							}
							case 4: {
							AdmRank = "Administrator";
							ChangeColor = Color_Administrator;
							}
							case 5: {
							AdmRank = "Master Administrator";
							ChangeColor = Color_Master_Administrator;
							}
						}
					}
		 			switch(AccInfo[i][OnDuty])
					{
						case 0: AdmDuty = "Playing!";
						case 1: AdmDuty = "On Duty!";
					}
					format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
					SendClientMessage(playerid, ChangeColor, string);
					count++;
				}
			}
		}
		if (count == 0)
		SendClientMessage(playerid,red,"No admin online in the list");
		SendClientMessage(playerid, green, " _______________________________________");
		return 1;
}
/vips command:
Код:
CMD:vip(playerid,params[])
{
	#pragma unused params
	if(AccInfo[playerid][LoggedIn] == 1)
	{
		if(AccInfo[playerid][Level] >= 1)
		{
	 		new bool:First2 = false;
	 		new Count, i;
		    new string[128];
			new adminname[MAX_PLAYER_NAME];
		    for(i = 0; i < MAX_PLAYERS; i++)
			if(IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
			Count++;
			
			if(Count == 0)
			return SendClientMessage(playerid,red, "No players have VIP Account!");
			
		    for(i = 0; i < MAX_PLAYERS; i++)
			if(IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
			{
				if(AccInfo[i][pVip] > 0)
				{
					switch(AccInfo[i][pVip])
    				{
					case 1: AccType = "Silver";
					case 2: AccType = "Gold";
					case 3: AccType = "Premium";
					}
				}
 				GetPlayerName(i, adminname, sizeof(adminname));
				if(!First2)
				{
					format(string, sizeof(string), "VIP Players: %d(%s)", i,AccType);
					First2 = true;
				}
   					else format(string,sizeof(string),"%s, %d(%s)",string,i,AccType);
	        }
		    return SendClientMessage(playerid,yellow,string);
		}
		else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	}
	else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply
#4

Quote:
Originally Posted by AhmedMohamed
Посмотреть сообщение
/admins command :
Код:
CMD:admins(playerid,params[])
{
    #pragma unused params
        new count = 0;
        new string[128];
        new ChangeColor;
  		SendClientMessage(playerid, green, " ");
        SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
		SendClientMessage(playerid, green, " ");
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
	 		if (IsPlayerConnected(i))
 			{
				if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0) 
 				{
					if(AccInfo[i][Level] > 5)
					{
						AdmRank = "Professional Admin";
						ChangeColor = Color_Professional_Admin;
					}
 					if(IsPlayerAdmin(i))
				  	{
				  		AdmRank = "RCON Administrator";
				  		ChangeColor = Color_RCON_Administrator;
				  	}
				    else
				    {
				 		switch(AccInfo[i][Level])
						{
							case 1: {
							AdmRank = "Basic Moderator";
							ChangeColor = Color_Basic_Moderator;
							}
							case 2: {
							AdmRank = "Moderator";
							ChangeColor = Color_Moderator;
							}
							case 3: {
							AdmRank = "Master Moderator";
							ChangeColor = Color_Master_Moderator;
							}
							case 4: {
							AdmRank = "Administrator";
							ChangeColor = Color_Administrator;
							}
							case 5: {
							AdmRank = "Master Administrator";
							ChangeColor = Color_Master_Administrator;
							}
						}
					}
		 			switch(AccInfo[i][OnDuty])
					{
						case 0: AdmDuty = "Playing!";
						case 1: AdmDuty = "On Duty!";
					}
					format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
					SendClientMessage(playerid, ChangeColor, string);
					count++;
				}
			}
		}
		if (count == 0)
		SendClientMessage(playerid,red,"No admin online in the list");
		SendClientMessage(playerid, green, " _______________________________________");
		return 1;
}
/vips command:
Код:
CMD:vip(playerid,params[])
{
	#pragma unused params
	if(AccInfo[playerid][LoggedIn] == 1)
	{
		if(AccInfo[playerid][Level] >= 1)
		{
	 		new bool:First2 = false;
	 		new Count, i;
		    new string[128];
			new adminname[MAX_PLAYER_NAME];
		    for(i = 0; i < MAX_PLAYERS; i++)
			if(IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
			Count++;
			
			if(Count == 0)
			return SendClientMessage(playerid,red, "No players have VIP Account!");
			
		    for(i = 0; i < MAX_PLAYERS; i++)
			if(IsPlayerConnected(i) && AccInfo[i][pVip] > 0)
			{
				if(AccInfo[i][pVip] > 0)
				{
					switch(AccInfo[i][pVip])
    				{
					case 1: AccType = "Silver";
					case 2: AccType = "Gold";
					case 3: AccType = "Premium";
					}
				}
 				GetPlayerName(i, adminname, sizeof(adminname));
				if(!First2)
				{
					format(string, sizeof(string), "VIP Players: %d(%s)", i,AccType);
					First2 = true;
				}
   					else format(string,sizeof(string),"%s, %d(%s)",string,i,AccType);
	        }
		    return SendClientMessage(playerid,yellow,string);
		}
		else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	}
	else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Huh? i want to make the commands admins show also the vips so when someone type /admins see the online vips also.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)