23.01.2015, 09:12
I have this code to show all oline admins
It show the dialog but it only show one admin while there are three online it show one of them.
Please Help !
PHP код:
CMD:admins(playerid, params[])
{
new IsOnline = 0, string[128];
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] > 1 && IsPlayerConnected(i))
{
switch(PlayerInfo[i][pAdmin])
{
case 2: LevelName = ADMIN_LEVEL_2;
case 3: LevelName = ADMIN_LEVEL_3;
case 4: LevelName = ADMIN_LEVEL_4;
case 5: LevelName = ADMIN_LEVEL_5;
}
format(string, sizeof(string), "%s {FF2400}(%d) %s\n", PlayerName(i), i, LevelName);
IsOnline++;
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_LIST, "Online Administrators team", string, "Close", "");
if(IsOnline == 0)
{
ShowPlayerDialog(playerid, DIALOG_NO_ADMINS, DIALOG_STYLE_MSGBOX, "Online Administrators team", "There are no administrators currently online!", "Close", "");
}
}
}
return 1;
}
Please Help !