SA-MP Forums Archive
how do you edit ladmin? - 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: how do you edit ladmin? (/showthread.php?tid=447311)



how do you edit ladmin? - Nines - 29.06.2013

I want only level 3 admins able to kick, anyone know how to do this?


Re: how do you edit ladmin? - Jstylezzz - 29.06.2013

Depends on your script, your admin variables. Can you show us the kick command?


Re: how do you edit ladmin? - TheChimpJr - 29.06.2013

Go in your script, go to the line /kick or cmd:kick. Check your admin coding so Example: PlayerInfo[playerid][pAdmin] >= 1 change the 1 to a 3. It's a bit hard to imagine your coding, so I'd like you to show us the kick command in your gamemode if you want help with the shit.


Re: how do you edit ladmin? - Nines - 29.06.2013

this if(PlayerInfo[playerid][Level] >= 2) {?


Re: how do you edit ladmin? - Twizted - 29.06.2013

Can you post the cmd:kick line and the administrator ranks here (I'd like to see ranks)? Thank you in advance.


Re: how do you edit ladmin? - nor15 - 29.06.2013

make it if(PlayerInfo[playerid][Level] >= 3)


Re: how do you edit ladmin? - Anak - 29.06.2013

pawn Код:
dcmd_kick(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 3) {// you can adjust this value
            new tmp[256], tmp2[256], Index;     tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]");
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
                GetPlayerName(player1, playername, sizeof(playername));     GetPlayerName(playerid, adminname, sizeof(adminname));
                CMDMessageToAdmins(playerid,"KICK");
                if(!strlen(tmp2))
                 {
                    format(string,sizeof(string),"%s has been kicked by an Administrator : no reason given ",playername);
                    SendClientMessageToAll(pink,string);
                    SaveToFile("KickLog",string);
                    SendClientMessage(pink,player1,string);
                    print(string);
                    return Kick(player1);
                }
                else
                 {
                    format(string,sizeof(string),"%s has been kicked by an Administrator  reason: %s ",playername,params[2]);
                    SendClientMessageToAll(pink,string);
                    SendClientMessage(pink,player1,string);
                    SaveToFile("KickLog",string);
                    print(string);
                    return Kick(player1);
                 }
            } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin");
        } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Код:
I want only level 3 admins able to kick, anyone know how to do this?
hmm if you only want level 3(not greater) admin to use this command.
replace with
pawn Код:
if(PlayerInfo[playerid][Level] == 3)
* This command is taken from ladmin to compare with your FS