It works better, but not quite.
I have 2 variations:
A: placing the light infront of the weapon:
if(lightEnt)
{
clip_factor = 0;
set(flashlight,CLIPPED);
VECTOR _p;
vec_for_bone (_p, lightEnt, 176);
vec_set (flashlight.x, _p.x);
flashlight.pan = camera.pan;
flashlight.tilt = camera.tilt;
sc_light_update(flashlight);
}
B: do not edit the position of the lightsource
clip_factor = 0;
set(flashlight,CLIPPED);
vec_set(flashlight.x, camera.x);
flashlight.z = camera.z;
flashlight.pan = camera.pan;
flashlight.tilt = camera.tilt;
sc_light_update(flashlight);
Both versions work equally "good" (less bad). Meaning that they rarely flicker. But sometimes no spotlight can be seen for a few seconds.
I doesn't seem to make a difference whether the light source is in front of the weapon of somewhat behind it.