AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with Mismatch (https://forums.alliedmods.net/showthread.php?t=241036)

Fuck For Fun 05-26-2014 10:52

Help with Mismatch
 
Fixed

Torge 05-26-2014 11:00

Re: Help with Mismatch
 
It's this one here:

PHP Code:

iMenu menu_create"Help \wMenu^n\rCurrent Map: \w%s",maphandler ); 

You better use something like this:
PHP Code:

new map[32];
get_mapname(map31);
    
new 
szText[256];
formatex(szTextcharsmax(szText), "Help \wMenu^n\rCurrent Map: \w%s"map);
    
new 
hMenu menu_create(szTexthandler ); 


Fuck For Fun 05-26-2014 11:47

Re: Help with Mismatch
 
Code:

stock CmdMakeMain( const index, const handler[] )
{
    static iMenu;
    new map[32];
    get_mapname(map, 31);
   
    new szText[256];
    formatex(szText, charsmax(szText), "Help Menu^n\rCurrent Map: \w%s", map);
   
    new hMenu = menu_create(szText, handler ); 
   
    for ( new i = 0; i < g_iMain; i++ )
        menu_additem( iMenu, g_szMainItems[ i ] );
       
    menu_display( index, iMenu, 0 );
}

Warning: Symbol is assigned a value that is never used: "hMenu"

DavidJr 05-26-2014 11:50

Re: Help with Mismatch
 
remove static iMenu;

change iMenu in menu_additem to hMenu

Torge 05-26-2014 11:55

Re: Help with Mismatch
 
Quote:

Originally Posted by DavidJr (Post 2142704)
remove static iMenu;

change iMenu in menu_additem to hMenu

Or just replace my "hMenu" with yours "iMenu" in this case :)

Fuck For Fun 05-26-2014 12:00

Re: Help with Mismatch
 
Quote:

Originally Posted by DavidJr (Post 2142704)
remove static iMenu;

change iMenu in menu_additem to hMenu

Quote:

Originally Posted by Torge (Post 2142708)
Or just replace my "hMenu" with yours "iMenu" in this case :)

My mistake, I did not notice it.

Thanks anyway for the support and help


All times are GMT -4. The time now is 09:35.

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