Combine admin and vip dialog
#1

Can you please guys help me combine this 2 commands as a dialog?


Код:
COMMAND:admins(playerid, params[]) //level0
{
    #pragma unused params
    new tmp[1024];
    if((PlayerInfo[playerid][AdminLevel] > 0) || IsPlayerAdmin(playerid))
	{
        for(new i; i < MAX_PLAYERS; ++i)
		{
            if(IsPlayerConnected(i))
			{
                if(IsPlayerAdmin(i))
				{
                    format(tmp, sizeof tmp, "%s\n(%d)%s [RCON]", tmp, i, GetName(i));
                }
                else if(PlayerInfo[i][AdminLevel] > 0)
				{
                    format(tmp, sizeof tmp, "%s\n%s(%d) [AdminLevel: %d]", tmp, i, GetName(i), PlayerInfo[i][AdminLevel]);
                }
            }
        }
    }
	else
	{
        for(new i; i < MAX_PLAYERS; ++i)
		{
            if(IsPlayerConnected(i))
			{
                if(PlayerInfo[i][AdminLevel] > 0)
				{
                    format(tmp, sizeof tmp, "%s\n)%s(%d) [AdminLevel: %d]", tmp, i, GetName(i), PlayerInfo[i][AdminLevel]);
                }
            }
        }
    }
    if(tmp[0] == EOS)
	{
        return ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "Admin Members", "No Administrators online", "Close", "");
    }
    return ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "Admin Members", tmp[1], "Close", "");
}
Код:
COMMAND:vips(playerid, params[]) //level0
{
	new string[1024], temp[128];
	strcat(string, ""blue"Online VIPs:\n"white"");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(PlayerInfo[i][VIPLevel] >= 1 && IsPlayerConnected(i))
		{
			format(temp, sizeof(temp), "\n%s(%d) - Level: %d", GetName(i), i, PlayerInfo[i][VIPLevel]);
			strcat(string, temp);
		}
	}
	
	ShowPlayerDialog(playerid, VIPS_DIALOG, DIALOG_STYLE_MSGBOX, "VIP Members", string, "Close", "");
	return 1;
}
So the output ingame it will be look like this

Quote:

Vips/Admins <-- Dialog title

Admins <---admin text comes first
gotwarzone(4) - Admin Level (3)
PlayerName(2) - Admin Level (5)
PlayerName(3) - Admin Level (2)

Vips <--- vip text second
PlayerName(6) - Vip Level (1)
PlayerName(1) - Vip Level (3)
PlayerName(7) - Vip Level (2)

Close <--- close

command:vipadmins
Reply
#2

Anyone pleeese? Ineed your help!
Reply
#3

Hiii? Please I need your help I want to finish this.
Reply
#4

Still waiting for your help. Ty!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)