Showing ID in /admins
#1



Alright, can someone tell me How to make this so it shows the admins ID aswell as his name like the name:

[ID:2] Tony Moretti || Lead Admin



Код:
if (strcmp(cmd, "/admins", true) == 0)
	{
    if(IsPlayerConnected(playerid))
	  {
	    SendClientMessage(playerid, COLOR_RED, " ");
	    SendClientMessage(playerid, COLOR_RED, "-| GTA:RP Admins |-");
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
				  if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341)
				  {
				    new admtext[64];
			     	if(PlayerInfo[i][pAdmin] == 1340) { admtext = "Owner"; }
			     	else if(PlayerInfo[i][pAdmin] == 1339) { admtext = "Co-Owner"; }
				    else if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Scripter"; }
				    else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Lead Admin"; }
				    else if(PlayerInfo[i][pAdmin] == 4) { admtext = "High Admin"; }
						else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Normal Admin"; }
						else if(PlayerInfo[i][pAdmin] == 2)	{ admtext = "Low Admin"; }
						else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Moderator"; }
						else { admtext = "Gamemoderator"; }
						GetPlayerName(i, sendername, sizeof(sendername));
						if(AdminDuty[i] == 0)
						{
							format(string, 256, "%s ( %s )", sendername, admtext);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else
						{
						  format(string, 256, "%s ( %s )", sendername, admtext);
							SendClientMessage(playerid, COLOR_YELLOW, string);
						}
					}
				}
			}
		}
		return 1;
	}
Reply
#2

In the format just add i as i is the playerid
Reply
#3

Try to put (% i) to show the id of the player or admin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)