Need help with sorting out /admins
#1

Hello it's me again...
I need help with sorting out /admins command, everything works but it gets spammy when there are a lot of admins online...
Here is the code I use
Код:
  if(strcmp(cmd, "/admins", true) == 0)
  {
	if(IsPlayerConnected(playerid))
	{
 		new count;
 		for(new w = 0; w < MAX_PLAYERS; w++)
		{
			if(IsPlayerConnected(w))
			{
  				if(PlayerInfo[w][pAdmin] >= 1 && PlayerInfo[w][pAdmin] <= 6)
				{
				  new string[256];
				  new admtext[64];
				  new player[MAX_PLAYER_NAME];
					format(admtext, sizeof(admtext), "Level %d Administrator",PlayerInfo[w][pAdmin]);
					GetPlayerName(w, player, 24);
					format(string, sizeof(string), "%s: %s[%d]", admtext, player, w);
					SendClientMessage(playerid, COLOR_CYAN, string);
					count++;
				}
			}
		}
		if(count == 0)
		{
			SendClientMessage(playerid, COLOR_CYAN, "No admins present");
		}
	}
	return 1;
}
when player uses command I got this out come;
Level 5 Administrator: Admin34
Level 4 Administrator: Admin174
Level 2 Administrator: Admin422
Level 5 Administrator: Admin61
Level 5 Administrator: Admin63
Level 6 Administrator: Admin35
Level 2 Administrator: Admin31

So it's little bit messed up, is there way I can sort it like;
Level 1 Administrator: Admin1, Admins2, Admin3, Admin4, Admin5 (When there are more than 5 admins of each level online it makes new row!)
Level 1 Administrator: Admin6, Admin7.....
Level 2 Administrator: Admin
................
................
................

And the rest levels arranged from 1-6
Reply


Messages In This Thread
Need help with sorting out /admins - by leapfish - 25.02.2010, 08:55
Re: Need help with sorting out /admins - by Shubham - 25.02.2010, 11:56
Re: Need help with sorting out /admins - by woot - 25.02.2010, 12:43
Re: Need help with sorting out /admins - by leapfish - 25.02.2010, 20:35
Re: Need help with sorting out /admins - by leapfish - 26.02.2010, 08:46
Re: Need help with sorting out /admins - by leapfish - 27.02.2010, 15:12
Re: Need help with sorting out /admins - by Christopher. - 27.02.2010, 15:17

Forum Jump:


Users browsing this thread: 5 Guest(s)