AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error but what?? (https://forums.alliedmods.net/showthread.php?t=89514)

One 04-07-2009 12:13

Error but what??
 
lol ??

PHP Code:

public menu_handler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
    }
    new 
data[6]//, iName[64]
    //new access, callback
    //menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
    
new key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            
Level=1
            menu_destroy
(menu)
        }
        case 
2:
        {
            
Level=2
            menu_destroy
(menu)
        }
        case 
3:
        {
            
Level=3
            menu_destroy
(menu)
        }
        case 
4:
        {
            new 
temp[2048]
            
add(temp,2047,"<html><head><style>^n")
            
add(temp,2047,"body { background-color:#000000; color:#FFFFFF; font-family:Verdana; font-size:7pt; }^n")
            
add(temp,2047,"</style></head><body>^n")
            
add(temp,2047,"<b>This is a AMXX-Plugin,& was writed by p4ddy, Edited/Translated/Endbugsed by One. There are 2 Teams & the Catcher-team have to catch the Fleer-Team. When anyone would be catched he is dead & have to wait for new round. The Cather become 1 Point for this & by sorvive the Team become 5 Points.</b>^n")
            
add(temp,2047,"<b>How can i use my Turbo?</b><br>Prees the +attack2 key. (Standard rightmouse key)<br><br>^n")
            
add(temp,2047,"<b>How can i boost my M8?</b><br>Your M8 has to getting on you & you have just to shoot.<br><br>^n")
            
add(temp,2047,"<b>How can i see my Stats?</b><br>Say in chat <b>!stats</b>.<br><br>^n")
            
add(temp,2047,"<b>Why am i slower?</b><br>1. delete this 3 CVars in you´r config.cfg (cl_forwardspeed, cl_sidespeed, cl_backspeed).<br>2. set this Cvats on 9999.<br><br>^n")
            
add(temp,2047,"<b>Why i cant runing more on Edgs?</b><br>Just try with a Duckjump :-D.<br><br>^n")
            
add(temp,2047,"<b>I touched a player, but he is not dead?</b><br>This is just a Ping-bug. Dont worry about this.<br><br>^n")
            
add(temp,2047,"<b>How can i contact the Scripter?</b><br>E-Mail: <b>[email protected]</b> or <b>www.cs-rocekrs.de</b> or <b>www.cs-rockers.de/forum/ </b>.^n")
            
add(temp,2047,"</body></html>")
        
            
show_motd(id,temp,"Creazy Mazy Helpmenu")
        }
    }
    
menu_destroy(menu)


console :

PHP Code:



L 04
/07/2009 18:09:44Invalid menu id 17(18)
L 04/07/2009 18:09:44: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 04/07/2009 18:09:44: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:09:44: [AMXX]    [0Untitled.sma::menu_handler (line 142

line 142 : menu_destroy(menu)

WTF????:shock:

xbatista 04-07-2009 12:17

Re: Error but what??
 
Maybe this? :/
PHP Code:

public menu_handler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED;
    }
    new 
data[6]//, iName[64]
    //new access, callback
    //menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
    
new key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            
Level=1
            menu_destroy
(menu)
        }
        case 
2:
        {
            
Level=2
            menu_destroy
(menu)
        }
        case 
3:
        {
            
Level=3
            menu_destroy
(menu)
        }
        case 
4:
        {
            new 
temp[2048]
            
add(temp,2047,"<html><head><style>^n")
            
add(temp,2047,"body { background-color:#000000; color:#FFFFFF; font-family:Verdana; font-size:7pt; }^n")
            
add(temp,2047,"</style></head><body>^n")
            
add(temp,2047,"<b>This is a AMXX-Plugin,& was writed by p4ddy, Edited/Translated/Endbugsed by One. There are 2 Teams & the Catcher-team have to catch the Fleer-Team. When anyone would be catched he is dead & have to wait for new round. The Cather become 1 Point for this & by sorvive the Team become 5 Points.</b>^n")
            
add(temp,2047,"<b>How can i use my Turbo?</b><br>Prees the +attack2 key. (Standard rightmouse key)<br><br>^n")
            
add(temp,2047,"<b>How can i boost my M8?</b><br>Your M8 has to getting on you & you have just to shoot.<br><br>^n")
            
add(temp,2047,"<b>How can i see my Stats?</b><br>Say in chat <b>!stats</b>.<br><br>^n")
            
add(temp,2047,"<b>Why am i slower?</b><br>1. delete this 3 CVars in you´r config.cfg (cl_forwardspeed, cl_sidespeed, cl_backspeed).<br>2. set this Cvats on 9999.<br><br>^n")
            
add(temp,2047,"<b>Why i cant runing more on Edgs?</b><br>Just try with a Duckjump :-D.<br><br>^n")
            
add(temp,2047,"<b>I touched a player, but he is not dead?</b><br>This is just a Ping-bug. Dont worry about this.<br><br>^n")
            
add(temp,2047,"<b>How can i contact the Scripter?</b><br>E-Mail: <b>[email protected]</b> or <b>www.cs-rocekrs.de</b> or <b>www.cs-rockers.de/forum/ </b>.^n")
            
add(temp,2047,"</body></html>")
        
            
show_motd(id,temp,"Creazy Mazy Helpmenu")
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED;



Arkshine 04-07-2009 12:18

Re: Error but what??
 
You forget to return after the first check ( menu_destroy ). The result is you try to destroy a menu which is already destroyed.

One 04-07-2009 12:20

Re: Error but what??
 
the same...

PHP Code:

L 04/07/2009 18:19:48Invalid menu id 7(9)
L 04/07/2009 18:19:48: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 04/07/2009 18:19:48: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:19:48: [AMXX]    [0Untitled.sma::menu_handler (line 142 ..... 

EDIT :

EDIT :

error by new code :

PHP Code:

L 04/07/2009 18:21:46: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:21:46: [AMXX]    [0Untitled.sma::menu_handler (line 145)
L 04/07/2009 18:21:46Invalid menu id 2(9)
L 04/07/2009 18:21:46: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 04/07/2009 18:21:46: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:21:46: [AMXX]    [0Untitled.sma::menu_handler (line 145)
L 04/07/2009 18:21:46Invalid menu id 4(9)
L 04/07/2009 18:21:46: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 04/07/2009 18:21:46: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:21:46: [AMXX]    [0Untitled.sma::menu_handler (line 145)
L 04/07/2009 18:21:46Invalid menu id 5(9)
L 04/07/2009 18:21:46: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 04/07/2009 18:21:46: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:21:46: [AMXX]    [0Untitled.sma::menu_handler (line 145)
L 04/07/2009 18:21:46Invalid menu id 6(9)
L 04/07/2009 18:21:46: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 04/07/2009 18:21:46: [AMXXRun time error 10native error (native "menu_destroy")
L 04/07/2009 18:21:46: [AMXX]    [0Untitled.sma::menu_handler (line 145)
Compressing saving Experience Data...this may take a while!
Expe 

new code :

PHP Code:

public menu_handler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
    }
    new 
data[6]//, iName[64]
    //new access, callback
    //menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
    
new key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            
Level=1
            menu_destroy
(menu)
            return 
PLUGIN_HANDLED;
        }
        case 
2:
        {
            
Level=2
            menu_destroy
(menu)
            return 
PLUGIN_HANDLED;
        }
        case 
3:
        {
            
Level=3
            menu_destroy
(menu)
            return 
PLUGIN_HANDLED;
        }
        case 
4:
        {
            new 
temp[2048]
            
add(temp,2047,"<html><head><style>^n")
            
add(temp,2047,"body { background-color:#000000; color:#FFFFFF; font-family:Verdana; font-size:7pt; }^n")
            
add(temp,2047,"</style></head><body>^n")
            
add(temp,2047,"<b>This is a AMXX-Plugin,& was writed by p4ddy, Edited/Translated/Endbugsed by One. There are 2 Teams & the Catcher-team have to catch the Fleer-Team. When anyone would be catched he is dead & have to wait for new round. The Cather become 1 Point for this & by sorvive the Team become 5 Points.</b>^n")
            
add(temp,2047,"<b>How can i use my Turbo?</b><br>Prees the +attack2 key. (Standard rightmouse key)<br><br>^n")
            
add(temp,2047,"<b>How can i boost my M8?</b><br>Your M8 has to getting on you & you have just to shoot.<br><br>^n")
            
add(temp,2047,"<b>How can i see my Stats?</b><br>Say in chat <b>!stats</b>.<br><br>^n")
            
add(temp,2047,"<b>Why am i slower?</b><br>1. delete this 3 CVars in you´r config.cfg (cl_forwardspeed, cl_sidespeed, cl_backspeed).<br>2. set this Cvats on 9999.<br><br>^n")
            
add(temp,2047,"<b>Why i cant runing more on Edgs?</b><br>Just try with a Duckjump :-D.<br><br>^n")
            
add(temp,2047,"<b>I touched a player, but he is not dead?</b><br>This is just a Ping-bug. Dont worry about this.<br><br>^n")
            
add(temp,2047,"<b>How can i contact the Scripter?</b><br>E-Mail: <b>[email protected]</b> or <b>www.cs-rocekrs.de</b> or <b>www.cs-rockers.de/forum/ </b>.^n")
            
add(temp,2047,"</body></html>")
        
            
show_motd(id,temp,"Creazy Mazy Helpmenu")
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED;



Arkshine 04-07-2009 12:22

Re: Error but what??
 
You don't understand you have to return after destroying the menu. Open your eyes and try to understand, you return nothing after destroying the menu and after that, you call again the native below.

One 04-07-2009 12:24

Re: Error but what??
 
yea arkshin. u posted on the same time that i posted. or i had the site open & was trying :d

xbatista 04-07-2009 12:25

Re: Error but what??
 
PHP Code:

    if (item == MENU_EXIT)
    {
        
menu_destroy(menu)
        !!!!!!!!!!!!!!!!!!!!
HANDLED!!!!!!!!!!!!!!!!!!!
    } 


One 04-07-2009 12:29

Re: Error but what??
 
http://www.helpbytes.co.uk/images/smileys/17.gifhttp://www.helpbytes.co.uk/images/smileys/17.gifhttp://www.helpbytes.co.uk/images/smileys/17.gifhttp://www.helpbytes.co.uk/images/smileys/17.gifhttp://www.helpbytes.co.uk/images/smileys/17.gif the same http://www.helpbytes.co.uk/images/smileys/17.gifhttp://www.helpbytes.co.uk/images/smileys/17.gif

idk maybe i´m doing anything wrong http://www.helpbytes.co.uk/images/smileys/17.gif

xbatista 04-07-2009 12:30

Re: Error but what??
 
Try uncomment
PHP Code:

//, iName[64]
    //new access, callback
    //menu_item_getinfo(menu, item, access, data,5, iName, 63, callback) 


Arkshine 04-07-2009 12:33

Re: Error but what??
 
Show your code modified.


All times are GMT -4. The time now is 02:18.

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