Emergency Help needed
#1

Hello, I wanted to make LuxAdmin /admins command fully into Dialog if any one is Typing /admins they should see it in dialog this is the code please help me.

Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
        new count = 0;
        new string[128];
        new ChangeColor;
  		SendClientMessage(playerid, green, " ");
        SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
		SendClientMessage(playerid, green, " ");
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
	 		if (IsPlayerConnected(i))
 			{
				if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
 				{
					if(AccInfo[i][Level] > 5)
					{
						AdmRank = "Professional Admin";
						ChangeColor = Color_Professional_Admin;
					}
 					if(IsPlayerAdmin(i))
				  	{
				  		AdmRank = "RCON Administrator";
				  		ChangeColor = Color_RCON_Administrator;
				  	}
				    else
				    {
				 		switch(AccInfo[i][Level])
						{
							case 1: {
							AdmRank = "Basic Moderator";
							ChangeColor = Color_Basic_Moderator;
							}
							case 2: {
							AdmRank = "Moderator";
							ChangeColor = Color_Moderator;
							}
							case 3: {
							AdmRank = "Master Moderator";
							ChangeColor = Color_Master_Moderator;
							}
							case 4: {
							AdmRank = "Administrator";
							ChangeColor = Color_Administrator;
							}
							case 5: {
							AdmRank = "Master Administrator";
							ChangeColor = Color_Master_Administrator;
							}
						}
					}
		 			switch(AccInfo[i][OnDuty])
					{
						case 0: AdmDuty = "Playing!";
						case 1: AdmDuty = "On Duty!";
					}
					format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
					SendClientMessage(playerid, ChangeColor, string);
					count++;
				}
			}
		}
		if (count == 0)
		SendClientMessage(playerid,red,"No admin online in the list");
		SendClientMessage(playerid, green, " _______________________________________");
		return 1;
}
Reply
#2

Change:
pawn Код:
SendClientMessage(playerid, ChangeColor, string);
To:
pawn Код:
// Remember to change "DIALOGIDHERE" to an appropriate dialog id defined at the top of your script.
ShowPlayerDialog(playerid, DIALOGIDHERE, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "Close", "");
Reply
#3

Quote:
Originally Posted by GSRP
Посмотреть сообщение
Change:
pawn Код:
SendClientMessage(playerid, ChangeColor, string);
To:
pawn Код:
// Remember to change "DIALOGIDHERE" to an appropriate dialog id defined at the top of your script.
ShowPlayerDialog(playerid, DIALOGIDHERE, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "Close", "");
Can you please do it with the Full script please?
Reply
#4

Please needed Fast reply..
Reply
#5

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
        new count = 0, string[512];
        strcat(string, "___________ |- Online Admins -| ___________\n\n");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
            {
                if(AccInfo[i][Level] > 5)  AdmRank = "Professional Admin";
                if(IsPlayerAdmin(i)) AdmRank = "RCON Administrator";
                else
                {
                    switch(AccInfo[i][Level])
                    {
                        case 1: AdmRank = "Basic Moderator";
                        case 2: AdmRank = "Moderator";
                        case 3: AdmRank = "Master Moderator";
                        case 4: AdmRank = "Administrator";
                        case 5: AdmRank = "Master Administrator";
                    }
                }
                switch(AccInfo[i][OnDuty])
                {
                    case 0: AdmDuty = "Playing!";
                    case 1: AdmDuty = "On Duty!";
                }
                format(string, sizeof(string), "%sLevel: %d - %s (ID:%i) | %s | %s\n", string, AccInfo[i][Level], PlayerName2(i), i, AdmRank, AdmDuty);
                count++;
            }
        }
        if (count == 0)
        strcat(string, "No admin online in the list\n");
        strcat(string, "_______________________________________\n");
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Admins Online" ,string, "Close", "");
        return 1;
}
Reply
#6

Thanks Andi Evandy Rep++ Give me Back too
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)