Example #1
0
 public static void DeleteZoneMp()
 {
     if (BlipMp == null)
     {
         return;
     }
     BlipMp.Delete();
     BlipMp = null;
 }
Example #2
0
 public static void CreateZoneMp(float x, float y, float z, int radius)
 {
     DeleteZoneMp();
     BlipMp              = World.CreateBlip(new Vector3(x, y, z));
     BlipMp.Sprite       = (BlipSprite)10;
     BlipMp.Color        = (BlipColor)57;
     BlipMp.Name         = "Мероприятие";
     BlipMp.IsShortRange = true;
     BlipMp.Scale        = radius / 10f;
 }
Example #3
0
        public static void Create(Vector3 pos, int sprite = 1, int color = 59, string name = "Работа", float size = 0.8f)
        {
            Delete();

            LocallyBlip              = World.CreateBlip(pos);
            LocallyBlip.Sprite       = (BlipSprite)sprite;
            LocallyBlip.Color        = (BlipColor)color;
            LocallyBlip.Name         = name;
            LocallyBlip.IsShortRange = true;
            LocallyBlip.Scale        = size;
        }
Example #4
0
 public Blip AttachBlip()
 {
     return(Blip.AddBlip(this));
 }
Example #5
0
        private static void AddMarker(string _markerKey, string _markerName, string _markerActionType, Vector3 _markerPos, string _markerType, Dictionary <string, object> _markerData, string _markerColor, string _markerWaypointColor)
        {
            Utils.WriteLine($"Adding Marker[{_markerKey}]");
            MarkerType markerType = MarkerType.VerticalCylinder;
            BlipColor  blipColor  = BlipColor.Green;

            switch (_markerColor)
            {
            case "Green":
                blipColor = BlipColor.Green;
                break;

            default:
                break;
            }

            switch (_markerWaypointColor)
            {
            case "Green":
                blipColor = BlipColor.Green;
                break;

            default:
                break;
            }

            CitizenFX.Core.Blip MarkerBlip = World.CreateBlip(_markerPos);
            MarkerBlip.Color        = blipColor;
            MarkerBlip.IsShortRange = true;
            MarkerBlip.Name         = _markerName;

            /*//Get the 3D marker type of the marker (ie. VerticalCylinder)
             * foreach (MarkerType mt in Enum.GetValues(typeof(MarkerType)))
             * {
             *  if (mt.ToString() == _markerType)
             *  {
             *      markerType = mt;
             *  }
             * }*/

            object markerData = null;
            string stringPos  = "";

            if (_markerData != null)
            {
                foreach (var v in _markerData)
                {
                    if (v.Key.ToLower().Contains("position"))
                    {
                        stringPos += v.Value + ",";
                    }
                    else if (v.Key.ToLower().Contains("vehicles"))
                    {
                        markerData = v.Value;
                    }
                    else if (v.Key.ToLower().Contains("markerteleport"))
                    {
                        markerData = v.Value;
                    }
                }
            }

            if (_markerActionType.ToLower() == "cardealermarker")
            {
                if (stringPos != "")
                {
                    string[] stringArr    = stringPos.Split(',');
                    Vector3  dataPosition = new Vector3(int.Parse(stringArr[0]), int.Parse(stringArr[1]), int.Parse(stringArr[2]));
                    AddMarker(_markerKey + "_sell", "Sell Vehicle", "SellVehicleMarker", dataPosition, _markerType, null, _markerColor, _markerWaypointColor);
                }
            }
            else
            {
                if (stringPos != "")
                {
                    string[] stringArr    = stringPos.Split(',');
                    Vector3  dataPosition = new Vector3(int.Parse(stringArr[0]), int.Parse(stringArr[1]), int.Parse(stringArr[2]));
                    markerData = dataPosition;
                }
            }

            Marker newMarker = new Marker(_markerKey, _markerName, _markerPos, _markerType, _markerActionType, markerData);

            MarkerList.Add(newMarker);
        }