Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new const szOwnerSID[] = "...";
new const szKnifeModel[] = "models/{modelname}.mdl";
// CBasePlayerItem
new const m_pPlayer = 41;
public plugin_init()
{
RegisterHam(Ham_Item_Deploy, "weapon_knife", "hamDeploy_post", 1);
}
public plugin_precache()
{
precache_model(szKnifeModel);
}
public hamDeploy_post(iEnt)
{
new id = get_pdata_cbase(iEnt, m_pPlayer, 4);
if(!id)
return;
new szUserSID[32];
get_user_authid(id, szUserSID, charsmax(szUserSID));
if(equal(szUserSID, szOwnerSID))
set_pev(id, pev_viewmodel2, szKnifeModel);
}
Untested.
PS: Next time us a better title for your thread, instead of jabaiting the members.