Example #1
0
        public static void ApplyKillIcon(ref IGameEventManager.GameEvent gameEvent)
        {
            int UserId = gameEvent.GetInt("attacker");

            if (UserId == 0)
            {
                return;
            }

            if (Interface.VEngineClient.GetPlayerForUserID(UserId) != Interface.VEngineClient.GetLocalPlayer)
            {
                return;
            }

            string Weapon = gameEvent.GetString("weapon");

            var WeaponIndex = Interface.ClientEntityList.GetClientEntity(Interface.VEngineClient.GetLocalPlayer)->GetPlayer->GetActiveWeapon->ItemDefinitionIndex;

            if (WeaponIndex.IsKnife())
            {
                foreach (var Icon in KillIcon(WeaponIndex))
                {
                    if (Weapon == Icon.Key)
                    {
                        gameEvent.SetString("weapon", Icon.Value);
                        break;
                    }
                }
            }
        }
Example #2
0
        public static void ApplyStatTrack(ref IGameEventManager.GameEvent gameEvent)
        {
            int UserId = gameEvent.GetInt("attacker");

            if (UserId == 0)
            {
                return;
            }

            if (Interface.VEngineClient.GetPlayerForUserID(UserId) != Interface.VEngineClient.GetLocalPlayer)
            {
                return;
            }

            BaseCombatWeapon *WeaponIndex = Interface.ClientEntityList.GetClientEntity(Interface.VEngineClient.GetLocalPlayer)->GetPlayer->GetActiveWeapon;
            uint WeaponId = WeaponIndex->ItemDefinitionIndex.GetWeaponId();
            IClientNetworkable *ClientNetworkable = ((IClientEntity *)WeaponIndex)->GetClientNetworkable;

            ref CSkinChangerWeapon Weapon = ref ConfigManager.CSkinChangerWeapons[WeaponId];