Admin immune system [REP++] -
$$inSane - 07.05.2012
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..
Re: Admin immune system [REP++] -
LetsOWN[PL] - 07.05.2012
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
Re: Admin immune system [REP++] -
Ballu Miaa - 07.05.2012
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;
}
Re: Admin immune system [REP++] -
LetsOWN[PL] - 07.05.2012
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
Re: Admin immune system [REP++] -
$$inSane - 07.05.2012
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..
Re: Admin immune system [REP++] -
Ballu Miaa - 07.05.2012
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
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.
Re: Admin immune system [REP++] -
$$inSane - 08.05.2012
Quote:
Originally Posted by Ballu Miaa
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
Re: Admin immune system [REP++] -
warcodes_ - 08.05.2012
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.
Re: Admin immune system [REP++] -
$$inSane - 08.05.2012
Quote:
Originally Posted by warcodes_
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
Re: Admin immune system [REP++] -
warcodes_ - 08.05.2012
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