Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using GTA;
- using GTA.Native;
- namespace TrackersV
- {
- public class TrackersV : Script
- {
- List<Entity> entityList = new List<Entity>();
- List<Entity> allEntityList = new List<Entity>();
- List<Blip> blipList = new List<Blip>();
- public TrackersV()
- {
- KeyDown += OnKeyDown;
- Tick += TrackersV_Tick;
- }
- private void addBlips()
- {
- foreach (Entity trackedEntity in allEntityList)
- {
- BlipColor blipColor;
- if (Game.Player.Character.Model == PedHash.Michael)
- {
- blipColor = BlipColor.Michael;
- }
- else if (Game.Player.Character.Model == PedHash.Franklin)
- {
- blipColor = BlipColor.Franklin;
- }
- else if (Game.Player.Character.Model == PedHash.Trevor)
- {
- blipColor = BlipColor.Trevor;
- }
- else
- {
- blipColor = BlipColor.Freemode;
- }
- List<GTA.Math.Vector3> blipPositions = new List<GTA.Math.Vector3>();
- foreach (Blip blip in World.GetActiveBlips())
- {
- blipPositions.Add(blip.Position);
- }
- if (trackedEntity.Exists() && !trackedEntity.CurrentBlip.Exists() && entityList.Contains(trackedEntity))
- {
- Blip newBlip = trackedEntity.AddBlip();
- newBlip.Color = blipColor;
- newBlip.Name = trackedEntity.Model.ToString();
- newBlip.IsShortRange = false;
- newBlip.IsFlashing = true;
- newBlip.ShowRoute = true;
- newBlip.Scale = 1;
- } else if (trackedEntity.CurrentBlip.Exists() && !entityList.Contains(trackedEntity))
- {
- trackedEntity.CurrentBlip.Remove();
- }
- }
- }
- private void TrackersV_Tick(object sender, EventArgs e)
- {
- addBlips();
- }
- private void OnKeyDown(object source, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.J)
- {
- AddEntity();
- }
- }
- private void AddEntity()
- {
- Entity Target = Game.Player.GetTargetedEntity();
- if (Target != null && Target.Exists())
- {
- if (!entityList.Contains(Target))
- {
- entityList.Add(Target);
- allEntityList.Add(Target);
- } else
- {
- entityList.Remove(Target);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement