add tog ip, deathlogs,lc

This commit is contained in:
michael.reiswich
2021-03-24 17:40:42 +01:00
parent d80b58551a
commit 45ce80c139
4 changed files with 60 additions and 6 deletions

View File

@@ -208,6 +208,57 @@ namespace ReallifeGamemode.Server.Commands
#region Support #region Support
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~ip~s~, ~g~deathlogs~s~,~g~lc~s~", GreedyArg = true)]
public void CmdTog(Player player, string typ, string option1 = null, string option2 = null)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
switch (typ.ToLower())
{
case "ip":
if(player.HasData("togip"))
{
player.SetData("togip", false);
player.SendNotification("~g~[Info]~w~ Ip´s werden nun ausgeblendet.");
}
else
{
player.SetData("togip", true);
player.SendNotification("~g~[Info]~w~ Ip´s werden nun angezeigt.");
}
break;
case "deathlogs":
if (player.HasData("togdeath"))
{
player.SetData("togdeath", false);
player.SendNotification("~g~[Info]~w~ Deathlogs werden nun ausgeblendet.");
}
else
{
player.SetData("togdeath", true);
player.SendNotification("~g~[Info]~w~ Deathlogs werden nun angezeigt.");
}
break;
case "lc":
if (player.HasData("toglc"))
{
player.SetData("toglc", false);
player.SendNotification("~g~[Info]~w~ Leaderchat wird nun ausgeblendet.");
}
else
{
player.SetData("toglc", true);
player.SendNotification("~g~[Info]~w~ Leaderchat wird nun angezeigt.");
}
break;
}
}
[Command("tsupport", "~m~Benutzung: ~s~/tsupport", Alias = "ts")] [Command("tsupport", "~m~Benutzung: ~s~/tsupport", Alias = "ts")]
public void CmdAdminTSupport(Player player) public void CmdAdminTSupport(Player player)
{ {

View File

@@ -177,7 +177,7 @@ namespace ReallifeGamemode.Server.Commands
[Command("lc", "~m~Benutzung: ~s~/lc [Nachricht]", GreedyArg = true)] [Command("lc", "~m~Benutzung: ~s~/lc [Nachricht]", GreedyArg = true)]
public void CmdFactionLc(Player player, string message) public void CmdFactionLc(Player player, string message)
{ {
if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false) if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false || player.HasData("toglc") == false )
{ {
ChatService.NotAuthorized(player); ChatService.NotAuthorized(player);
return; return;
@@ -189,7 +189,7 @@ namespace ReallifeGamemode.Server.Commands
NAPI.Pools.GetAllPlayers().ForEach(p => NAPI.Pools.GetAllPlayers().ForEach(p =>
{ {
if (p.GetUser()?.FactionLeader ?? false) ChatService.SendMessage(p, broadcastMsg); if (p.GetUser()?.FactionLeader ?? false || player.HasData("toglc")) ChatService.SendMessage(p, broadcastMsg);
}); });
} }

View File

@@ -62,8 +62,10 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("SERVER:Login_ShowBrowser", registered, disableLightMode); player.TriggerEvent("SERVER:Login_ShowBrowser", registered, disableLightMode);
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")"; string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")";
ChatService.BroadcastAdmin(msg, AdminLevel.ADMIN); if(player.HasData("togip"))
{
ChatService.SendMessage(player, msg);
}
} }
private bool IsPlayerBanned(Player player) private bool IsPlayerBanned(Player player)

View File

@@ -41,13 +41,14 @@ namespace ReallifeGamemode.Server.Events
userisdead.Dead = true; userisdead.Dead = true;
userDeath.SaveChanges(); userDeath.SaveChanges();
} }
//TODO: Zum Full Release entfernen //TODO: Zum Full Release entfernen
if (player.HasData("togdeath")) {
ChatService.SendMessage(player, "Du bist durch " + (killer?.Name ?? "Niemanden") + " gestorben: " + reason.ToString()); ChatService.SendMessage(player, "Du bist durch " + (killer?.Name ?? "Niemanden") + " gestorben: " + reason.ToString());
}
int? killerId; int? killerId;
float killerPosX; float killerPosX;
float killerPosY; float killerPosY;