[Ajuda] /Admins
#7

Quote:
Originally Posted by CSSDean
Посмотреть сообщение
como adapta isso no comando? obg!
Fiz uma adaptaзгo na funзгo para que ela possa ser utilizada diretamente em uma caixa de diбlogo:

Comando:
Код:
dcmd_admins(playerid,params[])
{ 
	#pragma unused params 
	//Alertar admins para quem digitar o comando /admins 
	if(PlayerInfo[playerid][Level] < 1)
	{ 
		new pname[MAX_PLAYER_NAME],SACSB[100];GetPlayerName(playerid, pname, MAX_PLAYER_NAME); 
		format(SACSB, sizeof(SACSB), "| CMDS-LOG | O(A) jogador(a) %s[%d] usou o comando ( /Admins )", pname, playerid); 
		CallRemoteFunction("MessageToAdmins","is",yellow,SACSB);
	}
	
	//Estrutura do comando /admins 
	new Fixed[43], ADMsDialog[43*15], Name[MAX_PLAYER_NAME], level, admscount; 
	for(new i, a = GetPlayerPoolSize(); i <= a; i++) 
	{ 
	    if(IsPlayerConnected(i)) 
	    { 
	    	level = PlayerInfo[i][Level]; 

	        if(level > 0) 
	        { 
	            if(AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0) 
	            { 
		            GetPlayerName(i, Name, sizeof(Name)); 
		            FixAdminList(Name, 1, true, Fixed);
		            strcat(ADMsDialog, Fixed);
		            admscount++; 
	        	}
	    	} 
		}
	}

	if(admscount > 0) 
		ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins", ADMsDialog, "Fechar", ""); 
	else 
		ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins", "{FF0000}Nгo hб administradores online no momento!", "Fechar", ""); 
	return 1;
}
Funзгo adaptada: (Adicionei a quebra de linha)
Код:
stock FixAdminList(adm_name[], adm_level, bool:adm_online, fixed_string[])
{
	// formato: 
	// nome do admin (24 char)  nнvel x/x on/offline
	// aaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbb ccccccc

	new len_adm_name = strlen(adm_name);
	new calc_spaces = MAX_PLAYER_NAME - len_adm_name;

	fixed_string[0] = '\0';
	strcat(fixed_string, adm_name, 43);

	for(new x = 0; x < calc_spaces; ++ x)
		strcat(fixed_string, " ", 43);

	format(fixed_string, 43, "%s Nivel %d/5 %s\n", fixed_string, adm_level, (adm_online ? ("Online") : ("Offline")));
	return 1;
}
Reply


Messages In This Thread
/Admins - by CSSDean - 05.07.2018, 13:13
Re: /Admins - by ipsLuan - 05.07.2018, 13:24
Re: /Admins - by CSSDean - 05.07.2018, 13:36
Re: /Admins - by F1N4L - 05.07.2018, 14:05
Re: /Admins - by CSSDean - 05.07.2018, 14:13
Re: /Admins - by ipsLuan - 05.07.2018, 14:19
Re: /Admins - by F1N4L - 05.07.2018, 14:30
Re: /Admins - by CSSDean - 05.07.2018, 14:33
Re: /Admins - by F1N4L - 05.07.2018, 14:40
Re: /Admins - by ipsLuan - 05.07.2018, 15:21

Forum Jump:


Users browsing this thread: 2 Guest(s)