Hello, I think you have to transform the global world velocity vector into the local coordinate system of your entity. My problem was a laser beam shot from my entity to target in a global view.
My solution:
function effect_laser_beam(PARTICLE* p)
{
// set beam in player`s direction
p.vel_x = vec_length(p.x)*cos(player.pan);
p.vel_y = vec_length(p.x)*sin(player.pan);
p.vel_z = 0;
// set lenght of beam
vec_normalize (p.vel_x, random(100));
......