Admin Denied
#1

How do I make an admin level 5 not to use a level 1 command ??!!
Reply
#2

pawn Код:
if(pinfo[playerid][admin], == 5)
Reply
#3

What admin script do you use?
Reply
#4

Well, let`s say Rebel-Son's, code is your admin level.

So, you do something like:

If you want only level 1 admins to use a command:
pawn Код:
if(pinfo[playerid][admin] == 1)
Or, if you want all levels beside 5 to use the command:
pawn Код:
if(pinfo[playerid][admin] > 1 && pinfo[playerid][admin] < 5 )
Or, if you want a level 1 and 3 admins to use a specific command:
pawn Код:
if(pinfo[playerid][admin] == 1 || pinfo[playerid][admin] == 3)
Anyway, these are the signs:
= - Sets something to it. For example: pinfo[playerid][admin] = 2 (sets the playerid admin level to 2)
== - Equals to .. 1 == 2
&& - AND, for example: 1 < 2 && 1 > 0
|| - OR, for example:

Or if you want a detalied tutorial, here is one: https://sampforum.blast.hk/showthread.php?tid=175275
Reply
#5

replace the if in the cmd
pawn Код:
if(PlayerInfo[playerid][Level] >= 1)
{


}
Reply
#6

Quote:
Originally Posted by josta
Посмотреть сообщение
replace the if in the cmd
pawn Код:
if(PlayerInfo[playerid][Level] >= 1)
{


}
You didn`t really read his post, did ya? Well check it again ...
Reply
#7

Do not work, I want an admin level 4 do not have access to a command from an admin level, why ??!!
Reply
#8

Give us the command ... and your admin variable.
Reply
#9

Quote:

//-----------------------------------[/fpk]-----------------------------------//
if(strcmp(cmd, "/fpk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fpk [id/name] [PKer]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 600000000000000000000000000000000000)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fpk [id/name] [PKer]");
return 1;
}
format(string, sizeof(string), "[AdminCMD] : %s Was AdminPKed by Admin %s - PKer: %s", giveplayer, sendername, (result));
SendClientMessageToAll(0x5EFB6EFF, string);
format(string, sizeof(string), "You were AdminPKed by Admin %s, you are kicked out of your faction.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pMember]=0;
PlayerInfo[giveplayerid][pLeader]=0;
PlayerInfo[giveplayerid][pRank] = 0;
PlayerInfo[giveplayerid][pChar] = 0;
new rand = random(sizeof(CIV));
SetSpawnInfo(giveplayerid, gTeam[giveplayerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[giveplayerid][pModel] = CIV[rand];
MedicBill[giveplayerid] = 0;
SpawnPlayer(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

This command has an admin level 1 can just use a higher value to those not able to use.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)