12.11.2013, 16:57
Can you please guys help me combine this 2 commands as a dialog?
So the output ingame it will be look like this
command:vipadmins
Код:
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;
}
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 |
