Busfahrer und PilotenSystem überarbeitet, LoginAmbiente eingefügt, Überarbeitung der Türen
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database;
|
||||
@@ -43,6 +43,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
|
||||
if (IsPlayerBanned(player)) return;
|
||||
player.TriggerEvent("CLIENT:PlaySound", "music/login", "mp3", 25);
|
||||
player.TriggerEvent("SERVER:Login_ShowBrowser");
|
||||
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")";
|
||||
ChatService.BroadcastAdmin(msg, AdminLevel.ADMIN);
|
||||
|
||||
@@ -42,6 +42,33 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (vehicle.GetServerVehicle() is JobVehicle jveh)
|
||||
{
|
||||
if (jveh.JobId != player.GetUser().JobId && !(u.IsAdmin(AdminLevel.HEADADMIN) && !player.IsAdminDuty()))
|
||||
{
|
||||
player.StopAnimation();
|
||||
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((VehicleHash)vehicle.Model == VehicleHash.Velum || (VehicleHash)vehicle.Model == VehicleHash.Velum2 && player.GetUser().PilotSkill < 300)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(2) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
if ((VehicleHash)vehicle.Model == VehicleHash.Coach && player.GetUser().BusSkill < 300)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(2) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
if ((VehicleHash)vehicle.Model == VehicleHash.Tourbus && player.GetUser().BusSkill < 800)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(3) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (vehicle.GetServerVehicle() is SchoolVehicle sVeh)
|
||||
|
||||
@@ -180,7 +180,10 @@ namespace ReallifeGamemode.Server.Events
|
||||
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);
|
||||
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
|
||||
|
||||
if (nearestDuty != null)// Duty Point
|
||||
{
|
||||
@@ -259,6 +262,62 @@ namespace ReallifeGamemode.Server.Events
|
||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
||||
}
|
||||
}
|
||||
if (nearestJobPoint != null)
|
||||
{
|
||||
Job.JobBase job = JobManager.GetJob(player.GetUser().JobId.Value);
|
||||
JobManager jobb = new JobManager();
|
||||
if (nearestJobPoint.jobId != 3 && nearestJobPoint.jobId == player.GetUser().JobId)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StopJob(player);
|
||||
return;
|
||||
}
|
||||
if (!job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StartJobEvent(player);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
|
||||
{
|
||||
if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill < 300)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StopJob(player);
|
||||
user.SetData("PilotenBase2", false);
|
||||
return;
|
||||
}
|
||||
if (!job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StartJobEvent(player);
|
||||
user.SetData("PilotenBase2", false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300)
|
||||
{
|
||||
if (job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StopJob(player);
|
||||
user.SetData("PilotenBase2", false);
|
||||
return;
|
||||
}
|
||||
if (!job.GetUsersInJob().Contains(player))
|
||||
{
|
||||
jobb.StartJobEvent(player);
|
||||
user.SetData("PilotenBase2", true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nearestWeapon != null) // Weapon Point
|
||||
{
|
||||
|
||||
@@ -505,55 +564,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
else if (sV is JobVehicle jV)
|
||||
{
|
||||
//if (jV.GetJob().GetUsersInJob().Contains(player))
|
||||
if (u.IsAdmin(AdminLevel.ADMIN3) && player.IsAdminDuty())
|
||||
{
|
||||
}
|
||||
else if (jV.GetJob().Id == u.JobId)
|
||||
if (jV.JobId == player.GetUser().JobId)
|
||||
{
|
||||
if (!jV.GetJob().GetUsersInJob().Contains(player))
|
||||
{
|
||||
if (u.JobId == 3)
|
||||
{
|
||||
if (v.Model == (uint)Types.VehicleModel.Cuban800)
|
||||
{
|
||||
}
|
||||
if (v.Model == (uint)Types.VehicleModel.Velum || v.Model == (uint)Types.VehicleModel.Velum2)
|
||||
{
|
||||
if (u.PilotSkill < 300)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(2) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (u.JobId == 4)
|
||||
{
|
||||
if (v.Model == (uint)Types.VehicleModel.Coach)
|
||||
{
|
||||
if (u.BusSkill < 300)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(2) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
if (v.Model == (uint)Types.VehicleModel.Tourbus)
|
||||
{
|
||||
if (u.BusSkill < 800)
|
||||
{
|
||||
player.SendNotification("~r~Dein Skilllevel(3) ist nicht hoch genug!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
player.SendNotification("~y~[JOB] ~w~Du musst den Job vorher starten!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
player.Name = username;
|
||||
player.TriggerEvent("SERVER:Login_Success");
|
||||
player.TriggerEvent("CLIENT:StopSound");
|
||||
player.SetData("isLoggedIn", true);
|
||||
player.SetSharedData("isLoggedIn", JsonConvert.SerializeObject(true));
|
||||
player.SetData("spec", true);
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
dbContext.SaveChanges();
|
||||
|
||||
player.TriggerEvent("SERVER:Login_Success");
|
||||
player.TriggerEvent("CLIENT:StopSound");
|
||||
player.SetData("isLoggedIn", true);
|
||||
player.SetSharedData("isLoggedIn", true);
|
||||
player.SetData("isDead", false);
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
foreach (Player user in users)
|
||||
{
|
||||
user.TriggerEvent("CLIENT:StopSound");
|
||||
using (var saveUsers = new DatabaseContext())
|
||||
{
|
||||
var saveUser = saveUsers.Users.SingleOrDefault(u => u.Name == user.Name);
|
||||
|
||||
Reference in New Issue
Block a user