
void RecvProxy_Viewmodel(const CRecvProxyData* pData, void* pStruct, void* pOut)
{
int iModel = pData->m_Value.m_Int;
int cCTDefault = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_default_ct.mdl");
int cBayonet = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_bayonet.mdl");
int cGut = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_gut.mdl");
int cTDefault = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_default_t.mdl");
int cButterfly = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_butterfly.mdl");
int cGunGame = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_gg.mdl");
int cFlip = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_flip.mdl");
int cM9Bayonet = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_m9_bay.mdl");
int cFalchion = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_falchion_advanced.mdl");
int cKarambit = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_karam.mdl");
int cDagger = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_push.mdl");
int cHuntsman = MPGHContribV2.m_pModelinfo->GetModelIndex("models/weapons/v_knife_tactical.mdl");
C_BaseEntity *localPlayer = (C_BaseEntity*)MPGHContribV2.m_pEntlist->GetClientEntity(MPGHContribV2.m_pEngine->GetLocalPlayer());
if (localPlayer)
{
if (MPGHContribV2.m_pEntity->GetBaseCombatWeapon(localPlayer))
{
if (iModel == cBayonet
|| iModel == cButterfly
|| iModel == cCTDefault
|| iModel == cTDefault
|| iModel == cFlip
|| iModel == cGunGame
|| iModel == cGut
|| iModel == cKarambit
|| iModel == cM9Bayonet
|| iModel == cHuntsman
|| iModel == cFalchion)
{
//int iKnife = MPGHContribV2.m_pConvars->flknife;
if (CMDMPGH->getValue("bayonet") == 1)
{
iModel = cBayonet;
}
else if (CMDMPGH->getValue("flip") == 1)
{
iModel = cFlip;
}
else if (CMDMPGH->getValue("gut") == 1)
{
iModel = cGut;
}
else if (CMDMPGH->getValue("karambit") == 1)
{
iModel = cKarambit;
}
else if (CMDMPGH->getValue("m9bayonet") == 1)
{
iModel = cM9Bayonet;
}
else if (CMDMPGH->getValue("huntsman") == 1)
{
iModel = cHuntsman;
}
else if (CMDMPGH->getValue("butterfly") == 1)
{
iModel = cButterfly;
}
else if (CMDMPGH->getValue("falchion") == 1)
{
iModel = cFalchion;
}
else if (CMDMPGH->getValue("dagger") == 1)
{
iModel = cDagger;
}
}
}
}
*(int*)pOut = iModel;
}
MPGHContribV2.m_pNetVars->HookProp("DT_BaseViewModel", "m_nModelIndex", RecvProxy_Viewmodel);
currently there is no public method for changing knife externaly.

if(Weapon == 42) {
Mem.Write<int>(WeaponData + Attri + Item + ItemDef, 507);
}
if(Weapon == 507) {
// Do iViewModel
// Do WorldModel
}
if(Weapon == 42 || Weapon == 507) {
Mem.Write<int>(WeaponData + Attri + Item + ItemDef, 507);
// Do iViewModel
// Do WorldModel
}