//Agent Zero

/* CVARS - copy and paste to shconfig.cfg

//Agent Zero
agentz_level 5

*/

#include <amxmodx>
#include <engine>
#include <superheromod>

new gHeroName[]="Agent Zero"
new bool:gHasAgent[SH_MAXSLOTS+1]
new Float:gPunchAngle[3] = {0.0,0.0,0.0}

public plugin_init()
{
	// Plugin Info
	register_plugin("SUPERHERO Agent Zero", "1.0", "Freecode")

	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("agentz_level", "5")

	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	shCreateHero(gHeroName, "No Recoil", "Get No Recoil when shooting.", false, "agentz_level")

	// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
	// INIT
	register_srvcmd("agentz_init", "agentz_init")
	shRegHeroInit(gHeroName, "agentz_init")

}

public agentz_init()
{
	// First Argument is an id
	new temp[6]
	read_argv(1,temp,5)
	new id = str_to_num(temp)

	// 2nd Argument is 0 or 1 depending on whether the id has the hero
	read_argv(2,temp,5)
	new hasPowers = str_to_num(temp)

	gHasAgent[id] = (hasPowers != 0)
}


public client_PreThink(id)
{
	if(gHasAgent[id] && is_user_alive(id))
	{
		entity_set_vector(id,EV_VEC_punchangle,gPunchAngle);
	}
}