示例#1
0
        public void OnKeyDown(object sender, KeyEventArgs keyEventArgs)
        {
            Vehicles.OnKeyDown(sender, keyEventArgs);

            switch (keyEventArgs.KeyCode)
            {
            case Keys.F10:
            {
                // Create a vehicle using the Vehicles instance we declared earlier.
                WVehicle vehicle = Vehicles.CreateVehicle(VehicleHash.Adder, Game.PlayerPed.Position.Around(2f));

                // Subscribe to a property called "Health" inside "vehicle.Entity".
                vehicle.Subscribe(vehicle.Entity, "Health", OnHealthChanged);

                break;
            }
            }
        }