From b9b6450e95252957368c4d3c74d3cd8f24030290 Mon Sep 17 00:00:00 2001 From: Terminator_97 <50580453+francesco132@users.noreply.github.com> Date: Thu, 16 Apr 2020 18:57:10 +0200 Subject: [PATCH] 1.7.0 --- README.md | 26 ++++++++++++++------------ SCPUtils/Commands.cs | 1 - SCPUtils/Plugin.cs | 8 +++++--- SCPUtils/SCPSpeak.cs | 22 ++++++++++++++++++++++ SCPUtils/SCPUtils.csproj | 1 + 5 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 SCPUtils/SCPSpeak.cs diff --git a/README.md b/README.md index 54ed4d4..1541d0a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ **SCPUtils Plugin**
-Welcome to SCPUtils, this plugin has many features such as welcome messages, decontamination messages, autorestart when only 1 player is present in game and punishements for the ones that quit / suicide as SCP and many others features

+Welcome to SCPUtils, this plugin has many features such as welcome messages, decontamination messages, autorestart when only 1 player is present in game and punishements for the ones that quit / suicide as SCP, temporarily badges, custom nicknames and colors, you can allow specific scps to specific roles to speak to humans using V and much more

Database will get created inside Exiled/SCPUtils folder.

**You must add LiteDB.dll into Plugins/dependencies folder or plugin won't work**

**Required minimum Exiled version: 1.9.10** @@ -19,7 +19,6 @@ Database will get created inside Exiled/SCPUtils folder.

| scputils_decontamination_message_enabled | bool | false | Enable / disable a message when decontamination starts | | scputils_enable_scp_suicide_auto_ban | bool | true | Enable / disable autoban for scp suicides after a certain threshold | | scputils_double_ban_duration_each_ban | bool | true | Multiply ban duration after each ban | -| scputils_reset_preferences_on_badge_expire | bool | true | Reset player preferences when badge expires (custom name, color, showtag) | | scputils_welcome_message | string | Welcome to the server! | Welcome message, Change it! | | scputils_decontamination_message | string | Decontamination has started! | Decontamination message, Change it! | | scputils_auto_restart_message | string | Round Restart:\nRound will be restarted in {0} seconds due lack of players | Autorestart message, {0} is the amount of seconds | @@ -65,18 +64,21 @@ Database will get created inside Exiled/SCPUtils folder.

| scputils_show_badge | none | scputils.badgevisibility | Permanently show your badge | | scputils_hide_badge | none | scputils.badgevisibility | Permanently hide your badge | -Console commands must be executed like .scputils_help in game console (press ò to open it) - -Data stored on database is intended only for internal use, sharing it is a violation of SCP:SL EULA and will cause your server delist.

- -Thanks to iopietro for his advices
- - - - - +**Speak permissions** +| Permisssion | Description | +| ------------- | ------------- | +| scputils_speak.scp049 | Allows to speak with V using this scp | +| scputils_speak.scp0492 | Allows to speak with V using this scp | +| scputils_speak.scp079 | Allows to speak with V using this scp | +| scputils_speak.scp096 | Allows to speak with V using this scp | +| scputils_speak.scp106 | Allows to speak with V using this scp | +| scputils_speak.scp173 | Allows to speak with V using this scp | +Pro tip: use scputils_speak.* to allow someone to speak with all the SCPs, set permission to default role to allow everyone to speak with that scp. +Console commands must be executed like .scputils_help in game console (press ò to open it) +Data stored on database is intended only for internal use, sharing it is a violation of SCP:SL EULA and will cause your server delist.

+Thanks to iopietro for his advices
\ No newline at end of file diff --git a/SCPUtils/Commands.cs b/SCPUtils/Commands.cs index 88ba276..2a21230 100644 --- a/SCPUtils/Commands.cs +++ b/SCPUtils/Commands.cs @@ -321,7 +321,6 @@ private bool IsAllowed(CommandSender sender, string permission) { ReferenceHub player; return sender != null && (sender.SenderId == "GAME CONSOLE" || (player = EXILED.Extensions.Player.GetPlayer(sender.Nickname)) == null || player.CheckPermission(permission)); - } } diff --git a/SCPUtils/Plugin.cs b/SCPUtils/Plugin.cs index ae54b9f..9e1195d 100644 --- a/SCPUtils/Plugin.cs +++ b/SCPUtils/Plugin.cs @@ -10,7 +10,7 @@ namespace SCPUtils public class SCPUtils : Plugin { public static bool IsStarted { get; set; } - public static string pluginVersion = "1.6.3"; + public static string pluginVersion = "1.7.0"; public override string getName { get; } = "SCPUtils"; public EventHandlers EventHandlers { get; private set; } @@ -52,7 +52,8 @@ public class SCPUtils : Plugin public int SCP079TeslaEventWait; public float autoBanThreshold; public float autoKickThreshold; - public List restrictedRoleColors = new List(); + public List restrictedRoleColors = new List(); + public override void OnEnable() { @@ -126,7 +127,7 @@ internal void LoadConfig() decontaminationMessageEnabled = Config.GetBool("scputils_decontamination_message_enabled", false); enableSCPSuicideAutoBan = Config.GetBool("scputils_enable_scp_suicide_auto_ban", true); multiplyBanDurationEachBan = Config.GetBool("scputils_double_ban_duration_each_ban", true); - resetPreferencedOnBadgeExpire = Config.GetBool("scputils_reset_preferences_on_badge_expire", true); + resetPreferencedOnBadgeExpire = Config.GetBool("scputils_reset_preferences_on_badge_expire", true); welcomeMessage = Config.GetString("scputils_welcome_message", "Welcome to the server!"); decontaminationMessage = Config.GetString("scputils_decontamination_message", "Decontamination has started!"); autoRestartMessage = Config.GetString("scputils_auto_restart_message", "Round Restart:\nRestarting round in {0} seconds due lack of players"); @@ -146,6 +147,7 @@ internal void LoadConfig() autoBanThreshold = Config.GetFloat("scputils_auto_ban_threshold", 30.5f); autoKickThreshold = Config.GetFloat("scputils_auto_kick_threshold", 15.5f); restrictedRoleColors = Config.GetStringList("scputils_restricted_role_colors"); + ConfigValidator(); } diff --git a/SCPUtils/SCPSpeak.cs b/SCPUtils/SCPSpeak.cs new file mode 100644 index 0000000..d93defb --- /dev/null +++ b/SCPUtils/SCPSpeak.cs @@ -0,0 +1,22 @@ +using Assets._Scripts.Dissonance; +using Harmony; +using EXILED.Extensions; +using EXILED; + +namespace SCPUtils +{ + [HarmonyPatch(typeof(DissonanceUserSetup), nameof(DissonanceUserSetup.CallCmdAltIsActive))] + public class SCPSpeak + { + public static void Prefix(DissonanceUserSetup __instance, bool value) + { + var player = EXILED.Extensions.Player.GetPlayer(__instance.gameObject); + if (player.CheckPermission($"scputils_speak.{player.GetRole().ToString().ToLower()}")) + { + __instance.MimicAs939 = value; + } + + } + + } +} \ No newline at end of file diff --git a/SCPUtils/SCPUtils.csproj b/SCPUtils/SCPUtils.csproj index b3bbdb4..00d7901 100644 --- a/SCPUtils/SCPUtils.csproj +++ b/SCPUtils/SCPUtils.csproj @@ -75,6 +75,7 @@ +