rentcar blips und sowas halt

This commit is contained in:
Fabian
2021-05-02 23:21:35 +02:00
parent 9935e40d66
commit 222a9832b1
3 changed files with 15 additions and 15 deletions

View File

@@ -48,7 +48,7 @@ export default function rentCar(globalData: IGlobalData) {
} }
rentcarMenu = new Menu("Fahrzeugverleih", "", new Point(0, screenRes.y / 3), null, null); 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(sendItem);
rentcarMenu.AddItem(cancelItem); rentcarMenu.AddItem(cancelItem);
@@ -60,7 +60,7 @@ export default function rentCar(globalData: IGlobalData) {
rentcarMenu.ListChange.on((item: NativeUI.UIMenuListItem, index) => { rentcarMenu.ListChange.on((item: NativeUI.UIMenuListItem, index) => {
switch (item.Text) { switch (item.Text) {
case "Fahrzeug": case "Fahrzeug":
item.Description = vehiclePrices[index] + "$ alle 5 Minuten"; item.Description = "$" + vehiclePrices[index] + "$ alle 5 Minuten";
selectedIndex = index; selectedIndex = index;
//item.Description = item.SelectedValue; //item.Description = item.SelectedValue;
break; break;
@@ -84,15 +84,15 @@ export default function rentCar(globalData: IGlobalData) {
}); });
mp.events.add('triggerRentcarTimer', (interval, pricePerInterval) => { mp.events.add('triggerRentcarTimer', (interval, pricePerInterval) => {
totalBill = pricePerInterval;
mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime);
clearInterval(payTimer); clearInterval(payTimer);
payTimer = setInterval(() => { payTimer = setInterval(() => {
totalTime += interval; totalTime += interval;
totalBill += pricePerInterval; totalBill += pricePerInterval;
if (totalTime != 0) {
mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime); mp.events.callRemote("SERVER:updateRentCarBill", totalBill, totalTime);
}
}, interval * 1000); }, interval * 1000);
}); });

View File

@@ -329,17 +329,17 @@ namespace ReallifeGamemode.Server.Managers
rentcarPoints.Add(rentCarStadthalle); rentcarPoints.Add(rentCarStadthalle);
rentcarPoints.Add(rentCarKnast); 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); 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")] [RemoteEvent("sendClientToStage")]
public void ElevatorSendToStage(Player player, string level) public void ElevatorSendToStage(Player player, string level)
{ {

View File

@@ -13,7 +13,7 @@ namespace ReallifeGamemode.Server.Util
class Rentcar : Script class Rentcar : Script
{ {
//In Sekunden //In Sekunden
public static int PAY_TIMER = 300; public static int PAY_TIMER = 30;
//In Stunden //In Stunden
private static int PAYTIME_FREE = 30; private static int PAYTIME_FREE = 30;
@@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Util
player.SetData("hasRentcar", false); player.SetData("hasRentcar", false);
player.TriggerEvent("abortRentcarTimer"); 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); VehicleManager.DeleteVehicle(mapPlayerRentcarBill[player.Name].Item1);
Rentcar.mapPlayerRentcarBill.Remove(player.Name); Rentcar.mapPlayerRentcarBill.Remove(player.Name);
} }
@@ -90,7 +90,7 @@ namespace ReallifeGamemode.Server.Util
return; 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); mapPlayerRentcarBill[player.Name] = (mapPlayerRentcarBill[player.Name].Item1, bill);
} }
@@ -99,7 +99,7 @@ namespace ReallifeGamemode.Server.Util
{ {
if (player.GetData<bool>("hasRentcar") == true) if (player.GetData<bool>("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; return;
} }