"CMD:admins" Help
#4

You need to use SendClientMessage every time a player is an admin.
Check this :
PHP Code:
CMD:admins(playerid,params[])
{
    
SendClientMessage(playeridvert"___________|- Online Admins -|___________");
    new 
a;
    foreach(new 
Player// for(new i=0; i<MAX_PLAYERS; i++)
    
{
        if(
PlayerInfo[i][pAdminlvl] == 5)
        {
            
a+1;
             new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), "[Fondateur] » "blancU"%s"name);
            
SendClientMessage(playeridred1str);
        }
        else if(
PlayerInfo[i][pAdminlvl] == 4)
        {
            
a+1;
             new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), mappeur"[Mappeur] » "blancU"%s"name);
            
SendClientMessage(playeridX11_STEEL_BLUE_2str);
        }
         else if(
PlayerInfo[i][pAdminlvl] == 3)
        {
            new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), "[Admin] » "blancU"%s"name);
            
SendClientMessage(playeridredstr);
            
a+1;
        }
         else if(
PlayerInfo[i][pAdminlvl] > 0)
        {
            new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), modooPs"[Modo] » "blancU"%s"name);
            
SendClientMessage(playerid, -1str);
            
a+1;
        }
    }
    new 
str9[120];
    
format(str9sizeof(str9), "There is actually %i connected admins."a);
    
SendClientMessage(playeridX11_LIGHT_YELLOW_3str9);
    
SendClientMessage(playeridvert"|_____________________________________________________|");
    return 
1;

If you don't understand, show us your /admins!

EDIT : There is optimized version :
PHP Code:
CMD:admins(playerid,params[])
{
    
SendClientMessage(playeridvert"___________|- Online Admins -|___________");
    new 
astr[MAX_PLAYER_NAME+90];
    foreach(new 
Player// for(new i=0; i<MAX_PLAYERS; i++)
    
{
        switch(
PlayerInfo[i][pAdminlvl])
        {
            case 
5:
            {
                
a++;
                
format(strsizeof(str), "[Fondateur] » "blancU"%s"GetName(i));
                
SendClientMessage(playeridred1str);
            }
            case 
4:
            {
                
a++;
                
format(strsizeof(str), mappeur"[Mappeur] » "blancU"%s"GetName(i));
                
SendClientMessage(playeridX11_STEEL_BLUE_2str);
            }
             case 
3:
            {
                
format(strsizeof(str), "[Admin] » "blancU"%s"GetName(i));
                
SendClientMessage(playeridredstr);
                
a++;
            }
             case 
1,2:
            {
                
format(strsizeof(str), modooPs"[Modo] » "blancU"%s"GetName(i));
                
SendClientMessage(playerid, -1str);
                
a++;
            }
        }
    }
    if(
a==0) return SendClientMessage(playeridred1"There is no admin online");
    
format(strsizeof(str), "There is actually %i connected admins."a);
    
SendClientMessage(playeridX11_LIGHT_YELLOW_3str);
    
SendClientMessage(playeridvert"|_____________________________________________________|");
    return 
1;

Reply


Messages In This Thread
"CMD:admins" Help - by Filbert - 26.05.2016, 09:20
Re: "CMD:admins" Help - by Luicy. - 26.05.2016, 09:36
Re: "CMD:admins" Help - by Nin9r - 26.05.2016, 09:41
Re: "CMD:admins" Help - by Dayrion - 26.05.2016, 09:43
Re: "CMD:admins" Help - by Filbert - 26.05.2016, 09:47
Re: "CMD:admins" Help - by Zorono - 26.05.2016, 11:36
Re: "CMD:admins" Help - by IceBilizard - 26.05.2016, 12:01
Re: "CMD:admins" Help - by oMa37 - 26.05.2016, 12:51
Respuesta: "CMD:admins" Help - by maverick91 - 28.05.2016, 02:30

Forum Jump:


Users browsing this thread: 1 Guest(s)