AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon animation bug (https://forums.alliedmods.net/showthread.php?t=171932)

The Inhabitant Of Heavens 11-12-2011 15:59

Weapon animation bug
 
Help me to fix this animation bug.

I suppose the fault is in this forward

Code:

g_UpdateClientData_Forward = register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1);
I am enabling this forward at weapon Deploy_Post, and disabling at ItemPostFrame.

Code:

public UpdateClientData_Post(iPlayer, iSendWeapons, CD_Handle)
{
        set_cd(CD_Handle, CD_ID, 0)
 
        return FMRES_IGNORED
}


Arkshine 11-12-2011 16:04

Re: Weapon animation bug
 
If you want to block properly weapon animation + sound, don't use this way.

Hook Ham_Item_Deploy and set m_flNextPrimaryAttack + m_flNextSecondaryAttack + m_flNextAttack offsets to high value.

The Inhabitant Of Heavens 11-12-2011 16:24

Re: Weapon animation bug
 
I've explained a lil bit incorrect.

Well, I have created my own knife(based on CS default knife of course), but new knife weapon deploy, attack etc. animation ID's are not like in CS knife.
It's not a problem, I succesfully fixed it.
The main problem is, whenever I switch from my new knife to any other weapon, other weapon deploy animation is showing incorrectly.For example my knife deploy anim ID is 3, so on all other weapons on deplot anim ID 3 will be played, not their original animation.

Arkshine 11-12-2011 17:27

Re: Weapon animation bug
 
Without seeing your code, what you say doesn't help. Generally when you want to create your own weapon, it would be more appropriate to fully block the original weapon to avoid weird behaviors.

XINLEI 11-12-2011 17:55

Re: Weapon animation bug
 
Quote:

Originally Posted by The Inhabitant Of Heavens (Post 1595502)
I've explained a lil bit incorrect.

Well, I have created my own knife(based on CS default knife of course), but new knife weapon deploy, attack etc. animation ID's are not like in CS knife.
It's not a problem, I succesfully fixed it.
The main problem is, whenever I switch from my new knife to any other weapon, other weapon deploy animation is showing incorrectly.For example my knife deploy anim ID is 3, so on all other weapons on deplot anim ID 3 will be played, not their original animation.

You have to decompile the model and order the animations...

Put the model here if you don't know what i'm talking about.


All times are GMT -4. The time now is 08:31.

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