private static void ApplyWeapon(BasePlayer *localPlayer, BaseCombatWeapon *weaponPtr, CSkinChangerWeapon configWeapon, IVEngineClient.PlayerInfo playerInfo) { if (configWeapon.WeaponID == WeaponId.None) { return; } weaponPtr->ItemIdHigh = -1; weaponPtr->AccountId = playerInfo.m_nXuidLow; if (!string.IsNullOrWhiteSpace(configWeapon.WeaponName)) { weaponPtr->CustomName = configWeapon.WeaponName; } if (configWeapon.StatTrackEnable && configWeapon.StatTrack >= 0) { weaponPtr->EntityQuality = QualityId.Strange; weaponPtr->FallBackStatTrack = configWeapon.StatTrack; } weaponPtr->FallBackPaintKit = configWeapon.SkinID; WeaponId WeaponIndex = weaponPtr->ItemDefinitionIndex; if (WeaponIndex.IsKnife() && WeaponIndex != configWeapon.WeaponID) { weaponPtr->ItemDefinitionIndex = configWeapon.WeaponID; ((BaseViewModel *)weaponPtr)->SetModelIndex(Interface.ModelInfoClient.GetModelIndex(KnifeModel[weaponPtr->ItemDefinitionIndex])); } }
private static void ApplyKnife(BasePlayer *localPlayer, ref CSkinChangerWeapon configWeapon) { if (configWeapon.WeaponID == WeaponId.None) { return; } WeaponId ActiveIndex = localPlayer->GetActiveWeapon->ItemDefinitionIndex; if (ActiveIndex.IsKnife()) { localPlayer->GetViewModel->SetModelIndex(Interface.ModelInfoClient.GetModelIndex(KnifeModel[ActiveIndex])); } }