SA-MP Forums Archive
Making it work both Admins and Rcon Admins - 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: Making it work both Admins and Rcon Admins (/showthread.php?tid=347081)



Making it work both Admins and Rcon Admins - JaKe Elite - 31.05.2012

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


Re: Making it work both Admins and Rcon Admins - iggy1 - 31.05.2012

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.


Re: Making it work both Admins and Rcon Admins - JaKe Elite - 31.05.2012

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..


Re: Making it work both Admins and Rcon Admins - iggy1 - 31.05.2012

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


Re: Making it work both Admins and Rcon Admins - Laronic - 31.05.2012

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
}



Re: Making it work both Admins and Rcon Admins - JaKe Elite - 31.05.2012

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


Re: Making it work both Admins and Rcon Admins - iggy1 - 31.05.2012

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.


Re: Making it work both Admins and Rcon Admins - JaKe Elite - 31.05.2012

thanks it work.