-
-
Save OneMinuteYT/d42c5cd364e382cac5cb5ffbeb3ec51a to your computer and use it in GitHub Desktop.
Hospital Blips [.NET]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GTA; | |
using GTA.Native; | |
using GTA.Math; | |
using System; | |
using System.Windows.Forms; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Drawing; | |
using System.Media; | |
using NativeUI; | |
public class HospitalBlips : Script | |
{ | |
//All Blips | |
Blip Hospital1; | |
Blip Hospital2; | |
Blip Hospital3; | |
Blip Hospital4; | |
Blip Hospital5; | |
Blip Hospital6; | |
Blip Hospital7; | |
Blip Hospital8; | |
//All Blip Locations | |
Vector3 Hospital1Loc = new Vector3(296.713f, -1450.629f, 28.96661f); //Central Los Santos Medical Center | |
Vector3 Hospital2Loc = new Vector3(-450.0113f, -352.9503f, 33.50173f); //Mount Zonah Medical Center | |
Vector3 Hospital3Loc = new Vector3(357.3362f, -590.7087f, 27.78715f); //Pillbox Hill Medical Center | |
Vector3 Hospital4Loc = new Vector3(1841.933f, 3675.389f, 33.27562f); //Sandy Shores Medical Center | |
Vector3 Hospital5Loc = new Vector3(-679.3041f, 313.5576f, 82.08417f); //Eclipse Medical Tower | |
Vector3 Hospital6Loc = new Vector3(-249.6749f, 6331.075f, 31.42619f); //The Bay Care Center | |
Vector3 Hospital7Loc = new Vector3(1147.825f, -1527.752f, 34.38478f); //St. Fiacre Hospital | |
Vector3 Hospital8Loc = new Vector3(-874.4335f, -309.6683f, 38.53272f); //Portola Trinity Medical Center | |
public HospitalBlips() | |
{ | |
Tick += OnTick; | |
Aborted += OnAbort; | |
} | |
private void OnTick(object sender, EventArgs e) | |
{ | |
//Make Blip Exist if it doesn't | |
if (Hospital1 == null) | |
{ | |
Hospital1 = World.CreateBlip(Hospital1Loc); | |
if (Hospital1.Exists()) | |
{ | |
Hospital1.Sprite = BlipSprite.Hospital; | |
Hospital1.Color = BlipColor.White; | |
Hospital1.Name = "Hospital"; | |
Hospital1.ShowRoute = false; | |
Hospital1.IsShortRange = true; | |
} | |
} | |
if (Hospital2 == null) | |
{ | |
Hospital2 = World.CreateBlip(Hospital2Loc); | |
if (Hospital2.Exists()) | |
{ | |
Hospital2.Sprite = BlipSprite.Hospital; | |
Hospital2.Color = BlipColor.White; | |
Hospital2.Name = "Hospital"; | |
Hospital2.ShowRoute = false; | |
Hospital2.IsShortRange = true; | |
} | |
} | |
if (Hospital3 == null) | |
{ | |
Hospital3 = World.CreateBlip(Hospital3Loc); | |
if (Hospital3.Exists()) | |
{ | |
Hospital3.Sprite = BlipSprite.Hospital; | |
Hospital3.Color = BlipColor.White; | |
Hospital3.Name = "Hospital"; | |
Hospital3.ShowRoute = false; | |
Hospital3.IsShortRange = true; | |
} | |
} | |
if (Hospital4 == null) | |
{ | |
Hospital4 = World.CreateBlip(Hospital4Loc); | |
if (Hospital4.Exists()) | |
{ | |
Hospital4.Sprite = BlipSprite.Hospital; | |
Hospital4.Color = BlipColor.White; | |
Hospital4.Name = "Hospital"; | |
Hospital4.ShowRoute = false; | |
Hospital4.IsShortRange = true; | |
} | |
} | |
if (Hospital5 == null) | |
{ | |
Hospital5 = World.CreateBlip(Hospital5Loc); | |
if (Hospital5.Exists()) | |
{ | |
Hospital5.Sprite = BlipSprite.Hospital; | |
Hospital5.Color = BlipColor.White; | |
Hospital5.Name = "Hospital"; | |
Hospital5.ShowRoute = false; | |
Hospital5.IsShortRange = true; | |
} | |
} | |
if (Hospital6 == null) | |
{ | |
Hospital6 = World.CreateBlip(Hospital6Loc); | |
if (Hospital6.Exists()) | |
{ | |
Hospital6.Sprite = BlipSprite.Hospital; | |
Hospital6.Color = BlipColor.White; | |
Hospital6.Name = "Hospital"; | |
Hospital6.ShowRoute = false; | |
Hospital6.IsShortRange = true; | |
} | |
} | |
if (Hospital7 == null) | |
{ | |
Hospital7 = World.CreateBlip(Hospital7Loc); | |
if (Hospital7.Exists()) | |
{ | |
Hospital7.Sprite = BlipSprite.Hospital; | |
Hospital7.Color = BlipColor.White; | |
Hospital7.Name = "Hospital"; | |
Hospital7.ShowRoute = false; | |
Hospital7.IsShortRange = true; | |
} | |
} | |
if (Hospital8 == null) | |
{ | |
Hospital8 = World.CreateBlip(Hospital8Loc); | |
if (Hospital8.Exists()) | |
{ | |
Hospital8.Sprite = BlipSprite.Hospital; | |
Hospital8.Color = BlipColor.White; | |
Hospital8.Name = "Hospital"; | |
Hospital8.ShowRoute = false; | |
Hospital8.IsShortRange = true; | |
} | |
} | |
} | |
//Make Blips Remove if Scripts gets aborted (reloading scripts or script crash) | |
private void OnAbort(object sender, EventArgs e) | |
{ | |
if (Hospital1 != null) | |
{ | |
Hospital1.Remove(); | |
Hospital1 = null; | |
} | |
if (Hospital2 != null) | |
{ | |
Hospital2.Remove(); | |
Hospital2 = null; | |
} | |
if (Hospital3 != null) | |
{ | |
Hospital3.Remove(); | |
Hospital3 = null; | |
} | |
if (Hospital4 != null) | |
{ | |
Hospital4.Remove(); | |
Hospital4 = null; | |
} | |
if (Hospital5 != null) | |
{ | |
Hospital5.Remove(); | |
Hospital5 = null; | |
} | |
if (Hospital6 != null) | |
{ | |
Hospital6.Remove(); | |
Hospital6 = null; | |
} | |
if (Hospital7 != null) | |
{ | |
Hospital7.Remove(); | |
Hospital7 = null; | |
} | |
if (Hospital8 != null) | |
{ | |
Hospital8.Remove(); | |
Hospital8 = null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment