[Ajuda] /Admins
#5

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Funзгo:
Код:
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", fixed_string, adm_level, (adm_online ? ("Online") : ("Offline")));
	return 1;
}
Uso:
Код:
new str[43]; // String que receberб a linha fixada
FixAdminList("Fulano", 1, true, str);
print(str); // Output de teste
FixAdminList("Fulano2", 3, false, str);
print(str); // Output de teste
Saнda:
Код:
Fulano                   Nivel 1/5 Online

Fulano2                  Nivel 3/5 Offline
como adapta isso no comando? obg!
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: 1 Guest(s)