NotificationService für Fehler rein

This commit is contained in:
Luke
2021-07-05 11:33:04 +02:00
parent f70218e85a
commit 84c3a84ed0
10 changed files with 111 additions and 103 deletions

View File

@@ -10,6 +10,7 @@ using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.WeaponDeal;
using ReallifeGamemode.Server.Log;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Services;
namespace ReallifeGamemode.Server.Events
{
@@ -30,7 +31,7 @@ namespace ReallifeGamemode.Server.Events
if (NAPI.Entity.GetEntityVelocity(v).Length() > 1 && v.Class != 16)
{
player.SendNotification("~r~Der Motor kann nur im Stand betätigt werden.", true);
NotificationService.SendErrorNotification(player, "Der Motor kann nur im Stand betätigt werden", true);
return;
}
@@ -52,7 +53,7 @@ namespace ReallifeGamemode.Server.Events
}
else if (!fV.GetOwners().Contains(u.FactionId ?? 0) && !state && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()))
{
player.SendNotification("~r~Du hast keinen Schlüssel.");
NotificationService.SendErrorNotification(player, "Du hast keinen Schlüssel");
return;
}
}
@@ -60,7 +61,7 @@ namespace ReallifeGamemode.Server.Events
{
if (gV.GroupId != u.Group.Id && !state && !u.IsAdmin(AdminLevel.ADMIN3))
{
player.SendNotification("~r~Du hast keinen Schlüssel.");
NotificationService.SendErrorNotification(player, "Du hast keinen Schlüssel");
return;
}
}
@@ -68,7 +69,7 @@ namespace ReallifeGamemode.Server.Events
{
if (jV.JobId != player.GetUser().JobId && !state && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()))
{
player.SendNotification("~r~Du hast keinen Schlüssel.");
NotificationService.SendErrorNotification(player, "Du hast keinen Schlüssel");
return;
}
else
@@ -123,7 +124,7 @@ namespace ReallifeGamemode.Server.Events
{
if (uV.UserId != u.Id)
{
player.SendNotification("~r~Du hast keinen Schlüssel.");
NotificationService.SendErrorNotification(player, "Du hast keinen Schlüssel");
return;
}
}
@@ -238,7 +239,7 @@ namespace ReallifeGamemode.Server.Events
{
if (uV.UserId != u.Id && (!u.IsAdmin(AdminLevel.HEADADMIN) || !player.IsTSupport()))
{
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht parken.");
NotificationService.SendErrorNotification(player, "Du darfst dieses Fahrzeug nicht parken");
return;
}
}
@@ -246,7 +247,7 @@ namespace ReallifeGamemode.Server.Events
{
if ((!fV.GetOwners().Contains(u.FactionId ?? 0) || !u.FactionLeader) && (!u.IsAdmin(AdminLevel.HEADADMIN) || !player.IsTSupport()))
{
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht parken.");
NotificationService.SendErrorNotification(player, "Du darfst dieses Fahrzeug nicht parken");
return;
}
}
@@ -254,18 +255,18 @@ namespace ReallifeGamemode.Server.Events
{
if (gV.GroupId != u.Group.Id || u.GroupRank < GroupRank.MANAGER)
{
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht parken.");
NotificationService.SendErrorNotification(player, "Du darfst dieses Fahrzeug nicht parken");
return;
}
}
else if (sV is JobVehicle)
{
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht parken.");
NotificationService.SendErrorNotification(player, "Du darfst dieses Fahrzeug nicht parken");
return;
}
else if (sV is SchoolVehicle)
{
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht parken.");
NotificationService.SendErrorNotification(player, "Du darfst dieses Fahrzeug nicht parken");
return;
}