SA-MP Forums Archive
Combine admin and vip dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Combine admin and vip dialog (/showthread.php?tid=475352)



Combine admin and vip dialog - gotwarzone - 12.11.2013

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


Re: Combine admin and vip dialog - gotwarzone - 12.11.2013

Anyone pleeese? Ineed your help!


Re: Combine admin and vip dialog - gotwarzone - 13.11.2013

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


Re: Combine admin and vip dialog - gotwarzone - 13.11.2013

Still waiting for your help. Ty!