Raised This Month: $32 Target: $400
 8% 

Problem with menus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-21-2010 , 15:42   Problem with menus
Reply With Quote #1

I have made a menus and 1 of them have a submenu,so i put...


PHP Code:
case :
{
        
Submenu(id);

PHP Code:
Submenu (id)
{
       
//Menu's things
}

//Handler

if(item == MENU_EXIT)
{
    
menu_destroy(Menu);
    
         if(
is_user_connected(id))
                
1stMenu(id);
    return 
PLUGIN_HANDLED;

When i try to compile,this send me this error
Code:
Error: Number of arguments does not match definition on line 802
But 1stMenu,i'ts just for admins (all menus are just for admins)...so i use
public 1stMenu(id,level,cid)

I tried to put 1stMenu(id,level,cid) (to send back to 1stMenu)
But when i put that,compiler shows Undefined simbol : level,Undefined simbol : cid....
How i can make this?

btw I'm ussing amxmisc.inc

Last edited by #8 SickneSS; 05-21-2010 at 15:46.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-21-2010 , 15:47   Re: Problem with menus
Reply With Quote #2

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; }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-21-2010 , 16:23   Re: Problem with menus
Reply With Quote #3

thanks!
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-21-2010 , 17:12   Re: Problem with menus
Reply With Quote #4

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
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-21-2010 , 17:14   Re: Problem with menus
Reply With Quote #5

Thanks,i tried with get_user_flags,and make some problems,so,i use that ,Thanks!
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
Reply



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 23:34.


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