Raised This Month: $178 Target: $400
 44% 

map Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-13-2018 , 10:16   map Menu
Reply With Quote #1

me tried to make a small map menu to change map (only for learn) but i am getting issue with menu her eis the code..........me already saw the defult mapmenu plugin but cnt understand

PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <amxmisc>
// #include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

new filename164 ];

new Array: 
Maps;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
get_configsdir(filename164);
    
format(filename164"%s/special_map.ini"filename);
}

public 
plugin_cfg()
{
    
Maps ArrayCreate(641);
    
    if( 
file_existsfilename ) )
    {
        new 
open fopenfilename"rt");
        
        new 
buffer164 ];
        
        while( !
feofopen ) )
        {
            
fgetsopenbuffercharsmax(buffer));
            
            if( !
buffer] || buffer] == ';' || buffer] == '/' && buffer] == '/' )
            {
                continue;
            }
            
            
trim(buffer);

            
ArrayPushArray(Mapsbuffer);
            
        }
    }
}

public 
ShowMenu(id)
{
    new 
dataMAX_PLAYERS ];
    new 
menu menu_create("MapMenu""chnage_map");
    
    new 
g_maps ArraySize(Maps);
    
    
ArrayGetString(Mapsg_mapsdatacharsmax(data))
    
    
trim(data);
    
    
menu_additem(menudata); //Add the options to the menu
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}

public 
chnage_map(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
buffer[6], access

    menu_item_getinfo
(menuitemaccessbuffercharsmaxbuffer ));


    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;

error
PHP Code:
Compiling Map_Knife... Current time is10:13:50.54 Wed

AMX Mod X Compiler 1.8.3
-dev+5154
Copyright 
(c1997-2006 ITB CompuPhase
Copyright 
(c2004-2013 AMX Mod X Team

D
:\MY AMXX PLUGINS\Map_Knife.sma(86) : error 088number of arguments does not match definition

1 Error
.
Could not locate output file D:\New folder\HLDS\Half-Life\cstrike\addons\amxmodx\plugins\Map_Knife.amx (compile failed).
There was an compilation errorExiting... 

Took 0:00:00,13 seconds to run this script.

[
Finished in 0.2s
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-13-2018 , 12:22   Re: map Menu
Reply With Quote #2

You are missing some arguments.

https://www.amxmodx.org/api/newmenus/menu_item_getinfo
maqi is online now
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-13-2018 , 12:24   Re: map Menu
Reply With Quote #3

ya but i dont know how to display in menu :/
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-13-2018 , 12:33   Re: map Menu
Reply With Quote #4

menu_display displays the menu but first fix the compiler error
maqi is online now
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-13-2018 , 22:02   Re: map Menu
Reply With Quote #5

i cant under stand how to add bro if u can plz fix menu
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Question x Mark
Junior Member
Join Date: May 2018
Old 06-14-2018 , 03:40   Re: map Menu
Reply With Quote #6

1-
PHP Code:
new g_maps ArraySize(Maps); 
->
PHP Code:
new g_maps 
2-Use loop to get that strings.

3-Remove
Code:
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

4-
Code:
menu_display(id, menu, 0);
->
Code:
menu_display(id, menu)

5-menu_item_getinfo will surely give error if you didn't give CALLBACK.

(FOR MORE INFO, CHECK NEW MENUS)

Last edited by Question x Mark; 06-14-2018 at 03:44.
Question x Mark is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-14-2018 , 11:19   Re: map Menu
Reply With Quote #7

Here me changes something removed array and try to add this type....

PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <amxmisc>
// #include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

#define MAX_MAP 32

new filename164 ];
new 
map_count;
new 
map_menu;
new 
map_namesMAX_MAP ][ MAX_PLAYERS ]


public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
get_configsdir(filename164);
    
format(filename164"%s/special_map.ini"filename);
}

public 
plugin_cfg()
{
    
    if( 
file_existsfilename ) )
    {
        new 
open fopenfilename"rt");
        
        new 
buffer164 ], num10 ];
        
        while( !
feofopen ) && ( map_count MAX_MAP ) )
        {
            
fgetsopenbuffercharsmax(buffer));
            
trim(buffer);
            
            if( !
buffer] || buffer] == ';' || buffer] == '/' && buffer] == '/' && is_map_valid(buffer) )
            {
                continue;
            }

            
copymap_namesmap_count ], charsmaxmap_names[] ), buffer);

            
num_to_strmap_countnumcharsmax(num));
            
menu_additemmap_menumap_namesmap_count ], num);

            
map_count++;
            
        }

        
fcloseopen );

    }

    return 
0;


Last edited by soumyadip77; 06-14-2018 at 11:20. Reason: wrong file :)
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-15-2018 , 09:39   Re: map Menu
Reply With Quote #8

bump
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2018 , 23:21   Re: map Menu
Reply With Quote #9

Look at the replies here and then post back in this thread so that we can continue the discussion in this thread.
__________________
fysiks is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-15-2018 , 23:51   Re: map Menu
Reply With Quote #10

--- solved ---
ty crazy <3
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Reply


Thread Tools
Display Modes

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 04:25.


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