Look,Im not to good at all in this,but I made what I can,when I use say /maps on chat my server crash without errors.So I need some help on this,(I Made this code based on bot apology for tk by fysiks)
Code...
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "#8 SickneSS"
#define MAXMAPS 20
new Maps[MAXMAPS][32]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /maps","MapsMenu",ADMIN_MAP)
}
public MapsMenu(id,level,cid)
{
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new Menu = menu_create("\r[Mix Maker]\y Maps Menu :","MapsMenu_Handler")
new Mapname[32]
new Item[MAXMAPS]
new MapFile[64]
get_configsdir(MapFile,63)
add(MapFile,63,"/mapsmenu.ini")
new Num
if(!file_exists(MapFile))
client_cmd(id,"amx_mapmenu")
else
{
new f = fopen(MapFile,"rt")
for(new i = 0;i < MAXMAPS;i++)
{
while(!feof(f))
{
fgets(f,Mapname,31)
if(!Mapname[0] || Mapname[0] == ';'
|| Mapname[0] == '/' && Mapname[1] == '/') continue;
trim(Mapname)
strtolower(Mapname)
Num++
num_to_str(Num,Item,MAXMAPS)
copy(Maps[i][MAXMAPS],31,Item)
menu_additem(Menu,Mapname,Item)
}
fclose(f)
}
}
menu_display(id,Menu)
return PLUGIN_HANDLED
}
public MapsMenu_Handler(id,Menu,item)
{
if(item == MENU_EXIT)
{
menu_destroy(Menu)
return PLUGIN_HANDLED
}
new iData[6]
new iName[64]
new Access
new Callback
menu_item_getinfo(Menu,item,Access,iData,5,iName,63,Callback)
new Map = str_to_num(iData)
if(Map)
client_cmd(id,"amx_on;amx_map %s",iName)
return PLUGIN_HANDLED
}