public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response) { if (!sender.CheckPermission("ast.respawning")) { response = "You can't spawn the chopper, you don't have \"ast.respawning\" permission."; return(false); } Respawn.SummonNtfChopper(); //RespawnEffectsController.ExecuteAllEffects(RespawnEffectsController.EffectType.Selection, SpawnableTeamType.NineTailedFox); if (sender is PlayerCommandSender player) { response = $"Chopper called by {player.Nickname}"; return(true); } else { response = "Chopper called by server console"; return(true); } }
public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response) { if (!sender.CheckPermission("ast.respawning")) { response = "You can't spawn MTF, you don't have \"ast.respawning\" permission."; return(false); } if (Respawn.IsSpawning) { response = "A team is currently spawning, please try again."; return(false); } sender.Respond("Starting..."); Respawn.SummonNtfChopper(); // RespawnEffectsController.ExecuteAllEffects(RespawnEffectsController.EffectType.Selection, SpawnableTeamType.NineTailedFox); Stopwatch stopwatch = Stopwatch.StartNew(); while (true) { //some other processing to do possible if (stopwatch.ElapsedMilliseconds >= 15000) { break; } } RespawnManager.Singleton.ForceSpawnTeam(SpawnableTeamType.NineTailedFox); if (sender is PlayerCommandSender player) { response = $"MTF and chopper spawned by {player.Nickname}"; return(true); } else { response = "MTF and chopper spawned by server console"; return(true); } }