/cuff Command (not tested)
This commit is contained in:
@@ -34,6 +34,35 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
#region Todo
|
||||
|
||||
[Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")]
|
||||
public void CmdSncAnim(Player player, string nameOrId)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
||||
if (target.Id == player.Id)
|
||||
return;
|
||||
|
||||
float rad = player.Heading * MathF.PI / 180;
|
||||
Vector3 forward = new Vector3(player.Position.X + (1.2 * MathF.Sin(rad)), player.Position.Y + (1.2 * MathF.Cos(rad)), player.Position.Z);
|
||||
|
||||
target.Position = forward;
|
||||
|
||||
if (!target.HasAnimation("Cuffed"))
|
||||
{
|
||||
player.SyncAnimation("doArrest");
|
||||
target.SyncAnimation("getArrest");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SyncAnimation("doUncuff");
|
||||
target.SyncAnimation("getUncuff");
|
||||
}
|
||||
}
|
||||
|
||||
[Command("syncanim", "~m~Benutzung: ~s~/syncanim [animName]")]
|
||||
public void CmdSncAnim(Player player, string animName = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user