Kieran_S0

Mission

Feb 1st, 2021
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.47 KB | None | 0 0
  1. using GTA;
  2. using GTA.Math;
  3. using GTA.Native;
  4. using System;
  5. using System.Windows.Forms;
  6.  
  7. public partial class Lestermission : Script
  8. {
  9.     enum Missiontask
  10.     {
  11.         none,
  12.         initialize,
  13.         atLester,
  14.         goToVehicle,
  15.         enterVehicle,
  16.         pickupGuard,
  17.         isGuardInVehicle,
  18.  
  19.         restartMission
  20.     }
  21.  
  22.     Ped player = Game.Player.Character;
  23.     Ped lester;
  24.     Ped guard;
  25.     Vehicle missionVehicle;
  26.     Blip blipDestination;
  27.     Vector3 guardMarkerPos = new Vector3(373.0939f, -767.4551f, 28.29266f);
  28.     Vector3 lesterStairsPos = new Vector3(717.9989f, -976.9f, 23.31f);
  29.     Vector3 missionVehiclePos = new Vector3(695.8693f, -1005.955f, 22.43776f);
  30.     Vector3 guardPos = new Vector3(370.8857f, -771.8976f, 29.27729f);
  31.     bool missionNotification;
  32.     Missiontask task;
  33.  
  34.     public Lestermission()
  35.     {
  36.         Tick += (o, e) => Processing();
  37.         KeyUp += (o, e) =>
  38.         {
  39.             if (e.KeyCode == Keys.NumPad7) Initialize();
  40.             if (e.KeyCode == Keys.NumPad1) Deinitialize();
  41.         };
  42.     }
  43.     void Initialize()
  44.     {
  45.         //create mission vehicle and lester
  46.         lester = World.CreatePed(new Model(1302784073), new GTA.Math.Vector3(717.079f, -975.927f, 24.91054f), -153.1001f);
  47.         lester.AddBlip();
  48.         lester.CurrentBlip.Sprite = BlipSprite.Lester;
  49.         lester.CurrentBlip.Color = BlipColor.Red;
  50.         lester.CurrentBlip.Name = "Lester";
  51.         lester.CurrentBlip.IsShortRange = true;
  52.  
  53.         //setup vars and tasks
  54.         missionNotification = false;
  55.         task = Missiontask.atLester;
  56.  
  57.         //subtitle
  58.         GTA.UI.ShowSubtitle("Script is now ~g~Initialized");
  59.     }
  60.     void Deinitialize()
  61.     {
  62.         //delete mission items
  63.         if (missionVehicle != null) missionVehicle.Delete();
  64.         if (lester != null) lester.Delete();
  65.         if (guard != null) guard.Delete();
  66.         if (blipDestination != null) blipDestination.Remove();
  67.         Function.Call(Hash.SET_PED_COMPONENT_VARIATION, player, 9, 0, 0, 0); //duffelbag
  68.         Function.Call(Hash.SET_PED_COMPONENT_VARIATION, player, 5, 0, 0, 0); //gloves
  69.  
  70.         //subtitle
  71.         GTA.UI.ShowSubtitle("Script is now ~r~Deinitialized");
  72.     }
  73.     public void DisplayHelpTextThisFrame(string text)
  74.     {
  75.         Function.Call(Hash._SET_TEXT_COMPONENT_FORMAT, "STRING");
  76.         Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, text);
  77.         Function.Call(Hash._0x238FFE5C7B0498A6, 0, 0, 1, -1);
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment