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

  Xtrafun_to_Vexd.inc v1.0

  Author: KRoTaL

  Use this library to convert plugins from Xtrafun to AMX 0.9.9/2006 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 <fun>
#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, grenadeid)
  entity_get_string(grenadeid, EV_SZ_model, model, len)
  return grenadeid
}

stock current_num_ents() {
  return get_num_ents()
}
