ist das denn die möglichkeit?

This commit is contained in:
hydrant
2020-05-10 23:28:44 +02:00
parent ccbf1ff41c
commit 8bf8944596
8 changed files with 34 additions and 25 deletions

View File

@@ -11,6 +11,7 @@ using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Types;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.Wanted;
/**
@@ -154,12 +155,12 @@ namespace ReallifeGamemode.Server.Events
/*if (player.Vehicle.GetData<bool>("timerJobVehicleRespawn") == true)
{*/
if (player.Vehicle.GetServerVehicle() is JobVehicle vehJ)
{
ChatService.SendMessage(player, "Debug4");
player.Vehicle.ResetData("timerJobVehicleRespawn");
ServerVehicle sVeh = Managers.VehicleManager.GetServerVehicleFromVehicle(player.Vehicle);
ServerVehicleExtensions.Spawn(sVeh, player.Vehicle);
}
{
ChatService.SendMessage(player, "Debug4");
player.Vehicle.ResetData("timerJobVehicleRespawn");
ServerVehicle sVeh = Managers.VehicleManager.GetServerVehicleFromVehicle(player.Vehicle);
ServerVehicleExtensions.Spawn(sVeh, player.Vehicle);
}
else
{
ChatService.SendMessage(player, "Debug5");
@@ -201,7 +202,7 @@ namespace ReallifeGamemode.Server.Events
{
player.SetData("isDead", false);
player.RemoveAllWeapons();
NAPI.Player.SpawnPlayer(player, new Vector3(-495.45, -336.33, 34.5),-98.36f);
NAPI.Player.SpawnPlayer(player, new Vector3(-495.45, -336.33, 34.5), -98.36f);
}
}

View File

@@ -27,7 +27,7 @@ namespace ReallifeGamemode.Server.Events
{
List<Vector3> dealPoint = new List<Vector3>();
dealPoint.Add(vehicle.GetData<Vector3>("weaponDealPoint"));
CheckPointHandle.StartCheckPointRoute(client, dealPoint, 5000, 1, 7, "loadWeaponTransport");
CheckPointHandle.StartCheckPointRoute(client, dealPoint, 5000, 1, 7, 3, true, "loadWeaponTransport");
}
}
}

View File

@@ -183,17 +183,17 @@ namespace ReallifeGamemode.Server.Events
if (!player.IsLoggedIn()) return;
var user = player.GetUser();
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData<bool>("duty"));
ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3));
ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
BehindVehiclePoint nearestBehindVehiclePoint = MarkerBehinVehicle.behindVehiclePoints.Find(s => s.marker.Position.DistanceTo(player.Position) <= 3 && (user.FactionId == 8 || user.FactionId == 7 || user.FactionId == 1 || user.FactionId == 3));
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
if (user?.FactionId != null)
{
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData<bool>("duty"));
ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3));
ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
BehindVehiclePoint nearestBehindVehiclePoint = MarkerBehinVehicle.behindVehiclePoints.Find(s => s.marker.Position.DistanceTo(player.Position) <= 3 && (user.FactionId == 8 || user.FactionId == 7 || user.FactionId == 1 || user.FactionId == 3));
if (nearestBehindVehiclePoint != null)
{
if (player.HasAttachment("ammobox")) return;
@@ -453,6 +453,7 @@ namespace ReallifeGamemode.Server.Events
{
player.TriggerEvent("CLIENT:StartGangwar");
}
if (nearestJobPoint != null)
{
if (player.Vehicle != null) return;

View File

@@ -2,6 +2,7 @@
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Models;
/**
* @overview Life of German Reallife - Event Register (Register.cs)

View File

@@ -7,6 +7,7 @@ using ReallifeGamemode.Database.Models;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Job
{
@@ -386,7 +387,7 @@ namespace ReallifeGamemode.Server.Job
}
}
public static void payWage(Player jobber, int wage)
public static void payWage(Player jobber, int wage)
{
using (var dbContext = new DatabaseContext())
{
@@ -409,7 +410,7 @@ namespace ReallifeGamemode.Server.Job
}
else
{
JobBase job = JobManager.GetJob(jobber.GetUser().JobId??-1);
JobBase job = JobManager.GetJob(jobber.GetUser().JobId ?? -1);
job.StopJob(jobber);
CheckPointHandle.DeleteCheckpoints(jobber);
ChatService.SendMessage(jobber, $"~y~[JOB]~s~ Du hast deinen Job ~o~{job.Name}~s~ beendet.");

View File

@@ -6,6 +6,7 @@ using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Job
{
@@ -147,6 +148,8 @@ namespace ReallifeGamemode.Server.Job
break;
}
}*/
}
[RemoteEvent("startPilotRoute")]
public void StartPilotRoute(Player player, string type)
{
@@ -258,7 +261,7 @@ namespace ReallifeGamemode.Server.Job
}
else
{
JobBase job = JobManager.GetJob(jobber.GetUser().JobId??-1);
JobBase job = JobManager.GetJob(jobber.GetUser().JobId ?? -1);
job.StopJob(jobber);
CheckPointHandle.DeleteCheckpoints(jobber);
ChatService.SendMessage(jobber, $"~y~[JOB]~s~ Du hast deinen Job ~o~{job.Name}~s~ beendet.");

View File

@@ -16,6 +16,7 @@ using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Services;
using System.Threading;
using Microsoft.EntityFrameworkCore;
/**
* @overview Life of German Reallife - Main Class (Main.cs)

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Job;
@@ -59,7 +60,7 @@ namespace ReallifeGamemode.Server.Util
{
if (user.GetUser().JobId == 4)
{
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId??-1);
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId ?? -1);
if (job.GetUsersInJob().Contains(user))
{
if (!user.IsInVehicle || user.VehicleSeat != 0) return;
@@ -166,7 +167,7 @@ namespace ReallifeGamemode.Server.Util
}
if (temp.LastCheckpoint != 1)
{
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId??-1);
Job.JobBase job = Managers.JobManager.GetJob(user.GetUser().JobId ?? -1);
if (job.GetUsersInJob().Contains(user))
{
if (user.GetUser().JobId == 3)
@@ -201,7 +202,7 @@ namespace ReallifeGamemode.Server.Util
{
if (temp.checkPointsDone == 2)
{
if(user.GetData<string>("Route") == "Skill1Route1" || user.GetData<string>("Route") == "Skill1Route2" || user.GetData<string>("Route") == "Skill1Route3" || user.GetData<string>("Route") == "Skill1Route4")
if (user.GetData<string>("Route") == "Skill1Route1" || user.GetData<string>("Route") == "Skill1Route2" || user.GetData<string>("Route") == "Skill1Route3" || user.GetData<string>("Route") == "Skill1Route4")
{
BusDriverJob.payWage(user, BusSkill1RouteVerdienst / temp.list.Count());
BusDriverJob.payWage(user, BusSkill1RouteVerdienst / temp.list.Count());
@@ -288,11 +289,11 @@ namespace ReallifeGamemode.Server.Util
this.checkPointsDone++;
if (this.list.Count() > checkPointsDone)
{
LastCheckpoint = 0;
Vector3 nextCp = list.ElementAt(checkPointsDone);
LastCheckpoint = 0;
Vector3 nextCp = list.ElementAt(checkPointsDone);
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.markerDist, this.useVehicle, this.eventInCheckpoint);
}
if (checkPointsDone == this.list.Count()-1)
if (checkPointsDone == this.list.Count() - 1)
{
LastCheckpoint = 1;
}