Raised This Month: $51 Target: $400
 12% 

How can i change the shot animation


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-13-2013 , 00:43   Re: How can i change the shot animation
Reply With Quote #21

Makes sense, try to send wanted animation with Ham_CS_Weapon_SendWeaponAnim right after PlaybackEvent.

Following code may acts a bit weird due to client prediction, but other method would do the same and be less efficient.

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

#pragma semicolon 1

#define PLUGIN "Change M4a1 shot animation"
#define VERSION "0.0.1"

new g_iEventM4A1;

new 
g_iOurCustomShotAnimationM4A1 7// whatever

public plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
g_iEventM4A1 EF_PrecacheEvent(1"events/m4a1.sc");
}

public 
pfn_playbackevent(flagsideventid /* , Float:delay, Float:Origin[3], Float:Angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2, bparam1, bparam2 */ )
{
    if( 
eventid == g_iEventM4A1 )
    {
        
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnimidg_iOurCustomShotAnimationM4A10); // make sure last param is 0.
    
}

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-13-2013 , 03:01   Re: How can i change the shot animation
Reply With Quote #22

#pragma semicolon 1

Connor,this is your new style? ?) :p


Ham_CS_Weapon_SendWeaponAnim - The first argument is entiti weapons

fix:

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

#pragma semicolon 1

#define PLUGIN "Change M4a1 shot animation"
#define VERSION "0.0.1"

new g_iEventM4A1;

new 
g_iOurCustomShotAnimationM4A1 7// whatever

const m_pActiveItem 373;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
g_iEventM4A1 EF_PrecacheEvent(1"events/m4a1.sc");
}

public 
pfn_playbackevent(flagsideventid /* , Float:delay, Float:Origin[3], Float:Angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2, bparam1, bparam2 */ )
{
    if( 
eventid == g_iEventM4A1 )
    {
        new 
pEntity get_pdata_cbaseid m_pActiveItem );
        
        
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnimpEntityg_iOurCustomShotAnimationM4A10); // make sure last param is 0.
    
}


But it is still not work.




Change fire sound possible only with CD_flNextAttack\CD_ID
__________________

Last edited by Bos93; 05-13-2013 at 03:07.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-13-2013 , 12:17   Re: How can i change the shot animation
Reply With Quote #23

Try at PlaybackEvent post function then, though i'm not sure it would change anything.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 05-13-2013, 21:54
Bos93
This message has been deleted by Bos93.
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 04-13-2024 , 09:54   Re: How can i change the shot animation
Reply With Quote #24

Quote:
Originally Posted by Bos93 View Post
But it is still not work.
Code:
Ham_CS_Weapon_SendWeaponAnim
PHP Code:
-> Called on gun deploy;
-> 
Called on gun reload;
-> 
Called on gun idle (1 sec after);
-> 
Called on certain player actions like after moving from a floor level to another.

-> 
Not called on gun fire
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
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 13:21.


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