View Single Post
bat
Veteran Member
Join Date: Jul 2012
Old 09-01-2014 , 05:10   Re: night vision for human
Reply With Quote #5

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
}
__________________
bat is offline
Send a message via Skype™ to bat