using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GTA;
using GTA.Math;
using System.Windows.Forms;
using System.Drawing;
using GTA.Native;

namespace Hitman
{
    public class HitmanMod : Script
    {
        public HitmanMod()
        {
            this.KeyDown += OnGPressed;
        }
        private void OnGPressed(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.G)
            {
                var vehicle = World.GetClosestVehicle(Game.Player.Character.Position, 5);
                if (vehicle == null)
                {
                    UI.Notify("No vehicle nearby!");
                }
                else
                {
                    Game.Player.Character.Task.EnterVehicle(vehicle, VehicleSeat.Passenger);
                }

            }
        }
    }
}
