/******************************************************************************************

	Xtrafun_to_Vexd.inc v0.1

	Author: KRoTaL

	Use this library to convert plugins from Xtrafun to AMX 0.9.9 Vexd Utilities Module.
	Put this Xtrafun_to_Vexd.inc file in the include folder (amx/examples/include).
	Replace #include <xtrafun> with #include <Xtrafun_to_Vexd> in the .sma file.
	Then compile the plugin.

	You have to replace yourself find_entity(ent, category, value[])
	with find_entity(ent, value[]), if this function is used in the source code
	example: find_entity(ent, classname, "Bullet")
	         => find_entity(ent, "Bullet")

******************************************************************************************/



#if defined _Xtrafun_to_Vexd_included
	#endinput
#endif
#define _Xtrafun_to_Vexd_included


#include <Vexd_Utilities>
#include <VexdUM_stock>

stock get_entity_velocity(id, velocity[3])
{
  	new Float:vel[3]
	entity_get_vector(id, EV_VEC_velocity, vel)
	FVecIVec(vel, velocity)
}

stock set_entity_velocity(id, velocity[3])
{
	new Float:vel[3]
	IVecFVec(velocity, vel)
	entity_set_vector(id, EV_VEC_velocity, vel)
}

stock get_entity_origin(id, origin[3])
{
	new Float:orig[3]
	entity_get_vector(id, EV_VEC_origin, orig)
	FVecIVec(orig, origin)
}

stock set_entity_origin(id, origin[3])
{
	new Float:orig[3]
	IVecFVec(origin, orig)
	entity_set_vector(id, EV_VEC_origin, orig)
}

stock get_user_velocity(id, velocity[3])
{
	new Float:vel[3]
	entity_get_vector(id, EV_VEC_velocity, vel)
	FVecIVec(vel, velocity)
}

stock set_user_velocity(id, velocity[3])
{
	new Float:vel[3]
	IVecFVec(velocity, vel)
	entity_set_vector(id, EV_VEC_velocity, vel)
}

stock get_grenade_id(id, model[], len, grenadeid)
{
	grenadeid = get_grenade(id)
	entity_get_string(grenadeid, EV_SZ_model, model, len)
	return grenadeid
}

stock current_num_ents()
{
	return get_num_ents()
}

stock set_user_footsteps(id, set)
{
	// Nothing to code here because you have to add
	// entity_set_int(id, EV_INT_flTimeStepSound, 999)
	// inside the client_prethink(id) function
	return (id-id+set-set) // added this to avoid warnings about id and set being never used
}