[Ajuda] Comando /Admins
#2

Tente isso.

Код:
dcmd_admins(playerid, params[])
{
	#pragma unused params
	new string[144];
	//Alertar admins para quem digitar o comando /admins
	if(PlayerInfo[playerid][Level] < 1)
	{
		new pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
		format(string, sizeof(string), "| CMDS-LOG | %s [%i] digitou /ADMINS", pname, playerid);
		CallRemoteFunction("MessageToAdmins", "is", yellow, string);
	}
	//Estrutura do comando /admins
	new ADMsDialog[1024], Name[MAX_PLAYER_NAME];
	for(new i, a = GetMaxPlayers(); i < a; i++)
	{
	    if(IsPlayerConnected(i) && PlayerInfo[i][Level] && (AdmHidden[i] == false || PlayerInfo[playerid][Level]))
     	{
     	    GetPlayerName(i, Name, sizeof(Name));
     	    switch(PlayerInfo[i][Level])
     	    {
	         	case 1:
	            {
                    if(/*verificaзгo se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FFFF00}Ajudante\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FFFF00}Ajudante\t{00FF00}Online\n", Name);
             	}
	            case 2:
	            {
                    if(/*verificaзгo se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FF8C00}Moderador\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FF8C00}Moderador\t{00FF00}Online\n", Name);
             	}
             	case 3:
	            {
                    if(/*verificaзгo se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}Online\n", Name);
             	}
             	case 4:
	            {
                    if(/*verificaзгo se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{008bce}Administrador(a)\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{008bce}Administrador(a)\t{00FF00}Online\n", Name);
             	}
             	
             	case 5:
	            {
                    if(/*verificaзгo se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{32CD32}Staff\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{32CD32}Staff\t{00FF00}Online\n", Name);
             	}
 				default:
	            {
                    if(/*verificaзгo se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "{1E90FF}%s \tNнvel: %i \t{00FF00}AFK\n%s", Name, PlayerInfo[i][Level]);
                    else format(string, sizeof(string), "{1E90FF}%s \tNнvel: %i \t{00FF00}Online\n%s", Name, PlayerInfo[i][Level]);
             	}
	        }
	        strcat(ADMsDialog, string);
	    }
	}
	if(!strlen(ADMsDialog)) ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX, "Admins", "{FF0000}Infelizmente a equipe da administraзгo nгo estб online no momento!", "Fechar", "");
	else
	{
		strins(ADMsDialog, "{FFFFFF}Admin\t{FFFFFF}Cargo\t{FFFFFF}Status\n", 0);
		ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_TABLIST_HEADERS, "Admins", ADMsDialog, "Fechar", "");
	}
	return 1;
}
Reply


Messages In This Thread
Comando /Admins - by Hake - 13.12.2018, 11:42
Re: Comando /Admins - by JeffSantos2 - 13.12.2018, 12:41
Re: Comando /Admins - by Hake - 13.12.2018, 14:14
Re: Comando /Admins - by JeffSantos2 - 14.12.2018, 11:56

Forum Jump:


Users browsing this thread: 2 Guest(s)