View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2011 , 09:00   Re: How to change Sub-Model on player model?
Reply With Quote #37

So I've done some tests, though I'm still confused on few things.

What I can say for sure :

- The body value is calculated from the current body value and a base value. (pbodypart->base). I've not idea what is the "base" thing, for example for your model, group0 : 1, group1 : 1, group2 : 1, group3 : 2.
- [Set|Get]BodyGroup can't be used on v_ weapons. Don't know why exactly, but GET_MODEL_PTR returns a null pointer. If you put the v_ model on a dummy entity it works. So, maybe it's because model in not drawn or because attached or not designed to work on player's weapons.
- You can't set different bodygroup on a weapon because the way it works, because you need to send an animation with the body. So to do what you want you need to create one bodygroup and severals bodypart, like : silencer, red dot, silencer + red dot. You get the idea. This way you don't need to be bother about body, it's linear. I know a HL1 developper which wanted to do something like you do, and he had no choice to do like said. It will work, though you will experience bug client-side since it appears that it doesn't always use the right pev_body value and through a plugin you can't fix it. So good luck.
__________________
Arkshine is offline