Whenever I try to use a bullet hole decal and create it on an object, I receive an error.

Here is my code: (It is similar to an example in the lite-c manual)

// calculate the target vector
VECTOR trace_target;
vec_set(trace_target,vector(5000,0,0)); // the weapon has a firing range of 5000 quants
vec_rotate(trace_target, camera.pan);
vec_add(trace_target, camera.x);

// display a red spot at the target position
if (c_trace(camera.x,trace_target, IGNORE_PASSABLE | USE_POLYGON| SCAN_TEXTURE) > 0) // hit something?
draw_point3d(hit.x,vector(50,50,255),100,3);

// fire and then place a decal at the hit position
if (key_ctrl) // fire
{
PARTICLE* p = ent_decal(you,bmMark,you.x, you.y); // place a random sized decal at the hit entity
p.lifespan = 80;
wait(-0.5); // reload
}

What is wrong with the code?

Also, does anyone know how to make a bullet hole decal on the object more easily?

Last edited by fangedscorpion; 08/23/09 17:48.

"Pow! You are dead! Not big suprise!" -Heavy