Raised This Month: $ Target: $400
 0% 

Problem with menus


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-21-2010 , 17:12   Re: Problem with menus
Reply With Quote #3

This is how I would do it:

PHP Code:
public cmdFunction(idlevelcid)
{
    if( !
cmd_access(idlevelcid1) )
    {
        return 
PLUGIN_HANDLED
    
}
    
    
ShowMainMenu(id)
}

ShowMainMenu(id)
{
    
// ...
}

public 
MainMenuHandler(...)
{
    
// ...
}

ShowSubMenu(id)
{
    
// ...
}

public 
SubMenuHandler(...)
{
    
// ...
    
case # { ShowMainMenu(id); }


Quote:
Originally Posted by wrecked_ View Post
You don't need that shit for level and cid. I don't know what you're doing, exactly, but here's an alternative.

Code:
if( !( get_user_flags( id ) & YOUR_ADMIN_FLAG ) ) {     return; }
If you do it this way you can't change access flag.

To avoid using cmd_access() and still get do (and still be able to change it in cmdaccess.ini):

PHP Code:
function(idlevel)
{
    if( !(
get_user_flags(id) & level) )
    {
        return 
PLUGIN_HANDLED
    
}

__________________

Last edited by fysiks; 05-21-2010 at 17:14.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:51.


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