#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Big Nemesis"
#define VERSION "1.0"
#define AUTHOR "Zombie-rus"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_forward(FM_CmdStart, "fw_CmdStart")
	
	RegisterHam(Ham_Player_Duck, "player", "Player_inDuck", 1)
}

public fw_CmdStart(id, uc_handle, seed)
{
	if(!is_user_alive(id)) return FMRES_IGNORED
	
	if(zp_get_user_nemesis(id))
	{
		set_pev(id, pev_view_ofs, {0.0, 0.0, 70.0})
    	}
	return FMRES_IGNORED
}

public Player_inDuck(id)
{
	if(zp_get_user_nemesis(id))
	{
   		static button, ducking
   		button = pev(id, pev_button)
		ducking = pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)

   		if(button & IN_DUCK || ducking)
		{
			set_pev(id, pev_view_ofs, {0.0, 0.0, 35.0}) 
   		}
	}
}