Begin tuning system

This commit is contained in:
hydrant
2018-10-21 21:45:11 +02:00
parent 604229210e
commit 618c8cba28
5 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using GTANetworkAPI;
using reallife_gamemode.Server.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace reallife_gamemode.Server.Managers
{
class TuningManager : Script
{
private static List<ColShape> tuningGarages = new List<ColShape>();
public static void AddTuningGarage(Vector3 pos1, Vector3 pos2)
{
// DEBUG
NAPI.TextLabel.CreateTextLabel("Pos1", pos1, 100, 1, 0, new Color(255, 255, 255), true, 0);
NAPI.TextLabel.CreateTextLabel("Pos2", pos2, 100, 1, 0, new Color(255, 255, 255), true, 0);
ColShape colShape = NAPI.ColShape.CreateSphereColShape(pos1, 10, 0);
colShape.OnEntityEnterColShape += ColShape_OnEntityEnterColShape;
colShape.OnEntityExitColShape += ColShape_OnEntityExitColShape;
tuningGarages.Add(colShape);
}
private static void ColShape_OnEntityExitColShape(ColShape colShape, Client client)
{
NAPI.Util.ConsoleOutput("exit colshape");
client.TriggerEvent("hideTuningInfo");
}
private static void ColShape_OnEntityEnterColShape(ColShape colShape, Client client)
{
NAPI.Util.ConsoleOutput("enter colshape");
client.TriggerEvent("showTuningInfo");
}
}
}