Added tuning menu
This commit is contained in:
@@ -20,22 +20,28 @@ namespace reallife_gamemode.Server.Managers
|
||||
|
||||
ColShape colShape = NAPI.ColShape.CreateSphereColShape(pos1, 10, 0);
|
||||
|
||||
colShape.OnEntityEnterColShape += ColShape_OnEntityEnterColShape;
|
||||
colShape.OnEntityExitColShape += ColShape_OnEntityExitColShape;
|
||||
colShape.OnEntityEnterColShape += (cs, c) =>
|
||||
{
|
||||
if(c.IsInVehicle)
|
||||
{
|
||||
c.TriggerEvent("showTuningInfo");
|
||||
}
|
||||
};
|
||||
|
||||
colShape.OnEntityExitColShape += (cs, c) =>
|
||||
{
|
||||
c.TriggerEvent("hideTuningInfo");
|
||||
};
|
||||
|
||||
tuningGarages.Add(colShape);
|
||||
}
|
||||
|
||||
private static void ColShape_OnEntityExitColShape(ColShape colShape, Client client)
|
||||
[RemoteEvent("startPlayerTuning")]
|
||||
public void StartPlayerTuning(Client player)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput("exit colshape");
|
||||
client.TriggerEvent("hideTuningInfo");
|
||||
}
|
||||
if (!player.IsInVehicle) return;
|
||||
|
||||
private static void ColShape_OnEntityEnterColShape(ColShape colShape, Client client)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput("enter colshape");
|
||||
client.TriggerEvent("showTuningInfo");
|
||||
player.TriggerEvent("showTuningMenu");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user