Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- /* Hello! this is a script to ban/terminate/add players to a game. This is a script inside the game software called "Admin Toolkit Panel". (ATP) */
- public class Player
- {
- public string Name { get; set; }
- public bool IsBanned { get; set; }
- public bool IsTerminated { get; set; }
- }
- public class PlayerManager
- {
- private List<Player> players;
- public PlayerManager()
- {
- players = new List<Player>();
- }
- public void AddPlayer(string playerName)
- {
- players.Add(new Player { Name = playerName });
- }
- public void BanPlayer(string playerName)
- {
- Player player = FindPlayer(playerName);
- if (player != null)
- {
- player.IsBanned = true;
- Console.WriteLine($"Player '{playerName}' has been banned.");
- }
- else
- {
- Console.WriteLine($"Player '{playerName}' not found.");
- }
- }
- public void TerminatePlayer(string playerName)
- {
- Player player = FindPlayer(playerName);
- if (player != null)
- {
- player.IsTerminated = true;
- Console.WriteLine($"Player '{playerName}' has been terminated.");
- }
- else
- {
- Console.WriteLine($"Player '{playerName}' not found.");
- }
- }
- private Player FindPlayer(string playerName)
- {
- return players.Find(p => p.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase));
- }
- }
- public class ToolkitPanel
- {
- private PlayerManager playerManager;
- public ToolkitPanel()
- {
- playerManager = new PlayerManager();
- }
- public void Run()
- {
- Console.WriteLine("Welcome to the Toolkit Panel!");
- bool isRunning = true;
- while (isRunning)
- {
- Console.WriteLine("\nEnter a command (add, ban, terminate, exit):");
- string command = Console.ReadLine();
- switch (command.ToLower())
- {
- case "add":
- Console.WriteLine("Enter player name:");
- string playerName = Console.ReadLine();
- playerManager.AddPlayer(playerName);
- Console.WriteLine($"Player '{playerName}' added.");
- break;
- case "ban":
- Console.WriteLine("Enter player name to ban:");
- string playerToBan = Console.ReadLine();
- playerManager.BanPlayer(playerToBan);
- break;
- case "terminate":
- Console.WriteLine("Enter player name to terminate:");
- string playerToTerminate = Console.ReadLine();
- playerManager.TerminatePlayer(playerToTerminate);
- break;
- case "exit":
- isRunning = false;
- Console.WriteLine("Exiting the Toolkit Panel.");
- break;
- default:
- Console.WriteLine("Invalid command. Please try again.");
- break;
- }
- }
- }
- }
- public class Program
- {
- public static void Main()
- {
- ToolkitPanel toolkitPanel = new ToolkitPanel();
- toolkitPanel.Run();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement