You should have posted what you tried so we wouldn't have to guess as much.
Is this what your after? ( Entity remains behind the player at all times? )
Code:
#include <amxmodx>
#include <engine>
#include <xs>
#define DIST 100
#define THINK_TIME 0.05
new const g_szModel[] = "models/w_c4.mdl";
public plugin_init()
{
register_clcmd( "say /create", "MakeEnt" );
register_think( "MyEnt", "EntThink" );
}
public MakeEnt( id )
{
new iEnt = create_entity( "info_target" );
entity_set_string( iEnt, EV_SZ_classname, "MyEnt" );
entity_set_model( iEnt, g_szModel );
entity_set_edict( iEnt, EV_ENT_owner, id );
entity_set_float( iEnt, EV_FL_nextthink, get_gametime() + THINK_TIME );
}
public EntThink( iEnt )
{
static Float:flOrigin[ 3 ], Float:flBaseOrigin[ 3 ], id;
if( !id )
id = entity_get_edict( iEnt, EV_ENT_owner );
velocity_by_aim( id, DIST, flOrigin );
entity_get_vector( id, EV_VEC_origin, flBaseOrigin );
flOrigin[ 2 ] = flBaseOrigin[ 2 ] - 25.0;
xs_vec_sub( flBaseOrigin, flOrigin, flOrigin );
entity_set_vector( iEnt, EV_VEC_origin, flOrigin );
entity_set_float( iEnt, EV_FL_nextthink, get_gametime() + THINK_TIME );
}
To test the effect, you can change xs_vec_sub() to xs_vec_add().
__________________