26.05.2016, 09:43
You need to use SendClientMessage every time a player is an admin.
Check this :
If you don't understand, show us your /admins!
EDIT : There is optimized version :
Check this :
PHP Code:
CMD:admins(playerid,params[])
{
SendClientMessage(playerid, vert, "___________|- Online Admins -|___________");
new a;
foreach(new i : Player) // for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdminlvl] == 5)
{
a = a+1;
new name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "[Fondateur] » "blancU"%s", name);
SendClientMessage(playerid, red1, str);
}
else if(PlayerInfo[i][pAdminlvl] == 4)
{
a = a+1;
new name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), mappeur"[Mappeur] » "blancU"%s", name);
SendClientMessage(playerid, X11_STEEL_BLUE_2, str);
}
else if(PlayerInfo[i][pAdminlvl] == 3)
{
new name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "[Admin] » "blancU"%s", name);
SendClientMessage(playerid, red, str);
a = a+1;
}
else if(PlayerInfo[i][pAdminlvl] > 0)
{
new name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), modooPs"[Modo] » "blancU"%s", name);
SendClientMessage(playerid, -1, str);
a = a+1;
}
}
new str9[120];
format(str9, sizeof(str9), "There is actually %i connected admins.", a);
SendClientMessage(playerid, X11_LIGHT_YELLOW_3, str9);
SendClientMessage(playerid, vert, "|_____________________________________________________|");
return 1;
}
EDIT : There is optimized version :
PHP Code:
CMD:admins(playerid,params[])
{
SendClientMessage(playerid, vert, "___________|- Online Admins -|___________");
new a, str[MAX_PLAYER_NAME+90];
foreach(new i : Player) // for(new i=0; i<MAX_PLAYERS; i++)
{
switch(PlayerInfo[i][pAdminlvl])
{
case 5:
{
a++;
format(str, sizeof(str), "[Fondateur] » "blancU"%s", GetName(i));
SendClientMessage(playerid, red1, str);
}
case 4:
{
a++;
format(str, sizeof(str), mappeur"[Mappeur] » "blancU"%s", GetName(i));
SendClientMessage(playerid, X11_STEEL_BLUE_2, str);
}
case 3:
{
format(str, sizeof(str), "[Admin] » "blancU"%s", GetName(i));
SendClientMessage(playerid, red, str);
a++;
}
case 1,2:
{
format(str, sizeof(str), modooPs"[Modo] » "blancU"%s", GetName(i));
SendClientMessage(playerid, -1, str);
a++;
}
}
}
if(a==0) return SendClientMessage(playerid, red1, "There is no admin online");
format(str, sizeof(str), "There is actually %i connected admins.", a);
SendClientMessage(playerid, X11_LIGHT_YELLOW_3, str);
SendClientMessage(playerid, vert, "|_____________________________________________________|");
return 1;
}