public static void Run(SvPlayer player, string message) { string arg1 = GetArgument.Run(1, false, true, message); if (string.IsNullOrEmpty(arg1)) { player.SendChatMessage(ArgRequired); return; } var currPlayer = GetShByStr.Run(arg1); if (currPlayer == null) { player.SendChatMessage(NotFoundOnline); return; } ReadFile.Run(MuteListFile); if (!MutePlayers.Contains(currPlayer.username)) { MutePlayers.Add(currPlayer.username); File.AppendAllText(MuteListFile, currPlayer.username + Environment.NewLine); player.SendChatMessage($"<color={infoColor}>Muted </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>"); return; } RemoveStringFromFile.Run(MuteListFile, currPlayer.username); ReadFile.Run(MuteListFile); player.SendChatMessage($"<color={infoColor}>Unmuted </color><color={argColor}>{currPlayer.username}</color><color={infoColor}>.</color>"); }
public static void Run(SvPlayer player, string message) { string arg1 = GetArgument.Run(1, false, true, message); if (string.IsNullOrEmpty(arg1)) { arg1 = player.player.username; } var currPlayer = GetShByStr.Run(arg1); if (currPlayer == null) { player.SendChatMessage(NotFoundOnline); return; } ReadFile.Run(GodListFile); var msg = $"<color={infoColor}>Godmode</color> <color={argColor}>{{0}}</color> <color={infoColor}>for</color> <color={argColor}>'{arg1}'</color><color={infoColor}>.</color>"; if (GodListPlayers.Contains(currPlayer.username)) { RemoveStringFromFile.Run(GodListFile, currPlayer.username); ReadFile.Run(GodListFile); player.SendChatMessage(string.Format(msg, "disabled")); return; } File.AppendAllText(GodListFile, currPlayer.username + Environment.NewLine); GodListPlayers.Add(currPlayer.username); player.SendChatMessage(string.Format(msg, "enabled")); }
public static void Run(SvPlayer player, string message) { ReadFile.Run(AfkListFile); if (AfkPlayers.Contains(player.player.username)) { RemoveStringFromFile.Run(AfkListFile, player.player.username); ReadFile.Run(AfkListFile); player.SendChatMessage($"<color={infoColor}>You are no longer AFK.</color>"); } else { File.AppendAllText(AfkListFile, player.player.username + Environment.NewLine); AfkPlayers.Add(player.player.username); player.SendChatMessage($"<color={infoColor}>You are now AFK.</color>"); } }