#include <amxmodx>
#include <fakemeta_util>
new const AURA_MODEL[] = "models/aura/aura_fixed.mdl";
enum
{
WHITE_AURA = 0,
GREEN_AURA,
PURPLE_AURA,
RED_AURA,
YELLOW_AURA
};
new AllocString_InfoTarget;
public plugin_init()
{
register_clcmd("say /createaura", "CreateAura");
register_clcmd("say /removeaura", "RemoveAura");
AllocString_InfoTarget = engfunc(EngFunc_AllocString, "info_target");
}
public plugin_precache()
{
engfunc(EngFunc_PrecacheModel, AURA_MODEL);
}
public CreateAura(iPlayer)
{
new iEntity = engfunc(EngFunc_CreateNamedEntity, AllocString_InfoTarget);
if(!iEntity) return FM_NULLENT;
set_pev(iEntity, pev_classname, "ent_aura");
set_pev(iEntity, pev_movetype, MOVETYPE_FOLLOW);
set_pev(iEntity, pev_owner, iPlayer);
set_pev(iEntity, pev_aiment, iPlayer);
set_pev(iEntity, pev_skin, RED_AURA);
engfunc(EngFunc_SetModel, iEntity, AURA_MODEL);
set_entity_anim(iEntity, 0);
return iEntity;
}
public RemoveAura(iPlayer)
{
static iEntity; iEntity = fm_find_ent_by_owner(FM_NULLENT, "ent_aura", iPlayer);
if(pev_valid(iEntity)) set_pev(iEntity, pev_flags, FL_KILLME);
}
stock set_entity_anim(iEntity, iSequence)
{
set_pev(iEntity, pev_frame, 1.0);
set_pev(iEntity, pev_framerate, 1.0);
set_pev(iEntity, pev_animtime, get_gametime());
set_pev(iEntity, pev_sequence, iSequence);
}