Пример #1
0
        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]));
            }
        }
Пример #2
0
        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]));
            }
        }