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 filename[ 164 ];
new Array: Maps;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
get_configsdir(filename, 164);
format(filename, 164, "%s/special_map.ini", filename);
}
public plugin_cfg()
{
Maps = ArrayCreate(64, 1);
if( file_exists( filename ) )
{
new open = fopen( filename, "rt");
new buffer[ 164 ];
while( !feof( open ) )
{
fgets( open, buffer, charsmax(buffer));
if( !buffer[ 0 ] || buffer[ 0 ] == ';' || buffer[ 0 ] == '/' && buffer[ 1 ] == '/' )
{
continue;
}
trim(buffer);
ArrayPushArray(Maps, buffer);
}
}
}
public ShowMenu(id)
{
new data[ MAX_PLAYERS + 1 ];
new menu = menu_create("MapMenu", "chnage_map");
new g_maps = ArraySize(Maps);
ArrayGetString(Maps, g_maps, data, charsmax(data))
trim(data);
menu_additem(menu, data); //Add the options to the menu
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public chnage_map(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new buffer[6], access
menu_item_getinfo(menu, item, access, buffer, charsmax( buffer ));
menu_destroy(menu);
return PLUGIN_HANDLED;
}
error
PHP Code:
Compiling Map_Knife... Current time is: 10:13:50.54 - Wed
AMX Mod X Compiler 1.8.3-dev+5154
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team
D:\MY AMXX PLUGINS\Map_Knife.sma(86) : error 088: number 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 error. Exiting...
Took 0:00:00,13 seconds to run this script.
[Finished in 0.2s]