Advertisement
Guest User

New Code

a guest
Apr 23rd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. using GTA;
  8. using GTA.Native;
  9.  
  10. namespace TrackersV
  11. {
  12.     public class TrackersV : Script
  13.     {
  14.         public TrackersV()
  15.         {
  16.             KeyDown += OnKeyDown;
  17.         }
  18.  
  19.         private void OnKeyDown(object source, KeyEventArgs e)
  20.         {
  21.             if (e.KeyCode == Keys.J)
  22.             {
  23.                 AddPlayerBlip();
  24.             }
  25.         }
  26.  
  27.         private void AddPlayerBlip()
  28.         {
  29.             Entity Target;
  30.             Target = Game.Player.GetTargetedEntity();
  31.             if (Target.Exists())
  32.             {
  33.                 if (Target.CurrentBlip == null)
  34.                 {
  35.                     BlipColor blipColor;
  36.                     if (Game.Player.Character.Model == PedHash.Michael)
  37.                     {
  38.                         blipColor = BlipColor.Michael;
  39.                     }
  40.                     else if (Game.Player.Character.Model == PedHash.Franklin)
  41.                     {
  42.                         blipColor = BlipColor.Franklin;
  43.                     }
  44.                     else if (Game.Player.Character.Model == PedHash.Trevor)
  45.                     {
  46.                         blipColor = BlipColor.Trevor;
  47.                     }
  48.                     else
  49.                     {
  50.                         blipColor = BlipColor.Freemode;
  51.                     }
  52.                     Blip newBlip = Target.AddBlip();
  53.                     newBlip.Sprite = BlipSprite.BigCircle;
  54.                     newBlip.Color = blipColor;
  55.                     newBlip.Name = Target.Model.ToString();
  56.                 }
  57.                 else
  58.                 {
  59.                     Target.CurrentBlip.Remove();
  60.                 }
  61.             }
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement