Making it work both Admins and Rcon Admins
#1

How to make it work for both Admins and Rcon Admins

pawn Код:
if(pData[playerid][Admin] < 4 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "*** You are not Head Administrator ***");
seems like it doesn't work i need to login as Rcon to make it work
Reply
#2

That should work. Try printing the value of the variable to make sure it's right.

pawn Код:
printf( "DEBUG: pData[playerid][Admin] == %d", pData[playerid][Admin] );
if(pData[playerid][Admin] < 4 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "*** You are not Head Administrator ***");
Show us what that prints to the console.
Reply
#3

I think i solve it i remove ! in IsPlayerAdmin

@iggy it works fine it just detect that i'm not head admin, i need to login as rcon to make it work..
Reply
#4

If you remove the '!' then Rcon will not be able to use the command.
Reply
#5

pawn Код:
if(pData[playerid][Admin] < 4 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "*** You are not Head Administrator ***");
{
    //This code will work for admins with level 4++ and for rcon admins
}
Reply
#6

Is there any other way to make it work for both?
Reply
#7

pawn Код:
if(pData[playerid][Admin] >= 4 || IsPlayerAdmin(playerid))
{
    //will work if the player is more than or equal to lvl 4 OR Rcon admin
}
else
{
    SendClientMessage(playerid, COLOR_RED, "*** You are not Head Administrator ***");
}
EDIT: If that doesn't work then your var isn't holding the correct value. And the player isn't rcon.
Reply
#8

thanks it work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)