The
get_user_origin() function does not return a floated value. And
entity_set_origin() sets an origin(floated one).
So you'd have to do it like this(using
IVecFVec()):
Code:
new iOrigin[ 3 ], Float:fOrigin[ 3 ];
get_user_origin( id, iOrigin, 3 ); // 3 is ending position from eyes(crosshair)
IVecFVec( iOrigin, fOrigin ); // integer origin converted to float
entity_set_origin( ent, fOrigin ); // entity at that origin
or you could just use
float().
Code:
new iOrigin[ 3 ], Float:fOrigin[ 3 ];
get_user_origin( id, iOrigin, 3 ); // 3 is ending position from eyes(crosshair)
fOrigin[ 0 ] = float( iOrigin[ 0 ] );
fOrigin[ 1 ] = float( iOrigin[ 1 ] );
fOrigin[ 2 ] = float( iOrigin[ 2 ] );
// im not sure but i think you could do this also
// fOrigin = float( iOrigin );
entity_set_origin( ent, fOrigin ); // entity at that origin
__________________