Raised This Month: $ Target: $400
 0% 

again a menu problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-09-2010 , 03:41   again a menu problem
Reply With Quote #1

PHP Code:
public show_help_menu(id)
{
    new 
menuheader[32]
    new 
name[33]
    
get_user_name(id,name,32)
    
formatex(menuheader31"\yHello %s,^nHow can i help you?"name)
    new 
menu menu_create(menuheader"help_functions")
    if(
get_pcvar_num(g_freeday_manager))
    {
        
menu_additem(menu,"\wFreeday manager menu","1","0")
        
menu_additem(menu,"\wGlow menu","2","0")
        
/*menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")*/
    
}
    else
    {
        
menu_additem(menu,"\wGlow menu","1","0")
        
menu_additem(menu,"\wtest","2","0")
        
/*menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")*/
    
}
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
}
public 
help_functions(id,item,menu)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    new 
key str_to_num(data)
    switch(
key)
    {
        if(
get_pcvar_num(g_freeday_manager))
        {
            case 
1:
            {
                
//case 1
            
}
        }
        else
        {
            case 
1:
            {
                
// case 1
            
}
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

Errors :

PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Error
Argument type mismatch (argument 4on line 58
Error
Argument type mismatch (argument 4on line 59
Error
Argument type mismatch (argument 4on line 73
Error
Argument type mismatch (argument 4on line 74
Error
Only a single statement (or expressioncan follow each "case" on line 102
Error
Invalid subscript (not an array or too many subscripts): "get_pcvar_num" on line 102
Error
Expected token"}"but found "case" on line 102
Error
Too many error messages on one line on line 102

Compilation aborted
.
8 Errors.
Could not locate output file C:\Programme\Steam\steamapps\cpl_one\counter-strike\cstrike\addons\amxmodx\plugins\Untitled.amx (compile failed). 
WTF?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 02-09-2010 , 04:20   Re: again a menu problem
Reply With Quote #2

Hm... Can you show whole code?
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-09-2010 , 04:22   Re: again a menu problem
Reply With Quote #3

sorry i can't show more

PHP Code:
new g_freeday_manager

g_freeday_manager 
register_cvar("amx_freeday_manager","1")
register_forward(FM_Touch"client_touch")


public 
client_touch(ent,id)
{
    if(!
is_user_alive(id))
    {
        return 
FMRES_IGNORED
    
}
    new 
classname[32]
    
pev(entpev_classnameclassname31)
    
    if(
equali(classname"shacks_Director"))
    {        
        
show_help_menu(id)
    }
    return 
FMRES_IGNORED
}

public 
show_help_menu(id)
{
    new 
menuheader[32]
    new 
name[33]
    
get_user_name(id,name,32)
    
formatex(menuheader31"\yHello %s,^nHow can i help you?"name)
    new 
menu menu_create(menuheader"help_functions")
    if(
get_pcvar_num(g_freeday_manager))
    {
        
menu_additem(menu,"\wFreeday manager menu","1","0")
        
menu_additem(menu,"\wGlow menu","2","0")
        
/*menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")*/
    
}
    else
    {
        
menu_additem(menu,"\wGlow menu","1","0")
        
menu_additem(menu,"\wtest","2","0")
        
/*menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")
        menu_additem(menu,"\w","1","0")*/
    
}
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)

__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-09-2010 , 06:59   Re: again a menu problem
Reply With Quote #4

Both errors are really very easy to fix. It doesn't need knowledge, just some common sense and some thoughts. ( yes basically you have to use your brain )

- http://www.amxmodx.org/funcwiki.php?...item&go=search ; is that hard to search how works the function and to compare if the arguments are right ?
- With all those plugins which use switch() I'm wondering how you can think it will work this way.
__________________
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-09-2010 , 08:03   Re: again a menu problem
Reply With Quote #5

hihi. sry i was @ uni and could'nt find where i am wrong its now done. ty & sry
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 07:20.


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