Sorry, I knew I had to give an explanation ... This is the code I'm currently doing ...
I'm making something like a fire aura around the character using an entity type "env_sprite" with a sound created by a friend:
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new Fire[] = "sprites/fire.spr"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_CmdStart, "CmdStart")
}
public plugin_precache()
{
precache_model(Fire)
}
public CmdStart(Client)
{
if(is_user_alive(Client))
{
new Entity = create_entity("env_sprite")
new Float:Origin[3] = {0.0, 5.0, 0.0)
entity_get_vector(Client, EV_VEC_origin, Origin)
entity_set_origin(Entity, Origin)
entity_set_model(Entity, Fire)
entity_set_int(Entity, EV_INT_rendermode, kRenderTransAdd)
entity_set_float(Entity, EV_FL_renderamt, 255.0)
entity_set_float(Entity, EV_FL_frame, 12.0)
entity_set_int(Entity, EV_INT_spawnflags, SF_SPRITE_STARTON)
entity_set_int(Entity, EV_INT_solid, SOLID_BBOX)
entity_set_int(Entity, EV_INT_movetype, MOVETYPE_FLY)
entity_set_edict(Entity, EV_ENT_owner, Client)
dllfunc(DLLFunc_Spawn, Ent)
if(!is_user_alive(Client))
{
remove_entity(Entity)
}
}
}
Probably something this misconceived as a rookie but I'm something like this kind of plugins, however, compiles fine, and the entity is created, but when testing the plugin, many entities are created, and at one point gets slow play, and upload mistake ...
PD: I've already try deleting the condition "is_user_alive" ...