Quote:
Originally Posted by MPNumB
Yes. Thanks.
However I didn't found nothing in hlsdk_const.inc about sound time. Also I'm wondering where can I find those bullet models?
// edit:
So left: question in this post what is higher.
How to get bullet texture index.
How to get where decals were writen (traceline - yes, but what about shotgun)?
|
in the example,
g_shell = precache_model("models/shotgunshell.mdl")
for soundtype i didnt find as well, and i set it to 1 .....
for a shotgun you have to make a loop :
Code:
// my shotgun shots 7 bullets at a time
for (bulletcount = 0; bulletcount < 7; bulletcount++)
{
pev(id, pev_v_angle, dest);
dest[0] = dest[0] + random_float(-1.0, 1.0) + random_float(-1.0, 1.0)
dest[1] = dest[1] + random_float(-1.0, 1.0) + random_float(-1.0, 1.0)
engfunc(EngFunc_MakeVectors, dest);
global_get(glb_v_forward, vecdir);
xs_vec_mul_scalar(vecdir, 2048.0, vecdir);
xs_vec_add(start, vecdir, dest);
engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr)
Target = get_tr2(ptr, TR_pHit)
// endpos
get_tr2(ptr, TR_vecEndPos, endpos)
//hitgroup
hitgroup = get_tr2(ptr, TR_iHitgroup)
engfunc(EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, endpos, 0)
write_byte(TE_GUNSHOTDECAL)
engfunc(EngFunc_WriteCoord, endpos[0])
engfunc(EngFunc_WriteCoord, endpos[1])
engfunc(EngFunc_WriteCoord, endpos[2])
write_short(id)
write_byte(decal)
message_end()
// deal damages etc...
}
its a part of a shotgun (with a maglite) plugin for biohazard plugin. it work with weaponmod and there are functions to get the right decal for the weapon (static decal ; decal = wpn_gi_get_gunshot_decal())
maybe have a look at weaponmod to know how it can get it.