Problem showing route in the map
-
Hello, i am new to modding in GTA 5 and am following a tutorial, but when i declare the .showroute = true variable in game it doesn't show me the actual route, only the blip of the destination :
using GTA;
using GTA.Math;
using GTA.Native;
using System;
using System.Windows.Forms;public class ProjectRazor : Script
{
bool introMissionRunning = false;
Blip carBlip;
Blip carDestinationBlip;
Vehicle TargetCar;
Vector3 carPos = new Vector3(-471.9307f, -60.41102f, 43.9504f);
Vector3 carDestinationPos;
Vector3 walkDestinationPos;missionTask Task; enum missionTask { freemode, getInsideCar, goDestination, parkCar, walkToEnd, } public ProjectRazor() { Tick += (o, e) => Processing(); KeyUp += (o, e) => { if (e.KeyCode == Keys.NumPad1) Wait(500); Initialize(); if (e.KeyCode == Keys.NumPad2) Deinitialize(); }; } void Processing() { if(introMissionRunning) { switch(Task) { case missionTask.freemode: freemode(); break; case missionTask.getInsideCar: EnterTargetVehicle(); break; case missionTask.goDestination: goDestination(); break; case missionTask.parkCar: parkCar(); break; case missionTask.walkToEnd: walkToEnd(); break; } } } void freemode() { GTA.UI.Screen.ShowSubtitle("Find the ~b~ car ~w~ to reposess", 3000); if (Game.Player.Character.Position.DistanceTo(carPos) < 12f) { Task = missionTask.getInsideCar; } } void EnterTargetVehicle() { GTA.UI.Screen.ShowSubtitle("Get inside the vehicle"); if (Game.Player.Character.IsSittingInVehicle(TargetCar)) { carDestinationBlip = World.CreateBlip(new Vector3(-25.16854f, -1238.732f, 28.33501f)); carDestinationBlip.Color = BlipColor.Yellow; carDestinationBlip.ShowRoute = true; carDestinationBlip.Name = "Parking Lot"; Task = missionTask.goDestination; } } void goDestination() { if (carBlip.Exists()) { carBlip.Delete(); } GTA.UI.Screen.ShowSubtitle("Deliver the ~b~Car ~w~to its ~y~Destination", 4000); } void parkCar() { } void walkToEnd() { } void Initialize() { if (TargetCar == null) { TargetCar = World.CreateVehicle(new Model(409049982), carPos, -94.88273f); carBlip = TargetCar.AddBlip(); carBlip.Sprite = (BlipSprite)229; carBlip.Color = BlipColor.Blue; carBlip.Name = "Sport Car"; } introMissionRunning = true; Task = missionTask.freemode; walkDestinationPos = new Vector3(-82.88152f, -1240.195f, 28.09408f); carDestinationPos = new Vector3(-25.16854f, -1238.732f, 28.33501f); } void Deinitialize() { if (TargetCar != null) { TargetCar.Delete(); TargetCar = null; } if(carBlip != null) { carBlip.Delete(); carBlip = null; } if (carDestinationBlip != null) { carDestinationBlip.Delete(); carDestinationBlip = null; } introMissionRunning = false; }
}