Need help with sorting out /admins
#7

Код:
  if(strcmp(cmd, "/admins", true) == 0)
  {
	if(IsPlayerConnected(playerid))
	{
 		new count;
 		for(new w = 0; w < MAX_PLAYERS; w++)
		{
			if(IsPlayerConnected(w))
			{
                new string[256], admtext[64], player[MAX_PLAYER_NAME];
   
  				if(PlayerInfo[w][pAdmin] == 1 && PlayerInfo[w][pAdmin] <= 6)
				{
                    SendClientMessage(playerid, COLOR_CYAN, "Level One Administrators");
					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(PlayerInfo[w][pAdmin] == 2 && PlayerInfo[w][pAdmin] <= 6)
				{
                    SendClientMessage(playerid, COLOR_CYAN, "Level Two Administrators");
					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(PlayerInfo[w][pAdmin] == 3 && PlayerInfo[w][pAdmin] <= 6)
				{
                    SendClientMessage(playerid, COLOR_CYAN, "Level Three Administrators");
					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(PlayerInfo[w][pAdmin] == 4 && PlayerInfo[w][pAdmin] <= 6)
				{
                    SendClientMessage(playerid, COLOR_CYAN, "Level Four Administrators");
				    new string[256], admtext[64], 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(PlayerInfo[w][pAdmin] == 5 && PlayerInfo[w][pAdmin] <= 6)
				{
                    SendClientMessage(playerid, COLOR_CYAN, "Level Five Administrators");
					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;
}
Haven't checked it but it should work.
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: 1 Guest(s)