Raised This Month: $ Target: $400
 0% 

Change Weapon Sub-Model (v_)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 05-10-2016 , 06:13   Re: Change Weapon Sub-Model (v_)
Reply With Quote #8

Quote:
Originally Posted by SpannerSpammer View Post
I don't know if this will work, but try this:
Hook UpdateClientData, see if the viewmodel is the custom one one you set.
If it is, then set a task for about 0.5 seconds or more to send an SVC_WEAPONANIM MSG
to the client (You have to delay this for the Update MSG to be sent to the client first).
Set the weapon animation and bodygroup as needed.

Code:
stock SendWeaponAnim( id, iAnim, iBody )
{
    if ( !is_valid_player(id) || is_user_bot( id ) ) return 0; // check player validity first with some function (Humans only)
    set_pev( id, pev_weaponanim, iAnim );

    message_begin( MSG_ONE, SVC_WEAPONANIM, _, id );
    write_byte( iAnim );  // sequence number.
    write_byte( iBody );  // weaponmodel bodygroup.
    message_end();

    return 1;
}
First of all thank you for helping me!



Quote:
see if the viewmodel is the custom one one you set.
How can i check if the viewmodel is the one i set?



Quote:
to send an SVC_WEAPONANIM MSG
to the client
Like this?
PHP Code:
message_begin(MSG_ONESVC_WEAPONANIM, {000}, player)
write_byte(iAnim)
write_byte(iHands// id of hands
message_end() 

Quote:
Set the weapon animation and bodygroup as needed.
Where?


Btw user Backstabnoob said it will look bad... (https://forums.alliedmods.net/showpo...0&postcount=25)

I guess i should forget this and just make seperated model files.
Too much work and it will not look good.
Syturi0 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode