Added tuning menu

This commit is contained in:
hydrant
2018-10-22 21:42:33 +02:00
parent 618c8cba28
commit 15e1e52b67
3 changed files with 142 additions and 11 deletions

View File

@@ -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");
}
}
}