14.06.2013, 18:38
I use this command but when is there are 2 or more admins online it only write 1 player
PHP код:
dcmd_admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128],name[50];
new name1[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i,name1,MAX_PLAYER_NAME);
if(AdminLevel[i] > 0)
{
if(AdminLevel[i] == 1)
{name = "{FFFF00}Server Moderator {FFFFFF}(Level 1)";}
if(AdminLevel[i] ==2)
{name = "{0000BB}Global Moderator {FFFFFF}(Level 2)";}
if(AdminLevel[i] ==3)
{name = "{ADFF2F}Administrator {FFFFFF}(Level 3)";}
if(AdminLevel[i] ==4)
{name = "{ADFF2F}Lead Adminstrator {FFFFFF}(Level 4)";}
if(AdminLevel[i] ==5)
{name = "{FF0000}Owner {FFFFFF}(Level 5)";}
format(string, 128, "\"%s\" {%s}", name1,name);
ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"ADMINS ONLINE",string,"Ok","");
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,COLOR_ADMIN,"There are no admins Online at the moment");
return 1;
}