Small thing for Ladmin.
#1

Alright i got a question,
How do i make it so if a player name is connected IG Example Kane_Williams and his name will appear as Owner
In the /admins list.

pawn Код:
dcmd_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] > 0) Count[0]++;
        if(IsPlayerAdmin(i)) Count[1]++;
    }

    #if defined HIDE_ADMINS
    if(PlayerInfo[playerid][Level] == 0) {
        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 SendClientMessage(playerid, blue, string);
        } else return SendClientMessage(playerid, blue, "No Administrators online");
    }
    #endif

    if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");

    if(Count[0] == 1) {
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0) {
            format(string, sizeof(string), "Admin: (%d)%s [%d]", i, PlayerName2(i), PlayerInfo[i][Level] ); 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][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] > 1) {
        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;
}
Reply
#2

Just rename RCON Admin to Owner.
Reply
#3

Quote:
Originally Posted by Duck
Посмотреть сообщение
Just rename RCON Admin to Owner.
I dont want to use the Rcon rank really.
Reply
#4

Dude, You have to use for server requirements!
Reply
#5

add this under the close bracket of the rcon thingy.
pawn Код:
if( (Count[1] == 1) && (PlayerInfo[playerid][Level] > OWNERLEVEL) ) { // change OWNERLEVEL with the current owner level.
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) {
            format(string, sizeof(string), "Owner: (%d)%s", i, PlayerName2(i));
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
}
btw next time post this in scripting help section -
http://forum.sa-mp.com/forumdisplay.php?f=12
Reply
#6

Quote:
Originally Posted by xkirill
Посмотреть сообщение
add this under the close bracket of the rcon thingy.
pawn Код:
if( (Count[1] == 1) && (PlayerInfo[playerid][Level] > OWNERLEVEL) ) { // change OWNERLEVEL with the current owner level.
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) {
            format(string, sizeof(string), "Owner: (%d)%s", i, PlayerName2(i));
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
}
btw next time post this in scripting help section -
http://forum.sa-mp.com/forumdisplay.php?f=12
Sorry and these errors/warnings

pawn Код:
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3100) : warning 217: loose indentation
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3106) : warning 217: loose indentation
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3106) : error 017: undefined symbol "x"
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3110) : warning 209: function "dcmd_admins" should return a value
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3111) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

Quote:
Originally Posted by Biess
Посмотреть сообщение
Sorry and these errors/warnings

pawn Код:
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3100) : warning 217: loose indentation
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3106) : warning 217: loose indentation
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3106) : error 017: undefined symbol "x"
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3110) : warning 209: function "dcmd_admins" should return a value
C:\Users\Bichan\Desktop\UKTDM\filterscripts\ladmin4v2.pwn(3111) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
at the end of the command should be -
pawn Код:
return 1;
}
the script should look like this -
pawn Код:
dcmd_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] > 0) Count[0]++;
        if(IsPlayerAdmin(i)) Count[1]++;
    }

    #if defined HIDE_ADMINS
    if(PlayerInfo[playerid][Level] == 0) {
        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 SendClientMessage(playerid, blue, string);
        } else return SendClientMessage(playerid, blue, "No Administrators online");
    }
    #endif

    if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");

    if(Count[0] == 1) {
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0) {
            format(string, sizeof(string), "Admin: (%d)%s [%d]", i, PlayerName2(i), PlayerInfo[i][Level] ); 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][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] == 1) && (PlayerInfo[playerid][Level] > OWNERLEVEL) ) { // change OWNERLEVEL with the current owner level.
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) {
            format(string, sizeof(string), "Owner: (%d)%s", i, PlayerName2(i));
            SendClientMessage(playerid, COLOR_WHITE, 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))
        {
            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;
}
Reply
#8

Quote:
Originally Posted by xkirill
Посмотреть сообщение
at the end of the command should be -
pawn Код:
return 1;
}
the script should look like this -
pawn Код:
dcmd_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] > 0) Count[0]++;
        if(IsPlayerAdmin(i)) Count[1]++;
    }

    #if defined HIDE_ADMINS
    if(PlayerInfo[playerid][Level] == 0) {
        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 SendClientMessage(playerid, blue, string);
        } else return SendClientMessage(playerid, blue, "No Administrators online");
    }
    #endif

    if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");

    if(Count[0] == 1) {
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0) {
            format(string, sizeof(string), "Admin: (%d)%s [%d]", i, PlayerName2(i), PlayerInfo[i][Level] ); 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][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] == 1) && (PlayerInfo[playerid][Level] > OWNERLEVEL) ) { // change OWNERLEVEL with the current owner level.
        for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) {
            format(string, sizeof(string), "Owner: (%d)%s", i, PlayerName2(i));
            SendClientMessage(playerid, COLOR_WHITE, 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))
        {
            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;
}
No errors, nor warnings. but it doesn't work
Reply
#9

So what are you asking for? You want to change it so the admin rank is called 'Owner'?
Or if a player has the name 'Kane_Williams', then he will show up as owner?
Reply
#10

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
So what are you asking for? You want to change it so the admin rank is called 'Owner'?
Or if a player has the name 'Kane_Williams', then he will show up as owner?
If im not wrong,
He/she might be asking for Owner rank in admin list.
Just like LuxAdmin,there are rank wise for each level.
Here he/she might need that.
Example:
Код:
Online Admins
Kane_Williams[Lv:10] Owner
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)