eventport mit dimension

This commit is contained in:
Luke
2021-07-02 13:25:02 +02:00
parent 1260a4cb8b
commit e77826c044
2 changed files with 10 additions and 3 deletions

View File

@@ -56,13 +56,18 @@ namespace ReallifeGamemode.Server.Commands
{ {
return; return;
} }
uint dimension = player.Dimension;
PositionManager.eventportDimension = dimension;
Vector3 position = player.Position; Vector3 position = player.Position;
PositionManager.eventportPosition = position; PositionManager.eventportPosition = player.Position;
PositionManager.eventportActive = true; PositionManager.eventportActive = true;
player.SendChatMessage("~y~Du hast hier erfolgreich einen Eventport gesetzt."); player.SendChatMessage("~y~Du hast hier erfolgreich einen Eventport gesetzt.");
ChatService.BroadcastAdmin($"~y~[EVENTPORT] ~s~{player.Name} hat den Eventport aktiviert.", AdminLevel.ADMIN); ChatService.BroadcastAdmin($"~y~[EVENTPORT] ~s~{player.Name} hat den Eventport aktiviert (Dimension: {dimension}).", AdminLevel.ADMIN);
logger.LogInformation("Admin {0} created the eventport at x: {1}, y: {2}, z: {3}", player.Name, position.X, position.Y, position.Z); logger.LogInformation("Admin {0} created the eventport at x: {1}, y: {2}, z: {3} in dimension {4}", player.Name, position.X, position.Y, position.Z, dimension);
return; return;
} }
@@ -105,6 +110,7 @@ namespace ReallifeGamemode.Server.Commands
logger.LogInformation("Player {0} used the eventport to x: {1}, y: {2}, z: {3}", player.Name, currentEventport.X, currentEventport.Y, currentEventport.Z); logger.LogInformation("Player {0} used the eventport to x: {1}, y: {2}, z: {3}", player.Name, currentEventport.X, currentEventport.Y, currentEventport.Z);
player.SafeTeleport(teleportPosition); player.SafeTeleport(teleportPosition);
player.Dimension = PositionManager.eventportDimension;
player.SendChatMessage("~y~[EVENTPORT] ~s~Du hast dich zum Event teleportiert"); player.SendChatMessage("~y~[EVENTPORT] ~s~Du hast dich zum Event teleportiert");
} }

View File

@@ -42,6 +42,7 @@ namespace ReallifeGamemode.Server.Managers
public static List<JailPoint> jailPoints = new List<JailPoint>(); public static List<JailPoint> jailPoints = new List<JailPoint>();
public static Vector3 eventportPosition; public static Vector3 eventportPosition;
public static uint eventportDimension;
public static bool eventportActive = false; public static bool eventportActive = false;
public static void LoadPositionManager() public static void LoadPositionManager()