예제 #1
0
        public void UpdateTreeText()
        {
            if (TreeText != null && API.Shared.DoesEntityExist(TreeText))
            {
                API.Shared.DeleteEntity(TreeText);
            }

            if (TreeMarker == null)
            {
                TreeMarker                = new MarkerZone(TreePos.Add(new Vector3(1, 0, -0.5)), TreeRot, 0);
                TreeMarker.MarkerType     = 1;
                TreeMarker.MarkerColor[2] = 0;
                TreeMarker.MarkerScale    = new Vector3(1, 1, 1);
                TreeMarker.UseColZone     = false;
                TreeMarker.UseBlip        = false;
                TreeMarker.UseText        = false;
                TreeMarker.Create();
            }

            switch (Stage)
            {
            case Stages.Processing:
                TreeText            = API.Shared.CreateTextLabel("~g~Hit the tree to process it. ~n~" + ProcessPercentage + "%", TreePos, 10f, 1f, 1, new GTANetworkAPI.Color(1, 1, 1), true);
                TreeMarker.Location = TreePos;
                TreeMarker.Refresh();
                API.Shared.AttachEntityToEntity(TreeText, TreeObj, "0", new Vector3(1, 1, 1.5), new Vector3());
                API.Shared.AttachEntityToEntity(TreeMarker.Marker, TreeObj, "0", new Vector3(1, 0, 1.5), new Vector3(-90, 0, 0));
                break;

            case Stages.Cutting:
                TreeText            = API.Shared.CreateTextLabel("~g~" + CutPercentage + "% Cut.~n~Tree", TreePos, 10f, 1f, 1, new GTANetworkAPI.Color(1, 1, 1), true);
                TreeMarker.Location = TreePos;
                TreeMarker.Refresh();
                API.Shared.AttachEntityToEntity(TreeText, TreeObj, "0", new Vector3(1, 0, 1), new Vector3());
                API.Shared.AttachEntityToEntity(TreeMarker.Marker, TreeObj, "0", new Vector3(1, 0, 0), new Vector3());
                break;

            case Stages.Waiting:
                TreeText            = API.Shared.CreateTextLabel("~g~Waiting to be picked, use /pickupwood with a Flatbed.", TreePos, 10f, 1f, 1, new GTANetworkAPI.Color(1, 1, 1), true);
                TreeMarker.Location = TreePos;
                TreeMarker.Refresh();
                API.Shared.AttachEntityToEntity(TreeText, TreeObj, "0", new Vector3(1, 0, 1), new Vector3());
                API.Shared.AttachEntityToEntity(TreeMarker.Marker, TreeObj, "0", new Vector3(1, 0, 0), new Vector3());
                break;

            default:
                TreeText = null;
                TreeMarker.Destroy();
                break;
            }
        }
예제 #2
0
 public VehicleDealership()
 {
     //Setup the blip.
     foreach (var loc in _dealershipsLocations)
     {
         var marker = new MarkerZone(loc, new Vector3())
         {
             BlipSprite = 100, TextLabelText = "/buyvehicle"
         };
         marker.Create();
         API.Shared.SetBlipShortRange(marker.Blip, true);
         API.Shared.SetBlipName(marker.Blip, "Vehicle Dealership");
         _markerZones.Add(marker);
     }
 }
예제 #3
0
 public ChopperDealership()
 {
     //Setup the blip.
     foreach (var loc in _dealershipsLocations)
     {
         var marker = new MarkerZone(loc, new Vector3())
         {
             BlipSprite = 43, TextLabelText = "/buychopper", BlipColor = 46
         };
         marker.Create();
         API.Shared.SetBlipShortRange(marker.Blip, true);
         API.Shared.SetBlipName(marker.Blip, "Chopper Dealership");
         API.Shared.SetBlipColor(marker.Blip, 46);
         _markerZones.Add(marker);
     }
 }
예제 #4
0
        public BoatDealership()
        {
            Event.OnClientEventTrigger += API_onClientEventTrigger;

            //Setup the blip.
            foreach (var loc in _dealershipsLocations)
            {
                var marker = new MarkerZone(loc, new Vector3())
                {
                    BlipSprite = 371, TextLabelText = "/buyboat /buyrod"
                };
                marker.Create();
                API.Shared.SetBlipShortRange(marker.Blip, true);
                API.Shared.SetBlipName(marker.Blip, "Boat Dealership");
                _markerZones.Add(marker);
            }
        }
예제 #5
0
        public void CreateProperty()
        {
            EntranceString = OwnerId == 0
                ? $"Unowned. /buyproperty to buy it.\nCosts ~g~${PropertyPrice}~w~"
                : PropertyName;

            EntranceMarker = new MarkerZone(EntrancePos, EntranceRot, EntranceDimension)
            {
                TextLabelText = EntranceString + "\n" + Type + "\n" + "ID: " + Id,
                BlipSprite    = GetBlip(),
                UseBlip       = true
            };
            EntranceMarker.Create();
            EntranceMarker.ColZone.setData("property_entrance", Id);
            if (API.Shared.DoesEntityExist(EntranceMarker.Blip))
            {
                API.Shared.SetBlipShortRange(EntranceMarker.Blip, true);
                API.Shared.SetBlipName(EntranceMarker.Blip, PropertyName);
            }

            if (IsInteractable && InteractionPos != null && InteractionPos != new Vector3())
            {
                if (Type != PropertyManager.PropertyTypes.GasStation)
                {
                    InteractionMarker = new MarkerZone(InteractionPos ?? new Vector3(), InteractionRot ?? new Vector3(), InteractionDimension)
                    {
                        TextLabelText = PropertyManager.GetInteractText(Type)
                    };
                }
                else
                {
                    InteractionMarker = new MarkerZone(InteractionPos ?? new Vector3(), InteractionRot ?? new Vector3(), InteractionDimension)
                    {
                        ColZoneSize   = 10f,
                        TextLabelText = PropertyManager.GetInteractText(Type)
                    };
                }
                InteractionMarker.Create();
                InteractionMarker.ColZone.setData("property_interaction", Id);
            }

            if (IsTeleportable && TargetPos != null && TargetPos != new Vector3())
            {
                ExitMarker = new MarkerZone(TargetPos ?? new Vector3(), TargetRot ?? new Vector3(), TargetDimension)
                {
                    TextLabelText = "/exit"
                };
                ExitMarker.Create();
                ExitMarker.ColZone.setData("property_exit", Id);
            }

            if (HasGarbagePoint)
            {
                if (BinObject != null)
                {
                    API.Shared.DeleteEntity(BinObject);
                }
                BinObject     = null;
                GarbageMarker = new MarkerZone(GarbagePoint + new Vector3(0, 0, 1.2), new Vector3(0, 0, 0), GarbageDimension)
                {
                    ColZoneSize   = 10f,
                    UseMarker     = false,
                    TextLabelText = $"{PropertyName}'s Garbage\nBags: {GarbageBags}/40\n/pickuptrash"
                };
                GarbageMarker.Create();
                GarbageMarker.ColZone.setData("property_garbage", Id);
                BinObject = API.Shared.CreateObject(998415499, GarbagePoint - new Vector3(0, 0, 1.1), GarbageRotation, GarbageDimension);
            }
        }