42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|