internal void InvokeSpawnPlayersEvent(ref Dictionary <Player, int> spawnplayers, out bool allow) { var ev = new SpawnPlayersEventArgs { SpawnPlayers = spawnplayers, Allow = true, }; SpawnPlayersEvent?.Invoke(ev); allow = ev.Allow; }
private void Round_SpawnPlayersEvent(SpawnPlayersEventArgs ev) { SynapseController.Server.Map.Round.RoundLock = true; foreach (var player in ev.SpawnPlayers.Keys.ToArray()) { ev.SpawnPlayers[player] = (int)RoleType.ClassD; } Player rndPeen = SynapseController.Server.Players[UnityEngine.Random.Range(0, SynapseController.Server.Players.Count)]; ev.SpawnPlayers[rndPeen] = (int)RoleType.Scp173; SynapseController.Server.Map.Round.RoundLock = false; }