as Fox said use c-Move ( unless your an a5 user)
im not going to write the code ( because ive done elsewhere thats avaible)
but ill cover the basics of bullet holes
people tend to perfer 1 of 2 general methods of handing 'shooting'
1. ) a trace to 'simulate' a shot
2. ) moving a model entity as a bullet
for the first method its very simple. do a c-trace from the gun barrel x/y/z out some arbitrary distance in the direction vector of the gun. trace, if it hits a wall or object sets, the pre-defined TARGET vector setting the x/y/z location where it intersected something and sets the NORMAL vector to the direction vector of that surface.
then create your bullethole entity at TARGET ( make the entity passable)and align its angles to the NORMAL
for number 2 its a little more work
first off for a bullet model don;t use 'glide' in its move mode. you don't want the bullets slidding along your walls and making it even harder to place bullet holes that way
of course you also need event handling for your model so when it does impact something it triggersn an even fucntion so you can handle that.
now when the model moves ( any model uder movment of ent_move c_move) it will try to move the entire length of its direction vector for each frame. with ent_move soemtimes when the event is triggered and when your event function actualy registers the collision can be the differnace of 1 entire frame ( thus is why in older versions of the engine (prior to 6.22 i think) you needed a wait(1) usualy as your first line of an event function to be sure the collsion flag (event_type) is properly set.
so.. you have your bullet its moving hits a block, triggers your event function. first think you would think is to ent_create my bullet hole sprite at my bullets x/y/z. yes and no.
remember your MODEL hit the surface, but your models x/y/z is not the actual collision point ( the point that bullet hits wall). so your sprite is out away from the wall.
ok so i change my model so the models origin point as at the tip of the bullet to hit the wall. hmm that still doesn't work, in fact its further out from the wall. moving mdoels use an eliptical hull ( or a rectangular hull with ent_move) centered on its origin out to roughly its furthest vertex ( poly pression should only be used on NON moving entitys). So your better off with your model as before. origin centered in the mesh.
here is what you do.
event function called.
trace from bullet x/y/z to an arbitrary distance in the direction of your bullets movment direction vector. trace then will return the TARGET and NORMAL you need to set the bullethole sprite.
if you are using the BOUNCE to bounce your bullets off walls, then you have to add the additional calculation of which way is my bullet facing in comparison to the wall ( bullet direction vs wall normal) then trace back to the wall as above)
with the NORMAL that is a direction vector, you need to convert it to pan/tilt angles and then orintate the sprite. rememebr to ent creat the sprite and make it passable right away. 1 its hard to set it right when its collsion is on, also if anotehr bullet hits a bullethole sprite the bullet just stops on the sprite which is covering the wall surface
as for code plenty of examples of doing this can be found check out resource site and the tutorials