CMD:admins(playerid, params[])
{
new count = 1, name[24], string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] != 0)
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s%s: %s\n", string, name, Cargo(i));
count ++;
}
}
if(count > 0)
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "Membros da staff ", string, "OK", "");
}
else ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins", "No online admins", "OK", "");
return 1;
}
stock Cargo(playerid)
{
new rankname[32];
switch(PlayerInfo[playerid][pAdmin])
{
case 1: { rankname = "{FFFF00}Ajudante"; }
case 2: { rankname = "{FF8000}Moderador"; }
case 3: { rankname = "{00FFFF}Administrador"; }
case 4: { rankname = "{AF30CF}Sub-Dono(a)"; }
case 5: { rankname = "{26F321}Staff"; }
}
return rankname;
}
CMD:admins(playerid, params[])
{
new cout, str[128], rankname[23];
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
switch(PlayerInfo[i][pAdmin])
{
case 1: rankname = "{FFFF00}Ajudante";
case 2: rankname = "{FF8000}Moderador";
case 3: rankname = "{00FFFF}Administrador";
case 4: rankname = "{AF30CF}Sub-Dono(a)";
case 5: rankname = "{26F321}Staff";
}
new name[24]; GetPlayerName(i, name, sizeof(name));
format(str, 128, "Admins:\tCargo:\n%s\t%s\n", name, rankname);
cout++;
}
}
}
if(cout == 0) ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins:", "No Online Admins", "Ok", "");
else
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_TABLIST_HEADERS, "Admins Online:", str, "Ok", "");
return 1;
}
Nгo testei, aqui compilou, use aн, teste, e veja se funciona
PHP Code:
|