30.05.2015, 09:28
Hi there,
I've changed simple style of /admins (SendClientMessage) to textdraw style.
But there's one problem. This only shows 1 randomly admin.
What I should do to fix it and show all admins?
Here's the code :
I've changed simple style of /admins (SendClientMessage) to textdraw style.
But there's one problem. This only shows 1 randomly admin.
What I should do to fix it and show all admins?
Here's the code :
PHP код:
if(strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
//SendClientMessage(playerid, COLOR_WHITE, "Admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pStealthed] == 0)
{
new alevel[50];
if(PlayerInfo[i][pAdmin] == 1) { alevel = "{951FD0}Probie Admin"; }
if(PlayerInfo[i][pAdmin] == 2) { alevel = "{00FF0C}Junior Admin"; }
if(PlayerInfo[i][pAdmin] == 3) { alevel = "{00FF0C}General Admin"; }
if(PlayerInfo[i][pAdmin] >= 4 && PlayerInfo[i][pAdmin] <= 1335) { alevel = "{F4A460}Senior Admin"; }
if(PlayerInfo[i][pAdmin] >= 1336 && PlayerInfo[i][pAdmin] <= 99998) { alevel = "{FF0000}Head Admin"; }
if(PlayerInfo[i][pAdmin] >= 99999) { alevel = "{B52B19}Executive Admin"; }
format(string, 256, "{FFFFFF}[ %s {FFFFFF}] %s", alevel, PlayerRPName(i));
//SendClientMessage(playerid, COLOR_GREY, string);
ShowPlayerDialog(playerid,1378,DIALOG_STYLE_LIST,"{FFFFFF}Admins Online",string,"Ok","");
}
}
}
}
return 1;
}