Admin Level Check
#1

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
Reply
#2

Use pvars.
Reply
#3

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

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.
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)