Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using LemonUI.Menus;
- using System;
- using System.Windows.Forms;
- using GTA.Native;
- using GTA.Math;
- namespace LemonUI.Menu1
- {
- public class Basics : Script
- {
- public static Ped PP = Game.Player.Character;
- private static readonly ObjectPool pool = new ObjectPool();
- private static readonly NativeMenu menu = new NativeMenu("Name of your Menu", " ", " ");
- private static readonly NativeItem SpawnSportster = new NativeItem("Spawn HD Sportster", "");
- public Basics()
- {
- pool.Add(menu);
- menu.Add(SpawnSportster); SpawnSportster.Activated += VHDIron883;
- Tick += Basics_Tick;
- KeyDown += Basics_KeyDown;
- }
- private void Basics_Tick(object sender, EventArgs e)
- {
- pool.Process();
- }
- private void Basics_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.F3)
- { menu.Visible = true; }
- }
- private void VHDIron883(object sender, EventArgs e)
- {
- {
- //Vehicle vehicle15 = World.CreateVehicle("HDIron883", PP.Position + PP.ForwardVector * 3.0f, PP.Heading + 90); //Another way of doing it, doesn't require GTA.Math and GTA.Native
- Vehicle vehicle15 = World.CreateVehicle("HDIron883", PP.GetOffsetPosition(new Vector3(2, 0, 0)), PP.Heading + 90); //requires GTA.Math and GTA.Native
- Function.Call(Hash.SET_VEHICLE_COLOURS, vehicle15, 39, 39);
- Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 1, 1); //remove all extras
- Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 2, 1);
- Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 3, 1);
- Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 4, 1);
- Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 5, 1);
- Function.Call(Hash.SET_VEHICLE_EXTRA, vehicle15, 6, 1);
- menu.Visible = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement