public static Blip[] GetAllBlips(params BlipSprite[] blipTypes) { List <Blip> list = new List <Blip>(); if (blipTypes.Length == 0) { blipTypes = Enum.GetValues(typeof(BlipSprite)).Cast <BlipSprite>().ToArray <BlipSprite>(); } BlipSprite[] spriteArray = blipTypes; int index = 0; while (index < spriteArray.Length) { BlipSprite sprite = spriteArray[index]; InputArgument[] arguments = new InputArgument[] { sprite }; int handle = Function.Call <int>(Hash.GET_FIRST_BLIP_INFO_ID, arguments); while (true) { InputArgument[] argumentArray3 = new InputArgument[] { handle }; if (!Function.Call <bool>(Hash.DOES_BLIP_EXIST, argumentArray3)) { index++; break; } list.Add(new Blip(handle)); InputArgument[] argumentArray2 = new InputArgument[] { sprite }; handle = Function.Call <int>(Hash.GET_NEXT_BLIP_INFO_ID, argumentArray2); } } return(list.ToArray()); }
private void LoadIniFile() { try { this.Config = ScriptSettings.Load(this.f_Settings); this.modEnabled = (bool)this.Config.GetValue <bool>("SETTINGS", "modEnabled", (M0)1); this.reallifeDateTime = (bool)this.Config.GetValue <bool>("SETTINGS", "REALLIFE_DATETIME", (M0)0); this.displayArtificialHorizon = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_ARTIFICIAL_HORIZON", (M0)1); this.display3DRadar = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_3D_RADAR", (M0)1); this.displayMinimapRadar = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_MINIMAP_RADAR", (M0)1); this.displayMissileWarnSystem = (bool)this.Config.GetValue <bool>("SETTINGS", "DISPLAY_MISSILE_WARN_SYSTEM", (M0)1); this.staticArtificialHorizon = (bool)this.Config.GetValue <bool>("SETTINGS", "STATIC_ARTIFICIAL_HORIZON", (M0)0); this.gpsRefreshRate = (long)this.Config.GetValue <long>("SETTINGS", "GPS_REFRESH_RATE", (M0)500L); this.getAllVehiclesInterval = (long)this.Config.GetValue <long>("SETTINGS", "3D_RADAR_REFRESH_RATE", (M0)10000L); this.getAllPropsInterval = (long)this.Config.GetValue <long>("SETTINGS", "MISSILE_WARN_SYSTEM_REFRESH_RATE", (M0)100L); this.color_HUD = Color.FromArgb((int)this.Config.GetValue <int>("SETTINGS", "HUD_A", (M0)(int)byte.MaxValue), (int)this.Config.GetValue <int>("SETTINGS", "HUD_R", (M0)67), (int)this.Config.GetValue <int>("SETTINGS", "HUD_G", (M0)197), (int)this.Config.GetValue <int>("SETTINGS", "HUD_B", (M0)0)); this.xOffsetRight = float.Parse(((string)this.Config.GetValue <string>("SETTINGS", "XOFFSET_RIGHT_ELEMENTS", (M0)"0.0")).Replace(',', '.'), (IFormatProvider)CultureInfo.InvariantCulture); this.SupportedAircraftList = new List <string>((IEnumerable <string>)File.ReadAllLines(this.f_Aircrafts)); this.blipRadius = 10000f; this.airplaneSprite = (BlipSprite)423; this.helicopterSprite = (BlipSprite)422; this.BlipColor = (BlipColor)2; this.onlyShowAircraftWithDriver = true; } catch (Exception ex) { UI.Notify("~r~Error~w~:Failed to load JET HUD settings."); } }
/// <summary> /// Sets up all correctly configured PlayerPed /// </summary> private void SetupPlayerPeds() { foreach (UserIndex player in userIndices) { if (bool.Parse(PlayerSettings.GetValue(player, EnabledKey, false.ToString()))) { string guid = PlayerSettings.GetValue(player, ControllerKey, ""); foreach (InputManager input in InputManager.GetAvailableInputManagers()) { if (input.DeviceGuid.Equals(guid)) { InputManager manager = input; if (input is DirectInputManager) { manager = DirectInputManager.LoadConfig(((DirectInputManager)input).device, GetIniFile()); } PedHash characterHash = PlayerSettings.GetEnumValue <PedHash>(player, CharacterHashKey, PedHash.Trevor.ToString()); BlipSprite blipSprite = PlayerSettings.GetEnumValue <BlipSprite>(player, BlipSpriteKey, BlipSprite.Standard.ToString()); BlipColor blipColor = PlayerSettings.GetEnumValue <BlipColor>(player, BlipColorKey, BlipColor.Green.ToString()); PlayerPed playerPed = new PlayerPed(player, characterHash, blipSprite, blipColor, player1, manager); playerPeds.Add(playerPed); break; } } } } }
internal static Blip CreateBlip(this GTANetworkMethods.Blip blip, BlipSprite sprite, byte color, Vector3 position, float scale, string name = "", byte alpha = 255, float drawDistance = 0.0f, bool shortRange = false, short rotation = 0, uint dimension = 0) { return(NAPI.Blip.CreateBlip((uint)sprite, position, scale, color, name, alpha, drawDistance, shortRange, rotation, dimension)); }
void CreatePlayerSpawnBlip(int spawnIndex) { BlipSprite blipSprite = BlipSprite.Adversary10; switch (spawnIndex) { case 1: blipSprite = BlipSprite.Capture2; break; case 2: blipSprite = BlipSprite.Capture3; break; default: blipSprite = BlipSprite.Capture1; break; } Blip theNewBlip = World.CreateBlip(alliedSpawnPoints[spawnIndex]); theNewBlip.Sprite = blipSprite; theNewBlip.Scale = 0.9f; Function.Call(Hash.SET_BLIP_COLOUR, theNewBlip, GangManager.instance.PlayerGang.blipColor); Function.Call(Hash.BEGIN_TEXT_COMMAND_SET_BLIP_NAME, "STRING"); Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, string.Concat("Gang War: ", GangManager.instance.PlayerGang.name, " spawn point (", (spawnIndex + 1).ToString(), ")")); Function.Call(Hash.END_TEXT_COMMAND_SET_BLIP_NAME, theNewBlip); alliedSpawnBlips[spawnIndex] = theNewBlip; }
public static void Add(string name, Vector3 position, BlipSprite blipSprite) { var blip = World.CreateBlip(position); blip.Sprite = blipSprite; _blips.Add(name, blip); }
// Protected Konstruktor kann nur von sich selbst oder Subklassen benutzt werden // Subklassen müssen diesen Kontruktor benutzen wenn ihrer aufgerufen wird, da dies der einzige ist und Parameter besitzt protected Station(Vector3 position, BlipSprite iconSprite) { this.position = position; iconBlip = new Blip(position); iconBlip.Alpha = 0.0f; iconBlip.Scale = 0.8f; iconBlip.Sprite = iconSprite; }
public BlipData(Vector3 position, BlipSprite sprite, BlipCategory category, BlipColor color = BlipColor.White, bool isShortRange = true) { this.isEntityBlip = false; this.Position = position; this.Sprite = sprite; this.Color = color; this.IsShortRange = isShortRange; this.Category = category; Create(); }
// Spawn blip for Ped public static Blip SpawnPedBlip(Ped pedName, BlipSprite sprite, int blipColour, bool isEnemy) { // Add blip to ped pedName.AddBlip(); // Set blip colour Function.Call(Hash.SET_BLIP_COLOUR, pedName.CurrentBlip, blipColour); // Is ped an enemy Function.Call(Hash.SET_BLIP_AS_FRIENDLY, pedName.CurrentBlip, isEnemy); return(pedName.CurrentBlip); }
public BlipData(Entity entity, BlipSprite sprite, BlipCategory category, BlipColor color = BlipColor.White, bool isShortRange = true) { this.isEntityBlip = true; this.Entity = entity; this.Sprite = sprite; this.Color = color; this.IsShortRange = isShortRange; this.Category = category; Create(); }
public void CreateBlip( Color color, BlipSprite sprite = BlipSprite.Health, float scale = 0.25f) { RemoveBlip(); Blip = new Blip(EvidenceEntity); Blip.Sprite = sprite; Blip.Color = color; Blip.Scale = scale; }
public BuildableInventoryItem(int amount, int maxAmount, string id, string description, string propName, BlipSprite blipSprite, BlipColor blipColor, Vector3 groundOffset, bool interactable, bool isDoor, bool canBePickedUp) : base(amount, maxAmount, id, description) { PropName = propName; BlipSprite = blipSprite; BlipColor = blipColor; GroundOffset = groundOffset; Interactable = interactable; IsDoor = isDoor; CanBePickedUp = canBePickedUp; }
public static IEnumerable <BlipHandle> GetAllBlips(BlipSprite type) { BlipHandle h = Call <BlipHandle>(GET_FIRST_BLIP_INFO_ID, type); while (Exists(h)) { yield return(h); h = Call <BlipHandle>(GET_NEXT_BLIP_INFO_ID, type); } }
public static Blip CreateBlip(Vector3 _pos, BlipSprite _sprite, BlipColor _color, string _label, bool _isShortRange, float _scale = 0.75f) { Blip b = World.CreateBlip(_pos); b.Sprite = _sprite; b.Color = _color; b.IsShortRange = _isShortRange; b.Name = _label; b.Scale = _scale; return(b); }
private Blip CreateBlip(Vector3 position, BlipSprite sprite, BlipColor color, string name, bool shortRange = true, float scale = 0.86f) { var blip = World.CreateBlip(position); blip.Sprite = sprite; blip.Color = color; blip.IsShortRange = shortRange; blip.Name = name; blip.Scale = scale; return(blip); }
public BackupUnit(Vector3 position, float heading, BlipSprite blipSprite, string blipName, Color blipColor) { SpawnLocation = new RotatedVector3(position, heading); VehicleBlipSprite = blipSprite; VehicleBlipColor = blipColor; VehicleBlipName = blipName; ReCreate(); AI = new AIBackupUnitController(this); }
public NpcObject(string name, Ped ped) : base(ped.Handle) { BlipSprite = BlipSprite.SMG; Name = name; Ped = ped; QuestsToGive = new List <string>(); PersonalQuestLine = new List <string>(); QuestHandIns = new List <string>(); SideQuests = new List <string>(); QuestConditionChecks = new List <QuestConditionCheck>(); }
// Spawn a location blip public static Blip SpawnBlip(float loc1, float loc2, float loc3, BlipSprite sprite, int blipColour, bool showroute) { // Create blip at location Blip blip = World.CreateBlip(new Vector3(loc1, loc2, loc3)); // Set GPS route for blip on/off blip.ShowRoute = showroute; // Set colour of blip Function.Call(Hash.SET_BLIP_COLOUR, blip, blipColour); // Set colour of GPS route Function.Call(Hash.SET_BLIP_ROUTE_COLOUR, blip, blipColour); return(blip); }
public static void AddEmergencyBlipOn(Entity en, float scale, BlipSprite bs, string bn) { if (Main.NoBlipOnDispatch || !ThereIs(en)) { return; } en.AddBlip(); en.CurrentBlip.Scale = scale; en.CurrentBlip.Sprite = bs; en.CurrentBlip.Name = bn; en.CurrentBlip.IsShortRange = true; }
// Spawn blip for Prop public static Blip SpawnPropBlip(Prop propName, BlipSprite sprite, int blipColour, bool showroute) { // Add blip to vehicle propName.AddBlip(); // Give blip an icon propName.CurrentBlip.Sprite = sprite; // Set GPS route for blip on/off propName.CurrentBlip.ShowRoute = showroute; // Set colour of blip Function.Call(Hash.SET_BLIP_COLOUR, propName.CurrentBlip, blipColour); // Set colour of GPS route Function.Call(Hash.SET_BLIP_ROUTE_COLOUR, propName.CurrentBlip, blipColour); return(propName.CurrentBlip); }
public static void AddBlipOn(Entity en, float scale, BlipSprite bs, BlipColor bc, string bn) { if (Main.NoBlipOnCriminal || !ThereIs(en)) { return; } en.AddBlip(); en.CurrentBlip.Scale = scale; en.CurrentBlip.Sprite = bs; en.CurrentBlip.Color = bc; en.CurrentBlip.Name = bn; en.CurrentBlip.IsShortRange = true; }
public MapProp(string id, string propName, BlipSprite blipSprite, BlipColor blipColor, Vector3 groundOffset, bool interactable, bool isDoor, bool canBePickedUp, Vector3 rotation, Vector3 position, int handle, List <Weapon> weapons) { this.Id = id; this.PropName = propName; this.BlipSprite = blipSprite; this.BlipColor = blipColor; this.GroundOffset = groundOffset; this.Interactable = interactable; this.IsDoor = isDoor; this.CanBePickedUp = canBePickedUp; this.Rotation = rotation; this.Position = position; this.Handle = handle; this.Weapons = weapons; }
public MapProp(string id, string propName, BlipSprite blipSprite, BlipColor blipColor, Vector3 groundOffset, bool interactable, bool isDoor, bool canBePickedUp, Vector3 rotation, Vector3 position, int handle, List <Weapon> weapons) { Id = id; PropName = propName; BlipSprite = blipSprite; BlipColor = blipColor; GroundOffset = groundOffset; Interactable = interactable; IsDoor = isDoor; CanBePickedUp = canBePickedUp; Rotation = rotation; Position = position; Handle = handle; Weapons = weapons; }
public NpcObject(string name, PedHash modelName, Vector3 pos, float heading) : base(0) { BlipSprite = BlipSprite.SMG; Name = name; ModelName = modelName; Position = pos; Heading = heading; IsQuestNpc = true; Dialog = new DialogContainer(this); SimpleDialog = new List <string>(); Ped = null; QuestsToGive = new List <string>(); PersonalQuestLine = new List <string>(); QuestHandIns = new List <string>(); SideQuests = new List <string>(); QuestConditionChecks = new List <QuestConditionCheck>(); }
/// <summary> /// Constructs a new PlayerPed and sets all required properties /// </summary> /// <param name="userIndex">The UserIndex of this PlayerPed</param> /// <param name="characterHash">The PedHash off this PlayerPed</param> /// <param name="blipSprite">Any BlipSprite</param> /// <param name="blipColor">Any BlipColor</param> /// <param name="player1">The Player 1 Ped</param> /// <param name="input">InputManager instance</param> public PlayerPed(UserIndex userIndex, PedHash characterHash, BlipSprite blipSprite, BlipColor blipColor, Ped player1, InputManager input) { UserIndex = userIndex; CharacterHash = characterHash; Player1 = player1; Input = input; SetupPed(); foreach (PlayerPedAction action in Enum.GetValues(typeof(PlayerPedAction))) { lastActions[action] = Game.GameTime; } switch (blipColor) { case BlipColor.White: MarkerColor = Color.White; break; case BlipColor.Red: MarkerColor = Color.Red; break; case BlipColor.Green: MarkerColor = Color.Green; break; case BlipColor.Blue: MarkerColor = Color.Blue; break; case BlipColor.Yellow: MarkerColor = Color.Yellow; break; default: MarkerColor = Color.OrangeRed; break; } UpdateBlip(blipSprite, blipColor); }
protected void UpdateBlip(Player player, Ped ped, Blip blip) { BlipSprite currentSprite = blip.Sprite; BlipSprite sprite = BlipSprite.Standard; bool showHeading = true; if (ped.IsGettingIntoAVehicle) { if (ped.LastVehicle != null) { if (ped.LastVehicle.AttachedBlip != null) { ped.LastVehicle.AttachedBlip.Delete(); } } } if (ped.IsInVehicle()) { Vehicle vehicle = ped.CurrentVehicle; sprite = VehiclesBlips.Get(vehicle); showHeading = sprite == BlipSprite.Standard; //blip.Rotation = (int) vehicle.Heading; } else { sprite = BlipSprite.Standard; showHeading = true; } if (sprite != currentSprite) { blip.Sprite = sprite; } Function.Call(Hash._SET_BLIP_SHOW_HEADING_INDICATOR, blip, showHeading); }
/// <summary> /// OnAccept will be called when the player accepts the call. /// You must call base.OnAccept(args) to initialise the default properties /// </summary> protected void InitBlip(float circleRadius = 75f, BlipColor color = BlipColor.Yellow, BlipSprite sprite = BlipSprite.BigCircle, int alpha = 100) { Blip blip = World.CreateBlip(Location, circleRadius); Radius = circleRadius; Marker = blip; Marker.Sprite = sprite; Marker.Color = color; Marker.Alpha = alpha; }
public static Blip CreateBlip(Vector3 location, BlipSprite sprite, BlipColor color) { Blip blip = World.CreateBlip(location); blip.Sprite = sprite; blip.Color = color; blip.IsShortRange = true; return blip; }
public NpcObject(string name, PedHash modelName, Vector3 pos, float heading) : base(0) { BlipSprite = BlipSprite.SMG; Name = name; ModelName = modelName; Position = pos; Heading = heading; IsQuestNpc = true; Dialog = new DialogContainer(this); SimpleDialog = new List<string>(); Ped = null; QuestsToGive = new List<string>(); PersonalQuestLine = new List<string>(); QuestHandIns = new List<string>(); SideQuests = new List<string>(); QuestConditionChecks = new List<QuestConditionCheck>(); }
public NpcObject() { BlipSprite = BlipSprite.SMG; }
public NpcObject(string name, Ped ped) : base(ped.Handle) { BlipSprite = BlipSprite.SMG; Name = name; Ped = ped; }
/// <summary> /// OnAccept will be called when the player accepts the call. /// You must call base.OnAccept(args) to initialise the default properties /// </summary> protected void OnAccept(float circleRadius = 75f, BlipColor color = BlipColor.Yellow, BlipSprite sprite = BlipSprite.BigCircle, int alpha = 100) { int blipHandle = AddBlipForRadius(this.Location.X, this.Location.Y, this.Location.Z, circleRadius); this.Radius = circleRadius; this.Marker = new Blip(blipHandle); this.Marker.Sprite = sprite; this.Marker.Color = color; this.Marker.Alpha = alpha; }
//overload for future use - peds want to kill you private void add_ped_blip_sprite(int index, BlipSprite sprite) { _ped[index].CurrentBlip.Sprite = sprite; }
//adding blip sprite private void add_ped_blip_sprite(BlipSprite sprite) { for (int i = 0; i < _ped.Count; i++) { _ped[i].CurrentBlip.Sprite = sprite; } }
public WaitForBlip(BlipSprite kind, BlipHUDColor color, State next = null) : base(next) { Kind = kind; Color = color; }
public WeaponStorageInventoryItem(int amount, int maxAmount, string id, string description, string propName, BlipSprite blipSprite, BlipColor blipColor, Vector3 groundOffset, bool interactable, bool isDoor, bool canBePickedUp, List <Weapon> weaponsList) : base(amount, maxAmount, id, description, propName, blipSprite, blipColor, groundOffset, interactable, isDoor, canBePickedUp) { this.WeaponsList = weaponsList; }
public void SetBlip(BlipSprite sprite) { BlipSprite = sprite; }
public NpcObject(string name, PedHash modelName, Vector3 pos, float heading) : base(0) { BlipSprite = BlipSprite.SMG; Name = name; ModelName = modelName; Position = pos; Heading = heading; IsQuestNpc = true; Dialog = new DialogContainer(this); SimpleDialog = new List<string>(); Ped = null; }
public NpcObject(string name, Ped ped) : base(ped.Handle) { BlipSprite = BlipSprite.SMG; Name = name; Ped = ped; QuestsToGive = new List<string>(); PersonalQuestLine = new List<string>(); QuestHandIns = new List<string>(); SideQuests = new List<string>(); QuestConditionChecks = new List<QuestConditionCheck>(); }