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

@@ -18,6 +18,8 @@ namespace ReallifeGamemode.Server.Business
public override float CarSpawnHeading => 356.6f; public override float CarSpawnHeading => 356.6f;
public override int? BlipSprite => 307;
public override void Load() public override void Load()
{ {

View File

@@ -17,6 +17,8 @@ namespace ReallifeGamemode.Server.Business
public override float CarSpawnHeading => 356.6f; public override float CarSpawnHeading => 356.6f;
public override int? BlipSprite => 226;
public override void Load() public override void Load()
{ {

View File

@@ -17,6 +17,8 @@ namespace ReallifeGamemode.Server.Business
public override float CarSpawnHeading => 356.6f; public override float CarSpawnHeading => 356.6f;
public override int? BlipSprite => 410;
public override void Load() public override void Load()
{ {

View File

@@ -1,4 +1,4 @@
using GTANetworkAPI; using GTANetworkAPI;
using ReallifeGamemode.Server.Entities; using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Models; using ReallifeGamemode.Server.Models;
@@ -11,8 +11,13 @@ namespace ReallifeGamemode.Server.Business
{ {
private TextLabel _informationLabel; private TextLabel _informationLabel;
private ColShape _colShape; private ColShape _colShape;
private Blip _blip;
private Marker _marker;
public virtual int? BlipSprite { get; } = null;
public abstract int Id { get; } public abstract int Id { get; }
public abstract string Name { get; } public abstract string Name { get; }
public abstract Vector3 Position { get; } public abstract Vector3 Position { get; }
@@ -35,7 +40,12 @@ namespace ReallifeGamemode.Server.Business
public void Setup() 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)); _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 = NAPI.ColShape.CreateSphereColShape(Position.Subtract(new Vector3(0, 0, 1.5)), 3f);
_colShape.OnEntityEnterColShape += EntityEnterBusinessColShape; _colShape.OnEntityEnterColShape += EntityEnterBusinessColShape;

View File

@@ -9,5 +9,7 @@ namespace ReallifeGamemode.Server.Business
{ {
public abstract Vector3 CarSpawnPositon { get; } public abstract Vector3 CarSpawnPositon { get; }
public abstract float CarSpawnHeading { get; } public abstract float CarSpawnHeading { get; }
public override int? BlipSprite => 225;
} }
} }

View File

@@ -17,6 +17,8 @@ namespace ReallifeGamemode.Server.Business
public override float CarSpawnHeading => 356.6f; public override float CarSpawnHeading => 356.6f;
public override int? BlipSprite => 43;
public override void Load() public override void Load()
{ {