@@ -1,8 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using GTANetworkAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Log;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
|
||||
@@ -15,8 +17,12 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
private static ColShape _colShape1;
|
||||
public static Vector3 Position { get; }
|
||||
|
||||
private static readonly ILogger logger = LogManager.GetLogger<PlaneSchool>();
|
||||
|
||||
private const int CHECKPOINT_MARKER_ID = 6;
|
||||
|
||||
private const int PLANE_LICENSE_PRICE = 5000;
|
||||
|
||||
private readonly IReadOnlyCollection<Vector3> planeRoute = new List<Vector3>
|
||||
{
|
||||
new Vector3(-1114.39, -2333.09, 14.87),
|
||||
@@ -74,7 +80,7 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
client.SendChatMessage("~b~[INFO]~s~ Du besitzt schon einen Flugschein.");
|
||||
return;
|
||||
}
|
||||
if (user.Handmoney < 5000)
|
||||
if (user.Handmoney < PLANE_LICENSE_PRICE)
|
||||
{
|
||||
client.SendNotification("~r~Du brauchst ~g~$5.000~r~ auf der Hand, um die Prüfung starten zu können.", true);
|
||||
return;
|
||||
@@ -82,7 +88,8 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User payer = client.GetUser(dbContext);
|
||||
payer.Handmoney -= 5000;
|
||||
payer.Handmoney -= PLANE_LICENSE_PRICE;
|
||||
logger.LogInformation("Player {0} bought the plane school for {1} dollars", client.Name, PLANE_LICENSE_PRICE);
|
||||
//client.TriggerEvent("SERVER:SET_HANDMONEY", payer.Handmoney);
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
@@ -171,7 +178,7 @@ namespace ReallifeGamemode.Server.DrivingSchool
|
||||
|
||||
case 14:
|
||||
user.TriggerEvent("renderTextOnScreen", "Setzen Sie zum Landeanflug an. Drücken Sie 'G', um das Fahrwerk auszufahren.");
|
||||
CheckPointHandle.StartCheckPointRoute(user, planeRouteEnd, 5000, CHECKPOINT_MARKER_ID, 12, 5, true, "planeSchoolEventEnd");
|
||||
CheckPointHandle.StartCheckPointRoute(user, planeRouteEnd, PLANE_LICENSE_PRICE, CHECKPOINT_MARKER_ID, 12, 5, true, "planeSchoolEventEnd");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user