Exemple #1
0
        private void HandleOtherDeath(object sender, OtherDeathEventArgs e)
        {
            Weapon weapon = new Weapon()
            {
                Equipment      = (Models.EquipmentElement)((int)e.Weapon.Weapon),
                OriginalString = e.Weapon.OriginalString,
                AmmoInMagazine = (short)e.Weapon.AmmoInMagazine,
                AmmoType       = (short)e.Weapon.AmmoType,
            };

            Models.Entity entity = new Models.Entity()
            {
                ID            = e.Entity.ID,
                Type          = (Models.EntityType)((int)e.Entity.Type),
                ModelIndex    = e.Entity.ModelIndex,
                ModelLocation = e.Entity.ModelLocation,
                Position      = new Models.Vector(e.Entity.Position.X, e.Entity.Position.Y, e.Entity.Position.Z),
                Rotation      = new Models.Vector(e.Entity.Rotation.X, e.Entity.Rotation.Y, e.Entity.Rotation.Z),
            };

            OtherDeathEvent newEvent = new OtherDeathEvent()
            {
                Entity            = entity,
                EntityID          = e.Entity.ID,
                EntityType        = e.EntityType,
                Weapon            = weapon,
                Headshot          = e.Headshot,
                KillerSteamID     = e.Killer.SteamID,
                PenetratedObjects = e.PenetratedObjects
            };

            CurrentTick.Events.Add(newEvent);
        }
Exemple #2
0
        private void HandleEntityRemoved(object sender, EntityRemovedEventArgs e)
        {
            Models.Entity entity = new Models.Entity()
            {
                ID            = e.Entity.ID,
                Type          = (Models.EntityType)((int)e.Entity.Type),
                ModelIndex    = e.Entity.ModelIndex,
                ModelLocation = e.Entity.ModelLocation,
                Position      = new Models.Vector(e.Entity.Position.X, e.Entity.Position.Y, e.Entity.Position.Z),
                Rotation      = new Models.Vector(e.Entity.Rotation.X, e.Entity.Rotation.Y, e.Entity.Rotation.Z),
            };

            EntityRemovedEvent newEvent = new EntityRemovedEvent()
            {
                Entity   = entity,
                EntityID = e.Entity.ID,
            };

            CurrentTick.Events.Add(newEvent);
        }