/*				   *--mKSeRv--*
				  /|         /|
				 / |        / | 
				*----------*  |	
				|  |       |  |
				|  *-------|--*
				| /        | /	
				|/         |/
				*---Team---*

   This plugin was made by http://mkserv.lv !
*/
#include <amxmodx>
#include <engine>
#tryinclude <biohazard>

#if !defined _biohazard_included
        #assert Biohazard functions file required!
#endif

#define PLUGIN "mKSeRv Zombie Nades"
#define VERSION "0.1"
#define AUTHOR "KIL"

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("CurWeapon","resetWeapon","be", "1=1")
}

public plugin_precache()
{
    precache_model("models/zmnades/v_grenade_fire.mdl")
    precache_model("models/zmnades/v_grenade_flare.mdl")
    precache_model("models/zmnades/v_grenade_frost.mdl")
}

public resetWeapon(id)
{
    if(!is_user_alive(id) || !is_user_connected(id)) 
        return PLUGIN_CONTINUE
    
    new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
    if(weapon == CSW_HEGRENADE)
    {
        entity_set_string(id, EV_SZ_viewmodel, "models/zmnades/v_grenade_fire.mdl")
    }
    if(weapon == CSW_SMOKEGRENADE)
    {
        entity_set_string(id, EV_SZ_viewmodel, "models/zmnades/v_grenade_flare.mdl")
    }
    if(weapon == CSW_FLASHBANG)
    {
        entity_set_string(id, EV_SZ_viewmodel, "models/zmnades/v_grenade_frost.mdl")
    }
    return PLUGIN_CONTINUE
}

