/admins.
#1

How can I do, at /admins command, if admin 1 haves admin level 3 and it's id 0 and id 1 is an admin level 2, will apear like this:
Admin Level 2: x
Admin Level 3: x
but at mine appears like this:
Admin Level 3: x
Admin Level 2: x
How can I make in the admin level order?


Sorry 4 my bad English, I'm romanian.
Reply
#2

can u show the command?
Reply
#3

Yeah, here is it:
http://pastebin.com/m5b5ce844

new AdminDuty[MAX_PLAYERS];
Reply
#4

why don't u try to reverse it , like try starting with lvl 1338 not lvl 1
Reply
#5

Because it's same..
Reply
#6

It's going in order of the players, not the admins

pawn Код:
if(!strcmp(cmdtext[1],"admins",true))
{
  new tmpstr[100];
  new counth;
  for(new ply;ply<MAX_PLAYERS;ply++)if(PlayerInfo[i][pAdmin]==1338)GetPlayerName(i,pname,100),format(tmpstr,100,"%s[%d]  [Head Admin][Level 1338][%s-Duty]",tmpstr,i,AdminDuty[i]?("On"):("Off")),SendClientMessage(playerid,0x0069c4AA,tmpstr),counth++;
  for(new ply;ply<MAX_PLAYERS;ply++)if(PlayerInfo[i][pAdmin]==1337)GetPlayerName(i,pname,100),format(tmpstr,100,"%s[%d]  [Lead of Lead Admin][Level 1337][%s-Duty]",tmpstr,i,AdminDuty[i]?("On"):("Off")),SendClientMessage(playerid,COLOR_LIGHTRED,tmpstr),counth++;
  for(new ply;ply<MAX_PLAYERS;ply++)if(PlayerInfo[i][pAdmin]==4)GetPlayerName(i,pname,100),format(tmpstr,100,"%s[%d]  [Lead Admin][Level 4][%s-Duty]",tmpstr,i,AdminDuty[i]?("On"):("Off")),SendClientMessage(playerid,0x00EC00FF,tmpstr),counth++;
  for(new ply;ply<MAX_PLAYERS;ply++)if(PlayerInfo[i][pAdmin]==3)GetPlayerName(i,pname,100),format(tmpstr,100,"%s[%d]  [Super Admin][Level 3][%s-Duty]",tmpstr,i,AdminDuty[i]?("On"):("Off")),SendClientMessage(playerid,0x796600FF,tmpstr),counth++;
  for(new ply;ply<MAX_PLAYERS;ply++)if(PlayerInfo[i][pAdmin]==2)GetPlayerName(i,pname,100),format(tmpstr,100,"%s[%d]  [Regular Admin][Level 2][%s-Duty]",tmpstr,i,AdminDuty[i]?("On"):("Off")),SendClientMessage(playerid,0x00B8D7FF,tmpstr),counth++;
  for(new ply;ply<MAX_PLAYERS;ply++)if(PlayerInfo[i][pAdmin]==1)GetPlayerName(i,pname,100),format(tmpstr,100,"%s[%d]  [Trial Admin][Level 1][%s-Duty]",tmpstr,i,AdminDuty[i]?("On"):("Off")),SendClientMessage(playerid,0xDFE200FF,tmpstr),counth++;
  if(!counth)SendClientMessage(playerid,0xFF6347AA,"* Currently no admins are online.");
  return 1;
}
Reply
#7

solved..
Reply
#8

You really don't need that many loops.

Код:
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
			if(PlayerInfo[i][pAdmin] == 2 && PlayerInfo[i][pAduty] == 0)
			{
				format(str, 256, "Trial Admin: %s (Off Duty)", PlayerName(i));
				SendClientMessage(playerid, COLOR_RED2, str);
			}
			if(PlayerInfo[i][pAdmin] == 2 && PlayerInfo[i][pAduty] == 1)
			{
				format(str, 256, "Trial Admin: %s (On Duty)", PlayerName(i));
				SendClientMessage(playerid, COLOR_GREEN, str);
			}
Do something like that, Much simpler.
Reply
#9

Solved, IsPlayerConnected ftw!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)