Admin immune system [REP++]
#1

Can anyone give me the code that can be written with my admin command like kickall, but the admins in the server also gets kicked, so i need immune system for the admins which have no response to higer level admins.. please give me and i will pay u some REP ++.. please i need it before completing my admin system..
Reply
#2

Hello.
All you need is to make an.. 'Exception', while there is a loop.
Here is sample code for /kickall command.
This will kick everyone who is not admin:
pawn Code:
COMMAND:kickall(playerid, params[])
{
    if(IsPlayerAdmin(playerid)) // Is playerid RCON admin?
    {
        // Yes
        for(new i = 0; i < MAX_PLAYERS; i++) // Loop through all players
        {
            if(!IsPlayerAdmin(i)) // is player with id 'i' not logged as RCON admin?
            {
                //Yes
                Kick(i);
            }
        }
    }
    else
    {
        SendClientMessage(playerid, 0xFF0000, "You are not admin");
    }
    return 1;
}
Should work.. All clear? If you'll have any problems, just PM me.

Greetz,
LetsOWN
Reply
#3

Here's the correct ZCMD based command.
pawn Code:
COMMAND:kickall(playerid, params[])
{
    if(IsPlayerAdmin(playerid)) // Is playerid RCON admin?
    {
        // Yes
        for(new i = 0; i < MAX_PLAYERS; i++) // Loop through all players
        {
            if(playerid == i) return 0; // By adding this check. It wont kick you. You can also add further checks.
            else return Kick(i);
        }
    }
    else return SendClientMessage(playerid, 0xFF0000, "You need to be logged in to the Rcon to use this command!");

    return 1;
}
Reply
#4

Ey, ey, ey.
Ballu Miaa, why you just copied my sample and just added your own 5 cents? It's a bit unfair, especially if I posted it 2 mins before you ..
Greetz,
LetsOWN
Reply
#5

i don't need kickall command, as i already have that command, i need immune system for admins, as lower level admin can't use their commands on higher level admins..
Reply
#6

Escuseme? I dont care about the rep. I think the command he wanted will not kick the playerid which used it i guess.

So i edited it a bit to make it better at functioning. You dont have copyrights to a ZCMD command man. Anyone can make codes looking just similar to your's.

Quote:
Originally Posted by $$inSane
View Post
i don't need kickall command, as i already have that command, i need immune system for admins, as lower level admin can't use their commands on higher level admins..
EDIT: For that please paste any of your admin command here. Ill fix it for ya.
Reply
#7

Quote:
Originally Posted by Ballu Miaa
View Post
Escuseme? I dont care about the rep. I think the command he wanted will not kick the playerid which used it i guess.

So i edited it a bit to make it better at functioning. You dont have copyrights to a ZCMD command man. Anyone can make codes looking just similar to your's.



EDIT: For that please paste any of your admin command here. Ill fix it for ya.
OK
but i want immune for my all admin commands and there r more than 100. so plz give me the immune sys code
Reply
#8

For starters, what is your admin variable? We need to know what its named, to be able to make an immune system based off it.
Reply
#9

Quote:
Originally Posted by warcodes_
View Post
For starters, what is your admin variable? We need to know what its named, to be able to make an immune system based off it.
These are the variables. Please make and give immune system for my admin system.

pawn Code:
new PlayerInfo[MAX_PLAYERS][pInfo];//VARIABLE

if(PlayerInfo[playerid][AdminLevel] >= 1)//FOR ADMINS
Reply
#10

You can simply add this if statement to the command.

Code:
if(PlayerInfo[playerid2][AdminLevel] >= 1) return SendClientMessage(playerid, -1, "Error: You cant use this command on that admin");//You need to define playerid2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)