View Single Post
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-28-2024 , 23:56   Re: change v_ model for a few seconds
Reply With Quote #4

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

#define m_iActiveItem 373
#define LINUX_DIFF_PLAYER 5

const USE_ANIMATION 0
new const model[] = "models/v_injectorX.mdl"

public plugin_init()
    
register_clcmd("say f""clcmd_f")

public 
plugin_precache()
    
precache_model(model)

public 
clcmd_f(id)
{
    new 
animation_entity engfunc(EngFunc_AllocStringmodel)
    
set_pev_string(idpev_viewmodel2animation_entity)
    
UTIL_SenwWeaponAnim(idUSE_ANIMATION)
    
set_task(2.83"end_animation"id)
}

public 
end_animation(id)
{
    if (
is_user_alive(id))
        
// https://amx-x.ru/viewtopic.php?f=8&t=28697
        
ExecuteHam(Ham_Item_Deployget_pdata_cbase(idm_iActiveItemLINUX_DIFF_PLAYER))
}

// https://forums.alliedmods.net/showpost.php?p=2387036&postcount=2
stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
    
set_pev(pPlayerpev_weaponanimSequence)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player pPlayer)
    
write_byte(Sequence)
    
write_byte(pev(pPlayerpev_body))
    
message_end()

__________________
bigdaddy424 is offline