CMD:admins(playerid)
{
new count=0, PlayerName[MAX_PLAYER_NAME], rankname[32],color[100];
new list1[900];
strcat(list1, "{FFFFFF}NO\t{FFFFFF}Name(ID)\t{FFFFFF}Level\n");
foreach(Player, i)
{
if(playerData[i][playerLevel] > 0)
{
GetPlayerName(i, PlayerName, sizeof(PlayerName));
switch(playerData[i][playerLevel])
{
case 1: { rankname = "{FFFFFF}LEVEL 1"; }
case 2: { rankname = "{FFFFFF}LEVEL 2"; }
case 3: { rankname = "{FFFFFF}LEVEL 3"; }
case 4: { rankname = "{FFFFFF}LEVEL 4"; }
case 5: { rankname = "{FFFFFF}LEVEL 5"; }
case 6: { rankname = "{FFFFFF}LEVEL 6"; }
case 7: { rankname = "{FFFFFF}LEVEL 7"; }
case 8: { rankname = "{FFFFFF}LEVEL 8"; }
}
if(playerData[i][playerAdminDuty] == true)
{
color = "{FF0770}"; // pink
}
else color = "{C0C0C0}"; //grey
format(list1, sizeof(list1), "%s\n%d\t%s%s(%d)\t%s\n", list1, count + 1,color, PlayerName, i, rankname);
count++;
}
if(count == 0)
{
SendClientMessage(playerid, -1, "There are no administrators online.");
return true;
}
ShowPlayerDialog(playerid, 555, DIALOG_STYLE_TABLIST_HEADERS, "Online Admins",list1, "Close", "");
}
return 1;
}
CMD:admins(playerid)
{
new count=0, PlayerName[MAX_PLAYER_NAME], rankname[32],color[100];
new list1[256];
strcat(list1, "{FFFFFF}NO\t{FFFFFF}Name(ID)\t{FFFFFF}Level\n");
foreach(Player, i)
{
if(!playerData[i][playerLevel])
continue;
count++;
GetPlayerName(i, PlayerName, sizeof(PlayerName));
color = ((playerData[i][playerAdminDuty])?("{FF0770}"):("{C0C0C0}"));
format(list1, sizeof(list1), "%s\n%d\t%s%s(%d)\t{FFFFFF}LEVEL %i\n", list1, count + 1,color, PlayerName, i, playerData[i][playerLevel]);
}
if(!count)
{
SendClientMessage(playerid, -1, "There are no administrators online.");
}
else
{
ShowPlayerDialog(playerid, 555, DIALOG_STYLE_TABLIST_HEADERS, "Online Admins",list1, "Close", "");
}
return 1;
}
CMD:admins(playerid)
{
new count, PlayerName[MAX_PLAYER_NAME], rankname[32], color[100];
new list1[900];
strcat(list1, "{FFFFFF}NO\t{FFFFFF}Name(ID)\t{FFFFFF}Level\n");
foreach(Player, i)
{
if(playerData[i][playerLevel] > 0)
{
GetPlayerName(i, PlayerName, sizeof(PlayerName));
switch(playerData[i][playerLevel])
{
case 1: { rankname = "{FFFFFF}LEVEL 1"; }
case 2: { rankname = "{FFFFFF}LEVEL 2"; }
case 3: { rankname = "{FFFFFF}LEVEL 3"; }
case 4: { rankname = "{FFFFFF}LEVEL 4"; }
case 5: { rankname = "{FFFFFF}LEVEL 5"; }
case 6: { rankname = "{FFFFFF}LEVEL 6"; }
case 7: { rankname = "{FFFFFF}LEVEL 7"; }
case 8: { rankname = "{FFFFFF}LEVEL 8"; }
}
if(playerData[i][playerAdminDuty] == true)
{
color = "{FF0770}"; // pink
}
else color = "{C0C0C0}"; //grey
format(list1, sizeof(list1), "%s\n%d\t%s%s(%d)\t%s\n", list1, count + 1,color, PlayerName, i, rankname);
count++;
}
}
if(count == 0)
{
SendClientMessage(playerid, -1, "There are no administrators online.");
return true;
}
ShowPlayerDialog(playerid, 555, DIALOG_STYLE_TABLIST_HEADERS, "Online Admins",list1, "Close", "");
return 1;
}
color[100];
if(playerData[i][playerAdminDuty] == true)
{
color = "{FF0770}"; // pink
}
else color = "{C0C0C0}"; //grey
new color, string[12];
color = 0xFF0770AA >>> 8;
format(string, 12, "{%06x}", color);
Problem is mate you've put the 'no admin' handler inside the loop - example, when the loop starts from player 0 if he isn't administrator it terminates because of the return. Always let the loop finish, unless you've found what you have looked for i guess?
pawn Код:
|
TRY, compile
PHP код:
|