Help with /admins cmd
#1

hey all hru guys my problem is with a cmd was made in the Melladmin admin system i wanted to change some small stuff but didnt know how as each person scripting has his own mind that no one can edit his work as i guess so here we go the cmd shows the online admins in chat wht i want it:
1)show it in a dialog using DIALOG_STYLE_LIST
2)i want if the admin is hidden he dont show up in the admins cmd my hidden var or wht is name is PlayerInfo[playerid][Hidden] thats wht i need any help/script edit/tut/tell me wht to do is appreciated ty all and here is the cmd:
PHP код:
CMD:admins(playerid,params[])
{
    
#pragma unused params
    
SendClientMessage(playeridPURPLE"--------------------------------------");
    new 
Count[2], istring[128];
    for(
0MAX_PLAYERSi++) if(IsPlayerConnected(i))
    {
        if(
PlayerInfo[i][AdminLevel] > 0Count[0]++;
        if(
IsPlayerAdmin(i)) Count[1]++;
    }
    if((
Count[0] == && Count[1] == 0) || (Count[0] == && Count[1] >= && PlayerInfo[playerid][AdminLevel] == 0))
    {
        
SendClientMessage(playeridPURPLE"{0800FF}[SERVER]: {FFFFFF}No Adminstrators Online");
        
SendClientMessage(playeridPURPLE"--------------------------------------");
        return 
1;
    }
    if(
Count[0] == 1)
    {
        for(
0MAX_PLAYERSi++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0)
        {
            
format(stringsizeof(string), "Admin: (%d)%s [AdminLevel: %d]"iPlayerName(i), PlayerInfo[i][AdminLevel] ); SendClientMessage(playeridBLUEstring);
        }
    }
     if(
Count[0] > 1)
     {
        new 
xformat(stringsizeof(string), "Admins:");
        for(
0MAX_PLAYERSi++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0)
        {
            
format(string,sizeof(string),"%s(%d)%s [AdminLevel: %d]",string,i,PlayerName(i),PlayerInfo[i][AdminLevel]);
            
x++;
            if(
>= 5)
            {
                
SendClientMessage(playeridPURPLEstring); format(stringsizeof(string), "Admins: "); 0;
            }
            else 
format(stringsizeof(string), "%s,  "string);
        }
        if(
<= && 0) {
            
string[strlen(string)-3] = '.';
            
SendClientMessage(playeridPURPLEstring);
        }
    }
    if( (
Count[1] == 1) && (PlayerInfo[playerid][AdminLevel] > 0))
    {
        for(
0MAX_PLAYERSi++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            
format(stringsizeof(string), "RCON Admin: (%d)%s"iPlayerName(i));
            
SendClientMessage(playeridGREENstring);
        }
    }
    if(
Count[1] > 1)
    {
         new 
xformat(stringsizeof(string), "RCON Admins: ");
        for(
0MAX_PLAYERSi++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            
format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName(i));
            
x++;
            if(
>= 5)
            {
                
SendClientMessage(playeridWHITEstring); format(stringsizeof(string), "RCON Admins: "); 0;
            }
            else 
format(stringsizeof(string), "%s,  "string);
        }
        if(
<= && 0)
        {
            
string[strlen(string)-3] = '.';
            
SendClientMessage(playeridGREENstring);
        }
    }
    
SendClientMessage(playeridPURPLE"--------------------------------------");
    return 
1;

Reply
#2

Try this:

Код:
CMD:admins(playerid,params[]) 
{ 
    #pragma unused params 
    SendClientMessage(playerid, PURPLE, "--------------------------------------"); 

    new Count[2], i, string[128]; 
    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) 
    { 
        if(PlayerInfo[i][AdminLevel] > 0) Count[0]++; 
        if(IsPlayerAdmin(i)) Count[1]++; 
    } 

    if((Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][AdminLevel] == 0 && PlayerInfo[i][Hidden] == 0)) 
    { 
        SendClientMessage(playerid, PURPLE, "{0800FF}[SERVER]: {FFFFFF}No Adminstrators Online"); 
        SendClientMessage(playerid, PURPLE, "--------------------------------------"); 
        return 1; 
    } 

    if(Count[0] == 1) 
    { 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0 && PlayerInfo[i][Hidden] > 0)
        { 
            format(string, sizeof(string), "Admin: (%d)%s [AdminLevel: %d]", i, PlayerName(i), PlayerInfo[i][AdminLevel] ); SendClientMessage(playerid, BLUE, string); 
        } 
    } 

     if(Count[0] > 1) 
     { 
        new x; format(string, sizeof(string), "Admins:"); 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0 && PlayerInfo[i][Hidden] > 0) 
        { 
            format(string,sizeof(string),"%s(%d)%s [AdminLevel: %d]",string,i,PlayerName(i),PlayerInfo[i][AdminLevel]); 
            x++; 
            if(x >= 5) 
            { 
                SendClientMessage(playerid, PURPLE, string); format(string, sizeof(string), "Admins: "); x = 0; 
            } 
            else format(string, sizeof(string), "%s,  ", string); 
        } 
        if(x <= 4 && x > 0) { 
            string[strlen(string)-3] = '.'; 
            SendClientMessage(playerid, PURPLE, string); 
        } 
    } 

    if( (Count[1] == 1) && (PlayerInfo[playerid][AdminLevel] > 0 && PlayerInfo[i][Hidden] > 0)) 
    { 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) 
        { 
            format(string, sizeof(string), "RCON Admin: (%d)%s", i, PlayerName(i)); 
            SendClientMessage(playerid, GREEN, string); 
        } 
    } 
    if(Count[1] > 1) 
    { 
         new x; format(string, sizeof(string), "RCON Admins: "); 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i) && PlayerInfo[i][Hidden] > 0) 
        { 
            format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName(i)); 
            x++; 
            if(x >= 5) 
            { 
                SendClientMessage(playerid, WHITE, string); format(string, sizeof(string), "RCON Admins: "); x = 0; 
            } 
            else format(string, sizeof(string), "%s,  ", string); 
        } 
        if(x <= 4 && x > 0) 
        { 
            string[strlen(string)-3] = '.'; 
            SendClientMessage(playerid, GREEN, string); 
        } 
    } 

    SendClientMessage(playerid, PURPLE, "--------------------------------------"); 
    return 1; 
}
Reply
#3

Quote:
Originally Posted by gychem
Посмотреть сообщение
Try this:

Код:
CMD:admins(playerid,params[]) 
{ 
    #pragma unused params 
    SendClientMessage(playerid, PURPLE, "--------------------------------------"); 

    new Count[2], i, string[128]; 
    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) 
    { 
        if(PlayerInfo[i][AdminLevel] > 0) Count[0]++; 
        if(IsPlayerAdmin(i)) Count[1]++; 
    } 

    if((Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][AdminLevel] == 0 && PlayerInfo[i][Hidden] == 0)) 
    { 
        SendClientMessage(playerid, PURPLE, "{0800FF}[SERVER]: {FFFFFF}No Adminstrators Online"); 
        SendClientMessage(playerid, PURPLE, "--------------------------------------"); 
        return 1; 
    } 

    if(Count[0] == 1) 
    { 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0 && PlayerInfo[i][Hidden] > 0)
        { 
            format(string, sizeof(string), "Admin: (%d)%s [AdminLevel: %d]", i, PlayerName(i), PlayerInfo[i][AdminLevel] ); SendClientMessage(playerid, BLUE, string); 
        } 
    } 

     if(Count[0] > 1) 
     { 
        new x; format(string, sizeof(string), "Admins:"); 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0 && PlayerInfo[i][Hidden] > 0) 
        { 
            format(string,sizeof(string),"%s(%d)%s [AdminLevel: %d]",string,i,PlayerName(i),PlayerInfo[i][AdminLevel]); 
            x++; 
            if(x >= 5) 
            { 
                SendClientMessage(playerid, PURPLE, string); format(string, sizeof(string), "Admins: "); x = 0; 
            } 
            else format(string, sizeof(string), "%s,  ", string); 
        } 
        if(x <= 4 && x > 0) { 
            string[strlen(string)-3] = '.'; 
            SendClientMessage(playerid, PURPLE, string); 
        } 
    } 

    if( (Count[1] == 1) && (PlayerInfo[playerid][AdminLevel] > 0 && PlayerInfo[i][Hidden] > 0)) 
    { 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) 
        { 
            format(string, sizeof(string), "RCON Admin: (%d)%s", i, PlayerName(i)); 
            SendClientMessage(playerid, GREEN, string); 
        } 
    } 
    if(Count[1] > 1) 
    { 
         new x; format(string, sizeof(string), "RCON Admins: "); 
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i) && PlayerInfo[i][Hidden] > 0) 
        { 
            format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName(i)); 
            x++; 
            if(x >= 5) 
            { 
                SendClientMessage(playerid, WHITE, string); format(string, sizeof(string), "RCON Admins: "); x = 0; 
            } 
            else format(string, sizeof(string), "%s,  ", string); 
        } 
        if(x <= 4 && x > 0) 
        { 
            string[strlen(string)-3] = '.'; 
            SendClientMessage(playerid, GREEN, string); 
        } 
    } 

    SendClientMessage(playerid, PURPLE, "--------------------------------------"); 
    return 1; 
}
ty for your help but u didn't make it to show online admins in a dialog right..? anyways ill Rep+ u for your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)