Code from biohazard.. Not Tested.
Code:
#include amxmodx
#include hamsandwich
#include fakemeta
#include zombieplague
#define HAS_NVG (1<<0)
#define OFFSET_NVG 129
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "HAMHamrespawn", 1)
}
public HAMHamrespawn(id)
{
if(is_user_alive(id) && !zp_get_user_zombie(id))
{
fm_set_user_nvg(id /*,1*/) // Just remove /* */ for autoset nvg for human :)
}
}
stock fm_set_user_nvg(index, onoff = 1)
{
static nvg
nvg = get_pdata_int(index, OFFSET_NVG)
set_pdata_int(index, OFFSET_NVG, onoff == 1 ? nvg | HAS_NVG : nvg & ~HAS_NVG)
return 1
}
__________________