From 07cb7e2f7bb7173cc1af195b7aa470aeb8aab95d Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Wed, 14 Apr 2021 23:36:02 +0200 Subject: [PATCH] BusJob change -> Get rest of the money on last checkpoint. --- ReallifeGamemode.Server/Job/BusDriverJob.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index 9060cd07..f7355388 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -33,9 +33,9 @@ namespace ReallifeGamemode.Server.Job public const uint VEHICLE_INTERMEDIATE = (uint)VehicleHash.Coach; public const uint VEHICLE_PROFESSIONAL = (uint)VehicleHash.Tourbus; - public const int WAGE_BEGINNER = 800; - public const int WAGE_INTERMEDIATE = 1200; - public const int WAGE_PROFESSIOAL = 1800; + public const int WAGE_BEGINNER = 400; + public const int WAGE_INTERMEDIATE = 600; + public const int WAGE_PROFESSIOAL = 800; public const string BEGINNER = "Anfänger"; public const string INTERMEDIATE = "Fortgeschrittener"; @@ -443,6 +443,14 @@ namespace ReallifeGamemode.Server.Job player.SendChatMessage("~y~[JOB]: ~w~Die neue Route lädt. Bitte warten..."); string type = getPlayerRouteType(player); + if (type == BEGINNER) + BusJobEvents.payWage(player, WAGE_BEGINNER); + else if (type == INTERMEDIATE) + BusJobEvents.payWage(player, WAGE_INTERMEDIATE); + else if (type == PROFESSIONAL) + BusJobEvents.payWage(player, WAGE_PROFESSIOAL); + + NAPI.Task.Run(() => { if (type == BEGINNER) @@ -466,6 +474,7 @@ namespace ReallifeGamemode.Server.Job NAPI.ClientEvent.TriggerClientEventForAll("SERVER:setIndicatorStatus", veh.Handle.Value, data.Left, data.Right); } + public void BusCheckpoint(Player player) { if (!player.IsInVehicle || player.VehicleSeat != 0) return; @@ -624,7 +633,7 @@ namespace ReallifeGamemode.Server.Job payWage(player, BusDriverJob.WAGE_PROFESSIOAL / BusDriverJob.playerRouteCurrent[player.Name].Count); } - private void payWage(Player player, int wage) + public static void payWage(Player player, int wage) { using var dbContext = new DatabaseContext(); User user = player.GetUser(dbContext);