this works... use this somehow i dont get ur whole script so i wont go in it and change stuff
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new arg1[32]
public plugin_init() {
register_plugin("Menutest", "1.0.0", "[ --<-@ ]")
register_menucmd(register_menuid("menu11"),1023,"menu_handler")
register_concmd("amx_menutest", "menu22", ADMIN_MENU, "amx_menutest <player> to show menu to player")
}
public menu22(id)
{
read_argv( 1, arg1, 31 )
if ( equal( arg1, "" ) ) {
client_print( id, print_console, "[ --<-@ ] Wich player to show the menu?" )
client_print( id, print_console, "[ --<-@ ] Usage: amx_menutest <player>" )
return PLUGIN_HANDLED
}
new menubody[128], keys
format(menubody, 127, "Menu_Name^n^n1. 200 Health^n2. Half Gravity^n8. Exit")
keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_8
new player = cmd_target( id, arg1, 0 )
show_menu( player, keys, menubody, 6, "menu11" )
return PLUGIN_HANDLED
}
public menu_handler(id, key) {
if( key == 0 )
{
set_user_health( id, 200 )
}
if( key == 1 )
{
set_user_gravity( id, 0.5 )
}
if( key == 7 )
{
return PLUGIN_HANDLED
}
new username[32]
get_user_name( id, username,31 )
client_print( 0, print_chat, "%s choosed #%i", username, key+1 ) // To se if it calls anything
return PLUGIN_HANDLED
}