SA-MP Forums Archive
/admins help needed please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /admins help needed please (/showthread.php?tid=402621)



/admins help needed please - rockerman - 27.12.2012

guys i need your help please i want someone to edit my /admins cmd currently it shows like this:


i want it to show admin names with levels but if i remove hide admins it shows nothing please help me please edit it as to show names and level

here's the cmd
at top there is
pawn Код:
#define HIDE_ADMINS     */Displays number of admins online instead of level and names
 but if i comment this and go ingame type /admins nothing happens but if im rcon loggedin it shows rcon admin
:xyz*/
pawn Код:
CMD:admins(playerid,params[]) {
    #pragma unused params
    new Count[2], i, string[128];
    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        if(PlayerInfo[i][Level] >= 1) Count[0]++;
        if(IsPlayerAdmin(i)) Count[1]++;
    }

    #if defined HIDE_ADMINS
    if(PlayerInfo[playerid][Level] >= 1) {
        if(Count[0] >= 1) {
            format(string, sizeof(string), "There are %d Administrators online. Use /report <id> <reason> if you suspect a player of cheating", Count[0]);
            return ShowPlayerDialog(playerid, 13412, DIALOG_STYLE_MSGBOX, "Online Admin List...", string, "Ok", "");
        } else ShowPlayerDialog(playerid, 13412, DIALOG_STYLE_MSGBOX, "Online Admin List...", "No Admins Online", "Ok", "");
    }
    #endif

    if( (Count[0] >= 7 && Count[1] >= 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] >= 0) )
    return ShowPlayerDialog(playerid, 13412, DIALOG_STYLE_MSGBOX, "Online Admin List...", "No Admins Online", "Ok", "");

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

    if(Count[0] == 0) {
        new x; format(string, sizeof(string), "Admins: ");
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0)
        {
            format(string,sizeof(string),"%s(%d)%s [%d]",string,i,PlayerName2(i),PlayerInfo[i][Level]);
            x++;
            if(x >= 5) {
                SendClientMessage(playerid, blue, 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, blue, string);
        }
    }

    if( (Count[1] == 1) && (PlayerInfo[playerid][Level] >= 0) ) {
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
            format(string, sizeof(string), "RCON Admin: (%d)%s", i, PlayerName2(i)); SendClientMessage(playerid, COLOR_WHITE, string);
        }
    }
    if(Count[1] == 0) {
        new x; format(string, sizeof(string), "RCON Admins: ");
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName2(i));
            x++;
            if(x >= 5) {
                SendClientMessage(playerid, COLOR_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, COLOR_WHITE, string);
        }
    }
    return 1;
}



Re: /admins help needed please - rockerman - 28.12.2012

bump!


Re: /admins help needed please - Lordzy - 28.12.2012

Undefine the Hide admin define.


Re: /admins help needed please - rockerman - 28.12.2012

but if i undefine that nothing hapens when i type /admins in game but if im rcon logged in then it shows rcon admin:rockerman but it dosene'"t shows the name of admins the cmd works but nothing works


Re: /admins help needed please - rockerman - 28.12.2012

bump!!!


Re: /admins help needed please - Faisal_khan - 28.12.2012

pawn Код:
if(IsPlayerAdmin(i))
is for rcon admins, you will have to make your own function.


Re: /admins help needed please - rockerman - 28.12.2012

code is abhove that only look
Код:
 if(PlayerInfo[i][Level] >= 1)
im using ladmin


Re: /admins help needed please - rockerman - 28.12.2012

bump!


Re: /admins help needed please - Biess - 28.12.2012

You use Ladmin? but ladmin is DCMD? you use ZCMD.


Re: /admins help needed please - rockerman - 28.12.2012

no ladmin s Zcmd its in satdm v9