View Single Post
sdz
Senior Member
Join Date: Feb 2012
Old 05-30-2016 , 13:07   Re: [CS:S] Parent Entity or Sprite to Weapon
Reply With Quote #6

Quote:
Originally Posted by abgar View Post
Thanks for that information, however unfortunately im still not sure how to attach the sprite to the weapon, instead of the client. (or an enity to a weapon, as i could use either a sprite or an entity).

The original code i posted definitely does work without having to turn on the sprite, or activate it - The SpawnFlags, "1" for env_sprite means start activated.

It's just the parenting that sprite to the client's weapon, instead of the client itself. Are you able to provide an example of how i can do that?

Thanks so much again

Well you'd need to get the entity index of the client's weapon, then hook OnWeaponSwitch.
There's a couple routes you could take with this:
Then once you have the weapon index, you just do the above except replacing client with the weaponindex.
sdz is offline