Hello, I'm trying to set a custom sub-model in player view model, more specifically in the knife v_ model. My code it's working, but with a little bug in deploy event. Aparently is there a delay, so if I deploy, only after few seconds the body is changed.
I can share my model if you need it.
Code:
#include <amxmodx>
#include <reapi>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
register_plugin("Cloak Test", "1.0", "Crazy");
RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy"),
register_forward(FM_CanSkipPlayer, "CBasePlayer_CanSkip");
}
public CBasePlayer_CanSkip(this)
{
if (!is_user_alive(this))
return FMRES_IGNORED;
if (get_user_weapon(this) != CSW_KNIFE)
return FMRES_IGNORED;
forward_return(FMV_CELL, false);
return FMRES_OVERRIDE;
}
public CKnife_Deploy(this)
{
set_entvar(this, var_body, 1);
}
__________________