Aduty und TSupport überarbeitet
This commit is contained in:
@@ -245,28 +245,22 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
ChatService.NotAuthorized(player);
|
ChatService.NotAuthorized(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!player.IsAdminDuty())
|
if (!player.IsAdminDuty())
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "~r~ Du bist nicht im Admin-Duty-Modus!");
|
ChatService.SendMessage(player, "~r~ Du bist nicht im Admin-Duty-Modus!");
|
||||||
ChatService.SendMessage(player, "1"+player.GetData<bool>("Adminduty"));
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!GlobalHelper.tsupAdmins.Contains(player))
|
if (player.GetData<bool>("SAdminduty") == false)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "2"+player.GetData<bool>("Adminduty"));
|
player.SetData("SAdminduty", true);
|
||||||
GlobalHelper.tsupAdmins.Add(player);
|
|
||||||
player.SetSharedData("blipColor", 30);
|
player.SetSharedData("blipColor", 30);
|
||||||
ChatService.SendMessage(player, "~g~ ** " + "Du befindest dich im T-Support");
|
ChatService.SendMessage(player, "~g~ ** " + "Du befindest dich im T-Support");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "3"+player.GetData<bool>("Adminduty"));
|
player.SetData("SAdminduty", false);
|
||||||
GlobalHelper.tsupAdmins.Remove(player);
|
|
||||||
ChatService.SendMessage(player, "!{#ee4d2e}** " + "Du befindest dich nicht mehr im T-Support");
|
ChatService.SendMessage(player, "!{#ee4d2e}** " + "Du befindest dich nicht mehr im T-Support");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
User targetUser = player.GetUser(dbContext);
|
User targetUser = player.GetUser(dbContext);
|
||||||
@@ -287,7 +281,6 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
[Command("aduty", "~m~Benutzung: ~s~/aduty")]
|
[Command("aduty", "~m~Benutzung: ~s~/aduty")]
|
||||||
public void CmdAduty(Player player)
|
public void CmdAduty(Player player)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
NAPI.Util.ConsoleOutput(player.Name + " Timeoutet");
|
NAPI.Util.ConsoleOutput(player.Name + " Timeoutet");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GlobalHelper.DutyAdmins.Contains(player))
|
/*if (GlobalHelper.DutyAdmins.Contains(player))
|
||||||
{
|
{
|
||||||
GlobalHelper.DutyAdmins.Remove(player);
|
GlobalHelper.DutyAdmins.Remove(player);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (player.GetUser().IsAdmin(AdminLevel.MAPPING))
|
if (player.GetUser().IsAdmin(AdminLevel.MAPPING))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
if (vehicle.GetServerVehicle() is FactionVehicle veh)
|
if (vehicle.GetServerVehicle() is FactionVehicle veh)
|
||||||
{
|
{
|
||||||
if (!veh.GetOwners().Contains(player.GetUser().FactionId ?? 0) && !(u.IsAdmin(AdminLevel.HEADADMIN) && GlobalHelper.DutyAdmins.Contains(player)))
|
if (!veh.GetOwners().Contains(player.GetUser().FactionId ?? 0) && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()))
|
||||||
{
|
{
|
||||||
if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3)
|
if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
else if (sV is FactionVehicle fV)
|
else if (sV is FactionVehicle fV)
|
||||||
{
|
{
|
||||||
if (!fV.GetOwners().Contains(u.FactionId ?? 0) && !state && !(u.IsAdmin(AdminLevel.HEADADMIN) && GlobalHelper.DutyAdmins.Contains(player)))
|
if (!fV.GetOwners().Contains(u.FactionId ?? 0) && !state && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()))
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Du hast keinen Schlüssel.");
|
player.SendNotification("~r~Du hast keinen Schlüssel.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
else if (sV is FactionVehicle fV)
|
else if (sV is FactionVehicle fV)
|
||||||
{
|
{
|
||||||
if (!fV.GetOwners().Contains(u.FactionId ?? 0) && !state && !(u.IsAdmin(AdminLevel.HEADADMIN) && GlobalHelper.DutyAdmins.Contains(player)))
|
if (!fV.GetOwners().Contains(u.FactionId ?? 0) && !state && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()))
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Du hast keinen Schlüssel.");
|
player.SendNotification("~r~Du hast keinen Schlüssel.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -197,17 +197,26 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GlobalHelper.DutyAdmins.Count == 0)
|
int aod = 0;
|
||||||
|
NAPI.Pools.GetAllPlayers().ForEach(p =>
|
||||||
|
{
|
||||||
|
if (p.IsAdminDuty())
|
||||||
|
{
|
||||||
|
aod++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (aod == 0)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(user, "!{#addc8d}Momentan ist kein Administrator verfügbar");
|
ChatService.SendMessage(user, "!{#addc8d}Momentan ist kein Administrator verfügbar");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ChatService.SendMessage(user, "!{#addc8d}Dein Ticket wurde abgeschickt");
|
ChatService.SendMessage(user, "!{#addc8d}Dein Ticket wurde abgeschickt");
|
||||||
ChatService.SendMessage(user, "!{#addc8d}Momentan sind " + GlobalHelper.DutyAdmins.Count + " Admins verfügbar");
|
ChatService.SendMessage(user, "!{#addc8d}Momentan sind " + aod + " Admins verfügbar");
|
||||||
ChatService.BroadcastDutyAdmin("!{#008fff}[TICKET]!{#FFFFFF} Eingehendes Ticket von~w~ " + user.Name + " (" + user.Handle.Value + ")~w~: " + text + " (Benutze /showtickets)");
|
ChatService.BroadcastDutyAdmin("!{#008fff}[TICKET]!{#FFFFFF} Eingehendes Ticket von~w~ " + user.Name + " (" + user.Handle.Value + ")~w~: " + text + " (Benutze /showtickets)");
|
||||||
ReportManage ticket = new ReportManage(user.Name, text);
|
ReportManage ticket = new ReportManage(user.Name, text);
|
||||||
//ChatService.Broadcast("ADDTICKET:" + user.Name + ", " + text);
|
//ChatService.Broadcast("ADDTICKET:" + user.Name + ", " + text);
|
||||||
listReports.Add(ticket);
|
listReports.Add(ticket);
|
||||||
|
//ChatService.SendMessage(user, "!{#addc8d}In Bearbeitung");
|
||||||
}
|
}
|
||||||
if (type == "Quick Report")
|
if (type == "Quick Report")
|
||||||
ChatService.BroadcastAdmin("!{#008fff}[QR]~w~ " + user.Name + " (" + user.Handle.Value + ")~w~: " + text, AdminLevel.SUPPORTER);
|
ChatService.BroadcastAdmin("!{#008fff}[QR]~w~ " + user.Name + " (" + user.Handle.Value + ")~w~: " + text, AdminLevel.SUPPORTER);
|
||||||
|
|||||||
@@ -96,10 +96,13 @@ namespace ReallifeGamemode.Server.Services
|
|||||||
}
|
}
|
||||||
public static void BroadcastDutyAdmin(string message)
|
public static void BroadcastDutyAdmin(string message)
|
||||||
{
|
{
|
||||||
foreach (Player admin in GlobalHelper.DutyAdmins)
|
NAPI.Pools.GetAllPlayers().ForEach(p =>
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(admin, message);
|
if (p.IsAdminDuty())
|
||||||
|
{
|
||||||
|
ChatService.SendMessage(p, message);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BroadcastGroup(string message, Group group)
|
public static void BroadcastGroup(string message, Group group)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
{
|
{
|
||||||
public static class GlobalHelper
|
public static class GlobalHelper
|
||||||
{
|
{
|
||||||
public static List<Player> DutyAdmins = new List<Player>();
|
/*public static List<Player> DutyAdmins = new List<Player>();
|
||||||
public static List<Player> tsupAdmins = new List<Player>();
|
public static List<Player> tsupAdmins = new List<Player>();*/
|
||||||
|
|
||||||
public static Dictionary<string, string> CustomJoinMessages = new Dictionary<string, string>
|
public static Dictionary<string, string> CustomJoinMessages = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user