Esempio n. 1
0
        public static void GlowRender(BasePlayer *localPlayer)
        {
            int myTeam = localPlayer->TeamNum;

            for (int index = 0; index < IGlowObjectManager->Size; index++)
            {
                if (index == Interface.VEngineClient.GetLocalPlayer)
                {
                    continue;
                }

                BasePlayer *entity = Interface.ClientEntityList.GetClientEntity(index)->GetPlayer;

                if (entity == null)
                {
                    continue;
                }

                if (myTeam == entity->TeamNum)
                {
                    continue;
                }

                IGlowObjectManager->SetEntity(index, entity);
                IGlowObjectManager->SetColor(index, ConfigManager.CVisual.GlowHPEnable, entity->GetHealth);
                IGlowObjectManager->SetRenderFlags(index, true, false);
            }
        }
Esempio n. 2
0
 public static void MoonWalk(ref IClientMode.UserCmd cmd, BasePlayer *localPlayer)
 {
     if (localPlayer->GetFlags != (int)BasePlayer.MoveType.LADDER)
     {
         cmd.buttons ^= IClientMode.Buttons.IN_FORWARD | IClientMode.Buttons.IN_BACK | IClientMode.Buttons.IN_MOVELEFT | IClientMode.Buttons.IN_MOVERIGHT;
     }
 }
Esempio n. 3
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]));
            }
        }
Esempio n. 4
0
        private static void FrameStageNotify(IBaseClientDLL.FrameStage FrameStage)
        {
            if (FrameStage == IBaseClientDLL.FrameStage.RENDER_START)
            {
                Visual.FakePrime();
            }

            if (FrameStage == IBaseClientDLL.FrameStage.NET_UPDATE_POSTDATAUPDATE_START)
            {
                BasePlayer *localPlayer = Interface.ClientEntityList.GetClientEntity(Interface.VEngineClient.GetLocalPlayer)->GetPlayer;

                if (localPlayer == null)
                {
                    Interface.BaseClientDLL.FrameStageNotifyOriginal(FrameStage);

                    return;
                }

                if (ConfigManager.CSkinChanger.SkinChangerActive)
                {
                    SkinChanger.OnFrameStage(FrameStage, localPlayer);
                }
            }

            Interface.BaseClientDLL.FrameStageNotifyOriginal(FrameStage);
        }
Esempio n. 5
0
        public static void BunnyHop(ref IClientMode.UserCmd cmd, BasePlayer *localPlayer)
        {
            if (localPlayer->GetMoveType == BasePlayer.MoveType.LADDER || localPlayer->GetMoveType == BasePlayer.MoveType.NOCLIP && (localPlayer->GetFlags & (int)BasePlayer.Flags.FL_INWATER) != 0)
            {
                return;
            }

            _ = ((cmd.buttons & IClientMode.Buttons.IN_JUMP) != 0 && (localPlayer->GetFlags & (int)BasePlayer.Flags.FL_ONGROUND) != 0) ? cmd.buttons |= IClientMode.Buttons.IN_JUMP : cmd.buttons &= ~IClientMode.Buttons.IN_JUMP;
        }
Esempio n. 6
0
 public static void AutoStrafe(ref IClientMode.UserCmd cmd, BasePlayer *localPlayer)
 {
     if ((localPlayer->GetFlags & 1) == 0)
     {
         if (cmd.mousedx < 0)
         {
             cmd.sidemove = -450.0f;
         }
         else if (cmd.mousedx > 0)
         {
             cmd.sidemove = 450.0f;
         }
     }
 }
Esempio n. 7
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]));
            }
        }
Esempio n. 8
0
        private static bool CreateMove(float Smt, ref IClientMode.UserCmd UserCmd)
        {
            if (UserCmd.IsNull)
            {
                return(Interface.ClientMode.CreateMoveOriginal(Smt, ref UserCmd));
            }

            if (UserCmd.commandNumber == 0)
            {
                return(Interface.ClientMode.CreateMoveOriginal(Smt, ref UserCmd));
            }

            BasePlayer *localPlayer = Interface.ClientEntityList.GetClientEntity(Interface.VEngineClient.GetLocalPlayer)->GetPlayer;

            if (localPlayer == null)
            {
                return(false);
            }

            if (ConfigManager.CMisc.BunnyHop)
            {
                Misc.BunnyHop(ref UserCmd, localPlayer);
            }

            if (ConfigManager.CVisual.RevealRanks)
            {
                Visual.RevealRanks(ref UserCmd);
            }

            if (ConfigManager.CMisc.AutoStrafe)
            {
                Misc.AutoStrafe(ref UserCmd, localPlayer);
            }

            if (ConfigManager.CMisc.MoonWalk)
            {
                Misc.MoonWalk(ref UserCmd, localPlayer);
            }

            return(false);
        }
Esempio n. 9
0
        private static int DoPostScreenEffects(int Param)
        {
            BasePlayer *localPlayer = Interface.ClientEntityList.GetClientEntity(Interface.VEngineClient.GetLocalPlayer)->GetPlayer;

            if (localPlayer == null)
            {
                return(Interface.ClientMode.DoPostScreenEffectsOriginal(Param));
            }

            if (ConfigManager.CVisual.GlowEnable)
            {
                Visual.GlowRender(localPlayer);
            }

            if (ConfigManager.CVisual.NoFlash)
            {
                Visual.NoFlash();
            }

            return(Interface.ClientMode.DoPostScreenEffectsOriginal(Param));
        }
Esempio n. 10
0
        public static void OnFrameStage(IBaseClientDLL.FrameStage frameStage, BasePlayer *localPlayer)
        {
            if (!localPlayer->IsAlive)
            {
                return;
            }

            Interface.VEngineClient.GetPlayerInfo(Interface.VEngineClient.GetLocalPlayer, out IVEngineClient.PlayerInfo PlayerInfo);

            for (int Index = 0; Index < 8; Index++)
            {
                BaseCombatWeapon *Weapon = localPlayer->GetMyWeapons(Index);

                if (Weapon == null)
                {
                    continue;
                }

                if (Weapon->OriginalOwnerXuidLow != PlayerInfo.m_nXuidLow)
                {
                    continue;
                }

                if (Weapon->OriginalOwnerXuidHigh != PlayerInfo.m_nXuidHigh)
                {
                    continue;
                }

                CSkinChangerWeapon WeaponId = ConfigManager.CSkinChangerWeapons[Weapon->ItemDefinitionIndex.GetWeaponId()];

                ApplyWeapon(localPlayer, Weapon, WeaponId, PlayerInfo);
            }

            ApplyKnife(localPlayer, ref ConfigManager.CSkinChangerWeapons[35]);

            ApplyWearable(localPlayer, ref ConfigManager.CSkinChangerWeapons[36], PlayerInfo);
        }
Esempio n. 11
0
 public static void RadarRender(BasePlayer *entity) => entity->Spotted = 1;
Esempio n. 12
0
        private static void ApplyWearable(BasePlayer *localPlayer, ref CSkinChangerWeapon configWeapon, IVEngineClient.PlayerInfo playerInfo)
        {
            uint *wearables = localPlayer->GetMyWearables;

            if (wearables == null)
            {
                return;
            }

            IBaseClientDLL.ClientClass *Class = Interface.BaseClientDLL.GetAllClasses();

            if (Class == null)
            {
                return;
            }

            int serial = Weapon.Random.Next() % 0x1000;
            int entry  = Interface.ClientEntityList.GetHighestEntityIndex + 1;

            if (entry == 0)
            {
                return;
            }

            if (Interface.ClientEntityList.GetClientEntity((int)(wearables[0] & 0xFFF)) == null)
            {
                while (Class != null)
                {
                    if (Class->ClassId == IBaseClientDLL.ClassId.CEconWearable)
                    {
                        break;
                    }

                    Class = Class->Next;
                }

                Marshal.GetDelegateForFunctionPointer <MakeGloveDelegate>((IntPtr)Class->CreateFunction)(entry, serial);

                wearables[0] = (uint)(entry | (serial << 16));
            }

            BaseCombatWeapon *Glove = (BaseCombatWeapon *)Interface.ClientEntityList.GetClientEntityFromHandle((void *)wearables[0]);

            if (Glove == null)
            {
                return;
            }

            if (Glove->ItemDefinitionIndex != configWeapon.WeaponID)
            {
                Glove->ItemIdHigh = -1;
                Glove->AccountId  = playerInfo.m_nXuidLow;

                Glove->ItemDefinitionIndex = configWeapon.WeaponID;
                ((BaseViewModel *)Glove)->SetModelIndex(Interface.ModelInfoClient.GetModelIndex(GloveModel[Glove->ItemDefinitionIndex]));

                Glove->EntityQuality    = QualityId.Normal;
                Glove->FallBackPaintKit = configWeapon.SkinID;

                ((IClientEntity *)Glove)->GetClientNetworkable->PreDataUpdate(0);
            }
        }