This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

How can i change the shot animation


Post New Thread Reply   
 
Thread Tools Display Modes
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-12-2013 , 09:49   Re: How can i change the shot animation
Reply With Quote #11

your code doesn't work
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
bibu
Veteran Member
Join Date: Sep 2010
Old 05-12-2013 , 10:11   Re: How can i change the shot animation
Reply With Quote #12

Oh testing is sensational.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-12-2013 , 11:44   Re: How can i change the shot animation
Reply With Quote #13

doesn't work
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 05-12-2013 , 12:18   Re: How can i change the shot animation
Reply With Quote #14

Weapon fire animation code is handled by client-side, something you can do override the fire animation, hooking PreThink Post (yeah, Player_PreThink Post with Ham) would be the appropiate forward.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-12-2013 , 12:25   Re: How can i change the shot animation
Reply With Quote #15

Quote:
Originally Posted by bibu View Post
Try something like the following code. I still don't get why you want to replace anim. If you're already using a custom model, then it should show the anim already correctly. Correct me if it's wrong.

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define ANIM_TO_REPLACE 1
#define REPLACE_ANIM_WITH 1337

public plugin_init()
{
    
RegisterHam(Ham_CS_Weapon_SendWeaponAnim"weapon_entity""WeaponSendWeaponAnim")
}

public 
WeaponSendWeaponAnim(idiAnim/*, skiplocal*/)
{
    
// Check the animation to replace.
    
if(iAnim == ANIM_TO_REPLACE)
    {
        
// Replace animation with the value you want.
        
SetHamParamInteger(2REPLACE_ANIM_WITH)
    }

Seems the best options, since pev_weaponanim gonna be set, and since that value gonna be used in UpdateClientData.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-12-2013 , 15:36   Re: How can i change the shot animation
Reply With Quote #16

Quote:
Originally Posted by Bos93 View Post
doesn't work
Quote:
Originally Posted by bibu View Post
Oh testing is sensational.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-12-2013 , 16:42   Re: How can i change the shot animation
Reply With Quote #17

bibu,ok

doesn't work
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
bibu
Veteran Member
Join Date: Sep 2010
Old 05-12-2013 , 16:57   Re: How can i change the shot animation
Reply With Quote #18

Bos93,ok

That's why I tested it and that's why your describing what exactly isn't working and what in the logs is right? Look, try to explain what happens with the code I gave. Seriously, by saying that it doesn't work gives much details, even when I tested it before I posted it here.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-12-2013 , 19:21   Re: How can i change the shot animation
Reply With Quote #19

All animation has changed except the shot.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
andyt0621
New Member
Join Date: May 2013
Old 05-13-2013 , 00:23   Re: How can i change the shot animation
Reply With Quote #20

Thanks all for replying.
I tried to use Ham_CS_Weapon_SendWeaponAnim..
but even i updated hamsandwich to this https://forums.alliedmods.net/showpo...9&postcount=34
Ham_CS_Weapon_SendWeaponAnim's iAnim cant return shot animation number..
i think this means shot animation cant detected by Weapon_SendWeaponAnim

maybe i will try to hook Player_PreThink to replace the animation..
but i am not optimistic this can replace properly..
as i am using CmdStart to do replacing and sometime i can see the original shot animation flashed/appeared before the new animation
andyt0621 is offline
Old 05-13-2013, 00:24
ConnorMcLeod
This message has been deleted by ConnorMcLeod. Reason: lag
Reply



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 14:18.


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