Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using GTA.Math;
- using GTA.Native;
- using System;
- using System.Windows.Forms;
- using System.Drawing;
- public partial class Lestermission : Script
- {
- void Processing()
- {
- switch(task)
- {
- case Missiontask.initialize: Initialize(); break;
- case Missiontask.atLester: Processing_atLester(); break;
- case Missiontask.goToVehicle: Processing_goToVehicle(); break;
- case Missiontask.enterVehicle: Processing_enterVehicle(); break;
- case Missiontask.restartMission: Processing_restartMission(); break;
- case Missiontask.pickupGuard: Processing_pickupGuard(); break;
- }
- }
- void Processing_atLester()
- {
- //make sure script can start
- if (lester == null) return;
- if (!lester.Exists()) return;
- if (lester.IsDead) return;
- //show mission notif once
- if (player.IsNearEntity(lester, new Vector3(10f, 10f, 10f)) && !missionNotification)
- {
- GTA.UI.Notify("Talk to ~y~Lester ~w~to start the mission");
- missionNotification = true;
- }
- //key to talk to lester
- if (World.GetDistance(player.Position, lesterStairsPos) < 3.5f)
- {
- DisplayHelpTextThisFrame("Press ~INPUT_CONTEXT~ to talk to Lester");
- }
- //taking to lester
- if (Game.IsControlJustPressed(2, GTA.Control.Context))
- {
- if (World.GetDistance(player.Position, lesterStairsPos) < 3.5f)
- {
- //spawn the car
- missionVehicle = World.CreateVehicle(new Model(-1150599089), new GTA.Math.Vector3(695.8693f, -1005.955f, 22.43776f), 3.489466f);
- //vehicle color
- missionVehicle.PrimaryColor = VehicleColor.MetallicBlue;
- missionVehicle.SecondaryColor = VehicleColor.MetallicBlue;
- //subtitle
- GTA.UI.ShowSubtitle("I have left some drugs in the ~b~primo~w~. Get in the ~b~primo ~w~and deliver them for me.", 8000);
- //make lester walk away
- Function.Call(Hash.TASK_GO_STRAIGHT_TO_COORD, lester.Handle, 717.9976f, -963.3627f, 29.39533f, 1, -1, 0.0f, 0.0f);
- //delete lester blip
- lester.CurrentBlip.Remove();
- //next task
- task = Missiontask.goToVehicle;
- }
- }
- }
- void Processing_goToVehicle()
- {
- //add blip to mission vehicle
- missionVehicle.AddBlip();
- missionVehicle.CurrentBlip.Sprite = BlipSprite.GetawayCar;
- missionVehicle.CurrentBlip.Color = BlipColor.Blue;
- missionVehicle.CurrentBlip.IsShortRange = true;
- missionVehicle.CurrentBlip.Name = "Vehicle";
- //spawn guard
- guard = World.CreatePed(new Model(1822283721), new GTA.Math.Vector3(370.8857f, -771.8976f, 29.27729f), 0.008833435f);
- guard.Task.UseMobilePhone();
- //next task
- task = Missiontask.enterVehicle;
- }
- void Processing_enterVehicle()
- {
- if (player.IsSittingInVehicle(missionVehicle))
- {
- //make guard marker
- if (!missionVehicle.IsInRangeOf(guardMarkerPos, 3.5f)) Function.Call(Hash.DRAW_MARKER, 1, 372.8544f, -767.2747f, 28.29266f, 0f, 0f, 0f, 0f, 0f, 0f, 1.8f, 1.8f, 0.9f, 0, 153, 255, 255, false, false, 2, false, false, false);
- //give player duffelbag
- Function.Call(Hash.SET_PED_COMPONENT_VARIATION, player, 9, 1, 0, 1); //duffelbag
- Function.Call(Hash.SET_PED_COMPONENT_VARIATION, player, 5, 4, 0, 1); //gloves
- //delete mission vehicle blip when player is in car
- missionVehicle.CurrentBlip.Remove();
- //make dest blip
- blipDestination = World.CreateBlip(guardMarkerPos);
- blipDestination.Sprite = BlipSprite.Standard;
- blipDestination.Color = BlipColor.Blue;
- blipDestination.ShowRoute = true;
- blipDestination.Name = "Guard";
- //subtitle
- GTA.UI.ShowSubtitle("Pickup the ~b~guard", 8000);
- //next task
- task = Missiontask.pickupGuard;
- }
- }
- void Processing_pickupGuard()
- {
- if (player.IsInRangeOf(guardMarkerPos, 3.5f) && missionVehicle.IsStopped)
- {
- //make guard in pedgroup
- PedGroup pedgroup = player.CurrentPedGroup;
- pedgroup.Add(guard, false);
- guard.Task.ClearAll();
- }
- //next task
- task = Missiontask.restartMission;
- }
- void Processing_restartMission()
- {
- //if (!player.IsInRangeOf(, 100.00f)) Deinitialize();
- //if (!player.IsInRangeOf(, 100.00f)) Initialize();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment