blips for dealerships

This commit is contained in:
hydrant
2019-09-08 14:28:16 +02:00
parent 7bcc72e3cf
commit 76b97c4925
6 changed files with 22 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
using GTANetworkAPI;
using GTANetworkAPI;
using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Models;
@@ -11,8 +11,13 @@ namespace ReallifeGamemode.Server.Business
{
private TextLabel _informationLabel;
private ColShape _colShape;
private Blip _blip;
private Marker _marker;
public virtual int? BlipSprite { get; } = null;
public abstract int Id { get; }
public abstract string Name { get; }
public abstract Vector3 Position { get; }
@@ -35,7 +40,12 @@ namespace ReallifeGamemode.Server.Business
public void Setup()
{
_informationLabel = NAPI.TextLabel.CreateTextLabel(Name, Position.Add(new Vector3(0, 0, 0.5)), 20.0f, 1.3f, 0, new Color(255, 255, 255));
NAPI.Marker.CreateMarker(MarkerType.VerticalCylinder, Position.Subtract(new Vector3(0, 0, 1.5)), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255));
_marker = NAPI.Marker.CreateMarker(MarkerType.VerticalCylinder, Position.Subtract(new Vector3(0, 0, 1.5)), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255));
if (BlipSprite != null)
{
_blip = NAPI.Blip.CreateBlip(BlipSprite.Value, Position, 1f, 4, Name, shortRange: true);
}
_colShape = NAPI.ColShape.CreateSphereColShape(Position.Subtract(new Vector3(0, 0, 1.5)), 3f);
_colShape.OnEntityEnterColShape += EntityEnterBusinessColShape;