using GTANetworkAPI; using System.Collections.Generic; namespace reallife_gamemode.Server.Managers { class TuningManager : Script { private static List tuningGarages = new List(); /// /// Fügt eine Tuning-Garage zum Spiel hinzu /// /// Die Position der Garage public static void AddTuningGarage(Vector3 pos) { ColShape colShape = NAPI.ColShape.CreateSphereColShape(pos, 10, 0); colShape.OnEntityEnterColShape += (cs, c) => { if(c.IsInVehicle) { c.TriggerEvent("showTuningInfo"); } }; colShape.OnEntityExitColShape += (cs, c) => { c.TriggerEvent("hideTuningInfo", true); }; tuningGarages.Add(colShape); } [RemoteEvent("startPlayerTuning")] public void StartPlayerTuning(Client player) { if (!player.IsInVehicle) return; player.TriggerEvent("showTuningMenu"); } [RemoteEvent("setVehicleMod")] public void SetVehicleMod(Client player, int slot, int index) { if (index == 0) index--; player.Vehicle.SetMod(slot, index - 1); } } }