AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What is wrong? (https://forums.alliedmods.net/showthread.php?t=192639)

pacheco 08-12-2012 14:29

What is wrong?
 
Code:

8/12/2012 - 15:24:19: [AMXX] Displaying debug trace (plugin "**.amxx")
08/12/2012 - 15:24:19: [AMXX] Run time error 10: native error (native "show_menu")
08/12/2012 - 15:24:19: [AMXX] [0] **.sma::menuEdit (line 839)

PHP Code:


const KEYS_MANG MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0

public plugin_init()
    
register_menu("Manager Menu"KEYSMENU"menu_manager");

public 
menuEdit(id)
{
[...]

     
show_menu(idKEYS_MANGmenu, -1"Manager Menu")



YamiKaitou 08-12-2012 14:30

Re: What is wrong?
 
Full code and error please

pacheco 08-12-2012 14:49

Re: What is wrong?
 
Ok, here is one part of the code

PHP Code:

#include <amxmodx>
#include <amxmisc>

const KEYS_MANG MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0

public plugin_init()
{
    
register_menu("Manager Menu"KEYS_MANG"menu_manager")

    
register_clcmd("say /admin""menuEdit");
}

public 
menuEdit(id)
{
    if(
get_user_flags(id) & ADMIN_BAN)
    {
        new 
stName[33]
        
get_user_name(idstName32)

        static 
menu[2100], len;
        
len 0

        len 
+= formatex(menu[len], charsmax(menu) - len"\r[ADMIN MENU]:")
    
        
len += formatex(menu[len], charsmax(menu) - len"^n^n\w Nick: \d%s^n"stName)
        
len += formatex(menu[len], charsmax(menu) - len"\r1. \wAdd Points^n")
        
len += formatex(menu[len], charsmax(menu) - len"\r2. \wRemove Points^n")
        
len += formatex(menu[len], charsmax(menu) - len"\r3. \wChange Level^n")
        
len += formatex(menu[len], charsmax(menu) - len"\r4. \wReset Account^n^n")

        
len += formatex(menu[len], charsmax(menu) - len"\r0. \wExit")
        
show_menu(idKEYS_MANGmenu, -1"Manager Menu"// Here is the problem?
    
}
}

public 
menu_manager(idkey)
{
    switch (
key)
    {
        case 
0add_pt(id);
        case 
1remove_pt(id);
        case 
2change_lvl(id);
        case 
3reset_acc(id);
    }


In the server console show this:
Code:

8/12/2012 - 15:24:19: [AMXX] Displaying debug trace (plugin "**.amxx")
08/12/2012 - 15:24:19: [AMXX] Run time error 10: native error (native "show_menu")
08/12/2012 - 15:24:19: [AMXX] [0] **.sma::menuEdit (line 839)

And the menu doesn't appears to me!

fysiks 08-12-2012 18:11

Re: What is wrong?
 
Quote:

Originally Posted by YamiKaitou (Post 1769992)
Full code and [full] error please


Ef_Deas 08-12-2012 19:35

Re: What is wrong?
 
PHP Code:

formatex(menu[len],...) 

=>
PHP Code:

formatex(menu,...) 


fysiks 08-12-2012 19:36

Re: What is wrong?
 
Quote:

Originally Posted by Ef_Deas (Post 1770178)
PHP Code:

formatex(menu[len],...) 

=>
PHP Code:

formatex(menu,...) 


No.

Ef_Deas 08-12-2012 19:39

Re: What is wrong?
 
Well, I'm not sure that's the reason of the error, but isn't it wrong?

fysiks 08-12-2012 19:41

Re: What is wrong?
 
Quote:

Originally Posted by Ef_Deas (Post 1770186)
Well, I'm not sure that's the reason of the error, but isn't it wrong?

No.

Ef_Deas 08-12-2012 19:55

Re: What is wrong?
 
Sorry for that, I don't know why I thought it was wrong )
menu[len] is like a pointer of a string, so it's ok...

pacheco 08-14-2012 20:20

Re: What is wrong?
 
@Ef_Deas:
Thanks for tried to help me.

@fysiks:
Sorry, but it's a private plugin.. =/

So, if someone can tell me if have one thing wrong in this code..
I just have one error,
Quote:

[AMXX] Run time error 10: native error (native "show_menu")


All times are GMT -4. The time now is 05:45.

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