Zum testen: rentcar system

This commit is contained in:
Fabian
2021-05-02 22:53:53 +02:00
parent 60059f45d4
commit 98cd903f4c
13 changed files with 416 additions and 6 deletions

View File

@@ -32,6 +32,8 @@ namespace ReallifeGamemode.Server.Managers
public static List<AmmunationPoint> AmmunationPoints = new List<AmmunationPoint>();
public static List<RentcarPoint> rentcarPoints = new List<RentcarPoint>();
public static Vector3 eventportPosition;
public static bool eventportActive = false;
@@ -307,6 +309,35 @@ namespace ReallifeGamemode.Server.Managers
}
#endregion Shops
#region RentCar
RentcarPoint rentCarNoobSpawn = new RentcarPoint()
{
Position = Rentcar.noobSpawnBlipPosition
};
RentcarPoint rentCarStadthalle = new RentcarPoint()
{
Position = Rentcar.stadthalleBlipPosition
};
RentcarPoint rentCarKnast = new RentcarPoint()
{
Position = Rentcar.knastBlipPosition
};
rentcarPoints.Add(rentCarNoobSpawn);
rentcarPoints.Add(rentCarStadthalle);
rentcarPoints.Add(rentCarKnast);
foreach (RentcarPoint j 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),
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);
}
#endregion RentCar
}
[RemoteEvent("sendClientToStage")]
@@ -439,3 +470,9 @@ public class AmmunationPoint
public Vector3 Position { get; set; }
public Ammunation Ammunation { get; set; }
}
public class RentcarPoint
{
public Vector3 Position { get; set; }
}

View File

@@ -5,7 +5,9 @@ using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Log;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Services;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -955,6 +957,17 @@ namespace ReallifeGamemode.Server.Managers
[ServerEvent(Event.VehicleDeath)]
public static void VehicleManagerVehicleDeath(Vehicle vehicle)
{
/*
String rentCarOwner = Rentcar.mapPlayerRentcarBill.FirstOrDefault(x => x.Value.Item1 == vehicle).Key;
ChatService.Broadcast("a:" + "");
if (rentCarOwner != null)
{
Player target = PlayerService.GetPlayerByNameOrId(rentCarOwner);
Rentcar.cancelRent(target);
}
*/
ServerVehicle serverVehicle = GetServerVehicleFromVehicle(vehicle);
if (serverVehicle == null)