コード例 #1
0
        protected void TeleportPlayersIn()
        {
            SavePlayersPosition();
            for (int i = 0; i < GameModeData.CurrentPlayers.Count; i++)
            {
                Client player = GameModeData.CurrentPlayers[i];


                GamePosition randomSpawn = GetRandomSpawnPosition();
                ServerUtilities.SpawnPlayer(player, randomSpawn);
            }
        }
コード例 #2
0
        private void TeleportPlayerOut(Client client)
        {
            int clientIndex = GameModeData.CurrentPlayers.IndexOf(client);

            if (clientIndex > -1)
            {
                GamePosition position = GameModeData.PlayerPositions[clientIndex];
                ServerUtilities.SpawnPlayer(client, position);

                PlayerTempData playerTempData = client.GetData(PlayerTempData.PLAYER_TEMP_DATA_KEY);
                playerTempData.GamemodeId = null;
                client.SetData(PlayerTempData.PLAYER_TEMP_DATA_KEY, playerTempData);
                OnResetPlayerState(client, clientIndex);
            }
        }