08.02.2018, 21:21
Hello community,
today I have a problem with my /admins command which is supposed to show all avaliable administrators online! The problem is, that it shows only one admin, and that is fore example me.
I was admin, i give admin levels to other players and the only one on the server visible in the admin list was I.
Here is my code:
For any solutionable help I would be happy for and appreciate it so much, that i would add an reputation point to the person, that solves my problem.
THank you very much.
today I have a problem with my /admins command which is supposed to show all avaliable administrators online! The problem is, that it shows only one admin, and that is fore example me.
I was admin, i give admin levels to other players and the only one on the server visible in the admin list was I.
Here is my code:
PHP код:
CMD:admins(playerid, params [] )
{
new online=0, level[30], string[256];
for(new J = GetMaxPlayers(), i; i < J; i++ )
{
if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin])
{
online ++;
switch(PlayerInfo [ i ][ pAdmin ] )
{
case 1: level = "Administrбtor-kandidбt";
case 2: level = "Administrбtor";
case 3: level = "Vedoucн Administrбtor";
case 4: level = "Hlavnн Administrбtor";
case 5: level = "Sprбvce serveru";
}
format(string, sizeof(string), "%s {FF0000}%s {FFCC00}/pm %d <sem vpiљte vбљ dotaz>\n\r", GetName(i), level, i);
}
}
if(!online)
{
ShowPlayerDialog(playerid, DIALOG_NOADMINS, DIALOG_STYLE_MSGBOX, "Online administrбtori", "Momentбlne na serveru nenн prнtomen ћбdnэ administrбtor", "Ok", "");
}
else
{
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Online administrбtoři", string, "Ok", "");
}
return 1;
}
THank you very much.