SA-MP Forums Archive
Code - 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: Code (/showthread.php?tid=628883)



Code - Dangjai - 16.02.2017

Hello i wanna make like in /admins
Admininstrators and very important players in same list

my code
Код:
CMD:admins(playerid)
{
    if(pLogged[playerid] == false)
		return Error(playerid, "You must be registered to use this command! (/register)");

	new count;
	foreach(Player, ii)
	{
		if(pAdmin[ii] > 0 && pHidden[ii] == 0) count++;
	}

	if(count == 0)
 	{
	 	//SendClientMessage(playerid, COLOR_GREY, ""OSF" "GREY_E"There are no administrators online.");
	 	//SendClientMessage(playerid, COLOR_GREY, ""OSF" "GREY_E"Use /report if you suspect a player of cheating.");
	 	GameTextForPlayer(playerid,"~Y~NO ADMINS ONLINE",2000,3);
	 	if(pAdmin[playerid] >= 1) ShowHiddenAdmins(playerid);
	 	return true;
 	}

    new line3[900], displayed;
    if(count == 1)
    {
		str = ""BLUE_E"OSF: {FFFFFF}Admins";
		line3 = ""WHITE_E"Total of "YELLOW_E"1 "WHITE_E"Admin online:\n";
	}
	else
	{
    	format(str, sizeof(str), ""BLUE_E"OSF: {FFFFFF}Admins");
    	format(line3, sizeof(line3), ""WHITE_E"Total of "YELLOW_E"%d "WHITE_E"Admin online:\n", count);
	}

    foreach(Player, ii)
	{
		GetPlayerName(ii, PlayerName, sizeof(PlayerName));
	    if(pAdmin[ii] > 0 && pHidden[ii] == 0)
	    {
			switch(pAdmin[ii])
	        {
	            case 1: tmp = ""WHITE_E"(Moderator)";
	            case 2: tmp = ""WHITE_E"(Administrator)";
	            case 3: tmp = ""WHITE_E"(Lead Administrator)";
	            case 4: tmp = ""WHITE_E"(Head Administrator)";
	            case 5: tmp = ""WHITE_E"(Executive Administrator)";
			}
			if(displayed == 0)
			{
				if(cAFK[ii] > 20)
				{
	        		format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s "WHITE_E"[AFK]", line3, PlayerName, tmp);
  				}
		  		else format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s", line3, PlayerName, tmp);
			}
			else
			{
				if(cAFK[ii] > 20)
				{
			    	format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s "WHITE_E"[AFK]", line3, PlayerName, tmp);
   				}
		  		else format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s", line3, PlayerName, tmp);
			}
			displayed = displayed + 1;
		}
	}
	format(line3, sizeof(line3), "%s\n\n\n"WHITE_E"To report a hacker, use "YELLOW_E"/report!\n\n"GREY2_E"Do not PM any admins for no reason.\nThe server is also being watched from IRC.", line3);

	ShowPlayerDialog(playerid, 16, DIALOG_STYLE_MSGBOX, str, line3, "Close", "");

	if(pAdmin[playerid] >= 2) ShowHiddenAdmins(playerid);
	return true;
}



Re: Code - Dangjai - 16.02.2017

Hello? Anyone


Re: Code - Dangjai - 17.02.2017

Bump, has been 24 hours.


Re: Code - Sew_Sumi - 17.02.2017

What's wrong with it currently?

This isn't script for you, this is scripting help... If you need a scripter, go find the Looking for Scripter/Helper thread.


We're not psychic...


Re: Code - Dangjai - 17.02.2017

I mean i want to add just in the code admins and vips
like Admins
Name , etc

VIPS
name , etc just that


Re: Code - Sew_Sumi - 17.02.2017

Should learn to script etc...