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_plugin( PLUGIN, VERSION, "ConnorMcLeod" );
g_iEventM4A1 = EF_PrecacheEvent(1, "events/m4a1.sc");
}
public pfn_playbackevent(flags, id, eventid /* , Float:delay, Float:Origin[3], Float:Angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2, bparam1, bparam2 */ )
{
if( eventid == g_iEventM4A1 )
{
ExecuteHamB(Ham_CS_Weapon_SendWeaponAnim, id, g_iOurCustomShotAnimationM4A1, 0); // make sure last param is 0.
}
}
__________________