This commit is contained in:
VegaZ
2021-04-08 20:27:40 +02:00
4 changed files with 21 additions and 18 deletions

View File

@@ -49,6 +49,10 @@ namespace ReallifeGamemode.Server.Events
GlobalHelper.DutyAdmins.Remove(player); GlobalHelper.DutyAdmins.Remove(player);
}*/ }*/
if (player.GetUser().IsAdmin(AdminLevel.MAPPING))
{
ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING);
}
/* /*
TaxiDriverJob taxiJob = JobManager.GetJob<TaxiDriverJob>(); TaxiDriverJob taxiJob = JobManager.GetJob<TaxiDriverJob>();
TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault(); TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault();
@@ -61,14 +65,14 @@ namespace ReallifeGamemode.Server.Events
} }
} }
*/ */
var listReports = Report.Report.listReports;
ReportManage temp; ReportManage temp;
for (int a = 0; a < listReports.Count; a++) for (int a = 0; a < Report.Report.listReports.Count; a++)
{ {
temp = listReports[a]; temp = Report.Report.listReports[a];
if (temp.getAdmin().Equals(player.Name)) if (temp.getAdmin().Equals(player.Name))
{ {
listReports.Remove(temp); Report.Report.listReports.Remove(temp);
Player user = PlayerService.GetPlayerByNameOrId(temp.getUser()); Player user = PlayerService.GetPlayerByNameOrId(temp.getUser());
user.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen"); user.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
@@ -77,10 +81,12 @@ namespace ReallifeGamemode.Server.Events
if (temp.getUser().Equals(player.Name)) if (temp.getUser().Equals(player.Name))
{ {
listReports.Remove(temp);
Player admin = PlayerService.GetPlayerByNameOrId(temp.getAdmin()); Player admin = PlayerService.GetPlayerByNameOrId(temp.getAdmin());
if (admin != null)
{
admin.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der User hat den Server verlassen"); admin.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der User hat den Server verlassen");
}
Report.Report.listReports.Remove(temp);
break; break;
} }
} }
@@ -129,17 +135,12 @@ namespace ReallifeGamemode.Server.Events
saveUser.SaveChanges(); saveUser.SaveChanges();
user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false; user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false;
if (user.IsAdmin(AdminLevel.MAPPING))
{
ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING);
}
if (user.Wanteds > 0) if (user.Wanteds > 0)
{ {
ChatService.HQMessage("!{#FFFF00}** Der Straftäter " + player.GetUser().Name + " ist vom Radar verschwunden"); ChatService.HQMessage("Der Straftäter " + player.GetUser().Name + " ist vom Radar verschwunden");
}
} }
}
player.SetData("isLoggedIn", false); player.SetData("isLoggedIn", false);
player.TriggerEvent("CLIENT:DestroyPed", 1); player.TriggerEvent("CLIENT:DestroyPed", 1);
player.TriggerEvent("CLIENT:DestroyPed", 2); player.TriggerEvent("CLIENT:DestroyPed", 2);

View File

@@ -83,7 +83,7 @@ namespace ReallifeGamemode.Server.Events
if (user.Wanteds > 0) if (user.Wanteds > 0)
{ {
ChatService.HQMessage("!{#FFFF00}** Der Straftäter" + user.Name + " hat sich mit " + user.Wanteds + " Wanteds eingeloggt."); ChatService.HQMessage("Der Straftäter" + user.Name + " hat sich mit " + user.Wanteds + " Wanteds eingeloggt.");
} }
if (user.Group != null) if (user.Group != null)

View File

@@ -179,7 +179,7 @@ namespace ReallifeGamemode.Server.Extensions
dbContext.SaveChanges(); dbContext.SaveChanges();
} }
ChatService.SendMessage(user.Player, "!{#FF614A}Du hast ein Verbrechen begangen: " + reason + "" + (cop != null ? " | Gemeldet von: " + cop.Name + "." : "")); ChatService.SendMessage(user.Player, "!{#FF614A}Du hast ein Verbrechen begangen: " + reason + "" + (cop != null ? " | Gemeldet von: " + cop.Name + "." : ""));
ChatService.SendMessage(user.Player, " !{#FFFF00}Fahnundgslevel:~s~ " + newWanteds); ChatService.SendMessage(user.Player, " !{#FFFF00}Fahndungslevel:~s~ " + newWanteds);
foreach (var copPlayer in NAPI.Pools.GetAllPlayers()) foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
{ {

View File

@@ -9,6 +9,7 @@ using GTANetworkAPI;
using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models; using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Services;
namespace ReallifeGamemode.Server.Wanted namespace ReallifeGamemode.Server.Wanted
{ {
@@ -68,10 +69,11 @@ namespace ReallifeGamemode.Server.Wanted
if (waTimer[user.Id] <= 0) if (waTimer[user.Id] <= 0)
{ {
ResetWantedTimeToElapse(player); ResetWantedTimeToElapse(player);
player.SendChatMessage("~y~Du hast erfolgtreich einen Wanted abgetaucht."); player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
user.Wanteds -= 1; user.Wanteds -= 1;
if (user.Wanteds == 0) if (user.Wanteds == 0)
{ {
ChatService.HQMessage(player.Name + " konnte solange abtauchen, sodass er nicht mehr gesucht wird.");
user.SetBlipAndNametagColor(); user.SetBlipAndNametagColor();
dbContext.SaveChanges(); dbContext.SaveChanges();
} }