SA-MP Forums Archive
Admin Level Check - 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: Admin Level Check (/showthread.php?tid=437441)



Admin Level Check - dreamboxxl - 15.05.2013

Hello, it's about a command where i need to check for an admin level.

In the main GM this is used in the command:

// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)




But i need to check for the admin level also in other filterscripts.

Someone knows about to make this work in other filterscripts too?
Maybe it's in a stock or something.

I would be glad about any help.

Thank You


Re: Admin Level Check - DiGiTaL_AnGeL - 15.05.2013

Use pvars.


Re: Admin Level Check - RoBy41 - 15.05.2013

I'd like to solve this problem too. I use a gamemode and another administration filterscript with it.


Re: Admin Level Check - Pottus - 15.05.2013

Pretty easy, I wouldn't recommend PVars they're just bad practice you can make an include file for this for instance your function is GetAdminLevel(playerid) you can do this.

#define GetAdminLevel(%0) CallRemoteFunction("GetAdminLevel", "i", %0)

Then just include that into your filterscript, and yes it will be a bit slower than using PVars when calling but might actually be faster when you take into account your code won't be riddled with PVars when they could be normal variables in your gamemode.

Now unless your filterscripts is something like dynamic missions which load/unload those scripts would belong in the gamemode you should only ever have one FS loaded or none unless it's a development server.


Re: Admin Level Check - RoBy41 - 15.05.2013

Pottus, could you explain us a little bit .. ? So we make an include, placing that #define in it ? I am newbie too, so sorry.


Re: Admin Level Check - Vince - 15.05.2013

pVars were added just for things like this. It only is a bad practice if you're using them for anything else but sharing data across scripts.