From 222a9832b1f25fec7546e3fb8e39f6c2b6ee1779 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 2 May 2021 23:21:35 +0200 Subject: [PATCH] rentcar blips und sowas halt --- ReallifeGamemode.Client/util/rentcar.ts | 10 +++++----- ReallifeGamemode.Server/Managers/PositionManager.cs | 12 ++++++------ ReallifeGamemode.Server/Util/Rentcar.cs | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ReallifeGamemode.Client/util/rentcar.ts b/ReallifeGamemode.Client/util/rentcar.ts index 68955ba2..9fdc039c 100644 --- a/ReallifeGamemode.Client/util/rentcar.ts +++ b/ReallifeGamemode.Client/util/rentcar.ts @@ -48,7 +48,7 @@ export default function rentCar(globalData: IGlobalData) { } rentcarMenu = new Menu("Fahrzeugverleih", "", new Point(0, screenRes.y / 3), null, null); - rentcarMenu.AddItem(new UIMenuListItem("Fahrzeug", vehiclePrices[0] + "$ alle 5 Minuten", new ItemsCollection(vehicleNames))); + rentcarMenu.AddItem(new UIMenuListItem("Fahrzeug", "$" + vehiclePrices[0] + " alle 5 Minuten", new ItemsCollection(vehicleNames))); rentcarMenu.AddItem(sendItem); rentcarMenu.AddItem(cancelItem); @@ -60,7 +60,7 @@ export default function rentCar(globalData: IGlobalData) { rentcarMenu.ListChange.on((item: NativeUI.UIMenuListItem, index) => { switch (item.Text) { case "Fahrzeug": - item.Description = vehiclePrices[index] + "$ alle 5 Minuten"; + item.Description = "$" + vehiclePrices[index] + "$ alle 5 Minuten"; selectedIndex = index; //item.Description = item.SelectedValue; break; @@ -84,15 +84,15 @@ export default function rentCar(globalData: IGlobalData) { }); mp.events.add('triggerRentcarTimer', (interval, pricePerInterval) => { + totalBill = pricePerInterval; + mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime); clearInterval(payTimer); payTimer = setInterval(() => { totalTime += interval; totalBill += pricePerInterval; - if (totalTime != 0) { - mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime); - } + mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime); }, interval * 1000); }); diff --git a/ReallifeGamemode.Server/Managers/PositionManager.cs b/ReallifeGamemode.Server/Managers/PositionManager.cs index 7fca7348..1bbf0a4b 100644 --- a/ReallifeGamemode.Server/Managers/PositionManager.cs +++ b/ReallifeGamemode.Server/Managers/PositionManager.cs @@ -329,17 +329,17 @@ namespace ReallifeGamemode.Server.Managers rentcarPoints.Add(rentCarStadthalle); rentcarPoints.Add(rentCarKnast); - foreach (RentcarPoint j in rentcarPoints) + foreach (RentcarPoint point in rentcarPoints) { - NAPI.Marker.CreateMarker(1, new Vector3(j.Position.X, j.Position.Y, j.Position.Z - 2), new Vector3(j.Position.X, j.Position.Y, j.Position.Z + 1), + NAPI.Marker.CreateMarker(1, new Vector3(point.Position.X, point.Position.Y, point.Position.Z - 2), new Vector3(point.Position.X, point.Position.Y, point.Position.Z + 1), new Vector3(0, 0, 0), 1.5f, new Color(255, 255, 255, 50), false, 0); - NAPI.TextLabel.CreateTextLabel("~y~Fahrzeugverleih\n~w~Drücke ~b~E~w~ um ein Fahrzeug zu mieten", j.Position, 7, 1, 0, new Color(255, 255, 255), false, 0); + NAPI.TextLabel.CreateTextLabel("~y~Fahrzeugverleih\n~w~Drücke ~b~E~w~ um ein Fahrzeug zu mieten", point.Position, 7, 1, 0, new Color(255, 255, 255), false, 0); + + NAPI.Blip.CreateBlip(739, new Vector3(point.Position.X, point.Position.Y, point.Position.Z), (float)0.7, 11, "Fahrzeugvermietung", 255, 200, true, 0, 0); } - - - #endregion RentCar } + #endregion RentCar [RemoteEvent("sendClientToStage")] public void ElevatorSendToStage(Player player, string level) { diff --git a/ReallifeGamemode.Server/Util/Rentcar.cs b/ReallifeGamemode.Server/Util/Rentcar.cs index 97f8a2fe..0375f413 100644 --- a/ReallifeGamemode.Server/Util/Rentcar.cs +++ b/ReallifeGamemode.Server/Util/Rentcar.cs @@ -13,7 +13,7 @@ namespace ReallifeGamemode.Server.Util class Rentcar : Script { //In Sekunden - public static int PAY_TIMER = 300; + public static int PAY_TIMER = 30; //In Stunden private static int PAYTIME_FREE = 30; @@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Util player.SetData("hasRentcar", false); player.TriggerEvent("abortRentcarTimer"); - player.SendChatMessage("Fahrzeugmiete erfolgreich gekündigt. Kosten: ~g~" + mapPlayerRentcarBill[player.Name].Item2 + "$"); + player.SendChatMessage("Fahrzeugmiete erfolgreich gekündigt. Kosten: ~g~$" + mapPlayerRentcarBill[player.Name].Item2); VehicleManager.DeleteVehicle(mapPlayerRentcarBill[player.Name].Item1); Rentcar.mapPlayerRentcarBill.Remove(player.Name); } @@ -90,7 +90,7 @@ namespace ReallifeGamemode.Server.Util return; } - player.TriggerEvent("BN_Show", "Fahrzeug seit ~b~" + time + "~w~ Sekunden gemietet. Gesamtkosten: ~g~" + bill + "$"); + player.TriggerEvent("BN_Show", "Fahrzeug seit ~b~" + time + "~w~ Sekunden gemietet. Gesamtkosten: ~g~$" + bill); mapPlayerRentcarBill[player.Name] = (mapPlayerRentcarBill[player.Name].Item1, bill); } @@ -99,7 +99,7 @@ namespace ReallifeGamemode.Server.Util { if (player.GetData("hasRentcar") == true) { - ChatService.ErrorMessage(player, "Du hast bereits ein Fahrzeug gemeietet"); + ChatService.ErrorMessage(player, "Du hast bereits ein Fahrzeug gemietet. Mit '/rent stop' kündigst du die Miete"); return; }