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_AllocString, model)
set_pev_string(id, pev_viewmodel2, animation_entity)
UTIL_SenwWeaponAnim(id, USE_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_Deploy, get_pdata_cbase(id, m_iActiveItem, LINUX_DIFF_PLAYER))
}
// https://forums.alliedmods.net/showpost.php?p=2387036&postcount=2
stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
set_pev(pPlayer, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = pPlayer)
write_byte(Sequence)
write_byte(pev(pPlayer, pev_body))
message_end()
}
__________________