From 7ca92cbafb06b13bb6136e2c8e8e60ea594dca5e Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 25 Apr 2021 17:31:21 +0200 Subject: [PATCH] eventport position immer leicht versetzt --- ReallifeGamemode.Server/Commands/UserCommands.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 18ce329f..09c8dd44 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -41,13 +41,13 @@ namespace ReallifeGamemode.Server.Commands return; } PositionManager.eventportActive = false; - player.SendChatMessage("Du hast den Eventport deaktiviert."); + player.SendChatMessage("~y~Du hast den Eventport deaktiviert."); return; } if (!PositionManager.eventportActive || PositionManager.eventportPosition == null) { - player.SendChatMessage("Im Moment ist kein Eventport aktiv."); + player.SendChatMessage("~y~Im Moment ist kein Eventport aktiv."); return; } @@ -61,7 +61,14 @@ namespace ReallifeGamemode.Server.Commands } } - player.SafeTeleport(PositionManager.eventportPosition); + Random rnd = new Random(); + int randomX = rnd.Next(-5, 5); + int randomY = rnd.Next(-5, 5); + + Vector3 teleportPosition = new Vector3(PositionManager.eventportPosition.X + randomX, PositionManager.eventportPosition.Y + randomY, PositionManager.eventportPosition.Z); + + player.SafeTeleport(teleportPosition); + player.SendNotification("Du hast dich zum Event teleportiert"); } [Command("look", "~m~look")]