AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about admin flags stored as cvars (https://forums.alliedmods.net/showthread.php?t=6420)

Mugwump 10-01-2004 09:40

Question about admin flags stored as cvars
 
Can admin access flags be stored as cvars by their defined identifier names from amxconst ?

e.g. I am wondering if the following would work?

Code:
register_cvar( "access_level", "ADMIN_LEVEL_A") ... if ( !(get_user_flags(id) & get_cvar_num("access_level") ) {    // No access    return PLUGIN_HANDLED }

If not, how would this need to be handled?

Thanks!
-Mug

devicenull 10-01-2004 15:26

No, here's what you do.
Take the access flags you want to use it.
Ex. ADMIN_KICK and ADMIN_SLAP (Cant remember exact names off the top of my head)
do this:
Code:
server_print("The access level is %i",ADMIN_KICK&ADMIN_SLAP)

Use that in the cvar

Mugwump 10-02-2004 07:45

This works for me, thanks devnull! :)

-Mug

xeroblood 10-03-2004 11:53

Re: Question about admin flags stored as cvars
 
You could add them to a CVAR, like this:
Code:
register_cvar( "access_level", "mno" ) // 'm' = ADMIN_LEVEL_A // 'n' = ADMIN_LEVEL_B // 'o' = ADMIN_LEVEL_C // etc... //... new szCVAR[32] get_cvar_string( "access_level", szCVAR, 31 ) if ( !(get_user_flags(id) & read_flags(szCVAR) ) {    // No access    return PLUGIN_HANDLED }

:D


All times are GMT -4. The time now is 17:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.