public static void RequestBegin() { LightingManager.time = (uint)(LightingManager.cycle * LevelLighting.transition); isRunning = true; timer = GunGameConfig.instance.maxRoundTime * 60; foreach (SteamPlayer player in Provider.clients) { ulong id = player.playerID.steamID.m_SteamID; UnturnedPlayer uPlayer = id.GetPlayer(); GunGameConfig.SpawnPosition sp = GetSpawnPositionRR(); InGamePlayers.Add(id); uPlayer.Teleport(sp.Vector3, sp.rot); uPlayer.GunGamePlayer().EnterGame(); } Rocket.Core.Logging.Logger.Log(String.Format("The game has started with {0} players!", InGamePlayers.Count), ConsoleColor.Yellow); if (InGamePlayers.Count < 3) { Rocket.Core.Logging.Logger.Log("Starting game with less then 3 players can cause bugs!", ConsoleColor.Yellow); } }
public void TeleportAfterRespawn() { if (GameManager.isRunning) { GunGameConfig.SpawnPosition sp = GameManager.GetSpawnPositionRR(); Player.Teleport(sp.Vector3, sp.rot); } }
public static GunGameConfig.SpawnPosition GetSpawnPositionRR() { GunGameConfig.SpawnPosition vect = GunGameConfig.instance.positions[lastSpawn]; if (lastSpawn == GunGameConfig.instance.positions.Length - 1) { lastSpawn = 0; } else { lastSpawn++; } return(vect); }