add adminCMD /anim & add UserCMD /hub

This commit is contained in:
michael.reiswich
2021-03-24 22:53:36 +01:00
parent 41b0cf0ac0
commit c0120bfbf5
12 changed files with 36 additions and 11 deletions

View File

@@ -34,6 +34,20 @@ namespace ReallifeGamemode.Server.Commands
{
#region Todo
[Command("anim", "~m~Benutzung: ~s~/anim [animDict] [animName]")]
public void CmdAnim(Player player, string animDict, string animName)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
player.PlayAnimation(animDict, animName, (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl | AnimationFlags.Cancellable));
}
[Command("eat", "~m~Benutzung: ~s~/eat [Item]")]
public void CmdAdminEat(Player player, string item)
{
@@ -208,7 +222,7 @@ namespace ReallifeGamemode.Server.Commands
#region Support
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~ip~s~, ~g~deathlogs~s~,~g~lc~s~", GreedyArg = true)]
[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)

View File

@@ -189,7 +189,7 @@ namespace ReallifeGamemode.Server.Commands
NAPI.Pools.GetAllPlayers().ForEach(p =>
{
if (p.GetUser()?.FactionLeader ?? false || player.HasData("toglc")) ChatService.SendMessage(p, broadcastMsg);
if (p.GetUser()?.FactionLeader ?? false) ChatService.SendMessage(p, broadcastMsg);
});
}

View File

@@ -81,6 +81,17 @@ namespace ReallifeGamemode.Server.Commands
{
player.TriggerEvent("showUserhelp");
}
[Command("hub")]
public void CmdAnim(Player player)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
player.PlayAnimation("mp_am_hold_up", "handsup_base", (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl | AnimationFlags.Cancellable));
}
}
}