AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Access issue (https://forums.alliedmods.net/showthread.php?t=118296)

KadiR 02-09-2010 16:23

Access issue
 
I have a small access issue to a menu, I am using this:

PHP Code:

#define ACCESS_LEVEL ADMIN_BAN 

PHP Code:

    register_clcmd"say /managetop15","Top15WebMenu"ACCESS_LEVEL

I thought that only admins with the b flag can open the menu but everyone can do it, what is wrong here?

YamiKaitou 02-09-2010 16:31

Re: Access issue
 
You have to block the usage in Top15WebMenu

fysiks 02-09-2010 18:51

Re: Access issue
 
if(!cmd_access()) return PLUGIN_HANDLED

NiQu 02-09-2010 18:58

Re: Access issue
 
PHP Code:

if ( access(idADMIN_BAN) )
    {
        
//Whatever happends if he/she got   access
    



Exolent[jNr] 02-09-2010 18:58

Re: Access issue
 
Quote:

Originally Posted by NiQu (Post 1084066)
PHP Code:

if ( access(idADMIN_BAN) )
    {
        
//Whatever happends if he/she got   access
    



You shouldn't use that for commands.

NiQu 02-09-2010 18:58

Re: Access issue
 
Why not? i use it in ultimate vip.

Exolent[jNr] 02-09-2010 19:02

Re: Access issue
 
Code:
public plugin_init( ) {     register_concmd( "kill_all", "CmdKillAll", ADMIN_BAN ); } // bad public CmdKillAll( iPlayer ) {     if( !access( iPlayer, ADMIN_BAN ) )     {         return PLUGIN_HANDLED;     }         // kill all         return PLUGIN_HANDLED; } // bad public CmdKillAll( iPlayer ) {     if( !( get_user_flags( iPlayer ) & ADMIN_BAN ) )     {         return PLUGIN_HANDLED;     }         // kill all         return PLUGIN_HANDLED; } // good public CmdKillAll( iPlayer, iLevel, iCID ) {     if( !cmd_access( iPlayer, iLevel, iCID, 1 ) )     {         return PLUGIN_HANDLED;     }         // kill all         return PLUGIN_HANDLED; }


All times are GMT -4. The time now is 07:27.

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