got error in menu choise with;
hl_set_user_spectator(id,false)
look video, after respwan, no health show, nothink show, can't change weapon.
https://youtu.be/laiL2l--zPccode
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <hl>
#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""
#define Menu_Keys (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menu("my_menu",Menu_Keys,"Pressed",0)
register_clcmd("say /menu","ShowMenu")
RegisterHam ( Ham_Killed, "player", "fwd_Ham_Killed_post" )
}
//public client_putinserver(id)
//{
// hl_set_user_spectator(id)
// ShowMenu2(id)
//
//}
public ShowMenu(id)
{
new menu[192]
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0
format(menu,191,"\ystuff menu:^n^n\w1. spectate^n2. play^n3. rank^n4. top15^n0. Exit")
show_menu(id, keys, menu, -1, "my_menu")
return PLUGIN_HANDLED
}
public Pressed(id, key)
{
switch (key)
{
case 0:
{
hl_set_user_spectator(id, true)
ShowMenu(id)
}
case 1:
{
if (hl_get_user_spectator(id))
{
hl_set_user_spectator(id,false)
}
}
case 2:
{
client_cmd(id,"say /rank")
ShowMenu(id)
}
case 3:
{
client_cmd(id,"say /top15")
ShowMenu(id)
}
case 4:
{
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}
public fwd_Ham_Killed_post( id )
{
ShowMenu(id)
}