Skip to content

Commit

Permalink
1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
terminator-97 committed Apr 16, 2020
1 parent eeadcde commit b9b6450
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 16 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**SCPUtils Plugin**<br />

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 <br /><br />
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 <br /><br />
Database will get created inside Exiled/SCPUtils folder.<br /><br />
**You must add LiteDB.dll into Plugins/dependencies folder or plugin won't work**<br /><br />
**Required minimum Exiled version: 1.9.10**
Expand All @@ -19,7 +19,6 @@ Database will get created inside Exiled/SCPUtils folder.<br /><br />
| 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 | <color=red>Round Restart:</color>\n<color=yellow>Round will be restarted in {0} seconds due lack of players</color> | Autorestart message, {0} is the amount of seconds |
Expand Down Expand Up @@ -65,18 +64,21 @@ Database will get created inside Exiled/SCPUtils folder.<br /><br />
| 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.<br /><br />

Thanks to iopietro for his advices<br />





**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.<br /><br />

Thanks to iopietro for his advices<br />
1 change: 0 additions & 1 deletion SCPUtils/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

}
}

Expand Down
8 changes: 5 additions & 3 deletions SCPUtils/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -52,7 +52,8 @@ public class SCPUtils : Plugin
public int SCP079TeslaEventWait;
public float autoBanThreshold;
public float autoKickThreshold;
public List<string> restrictedRoleColors = new List<string>();
public List<string> restrictedRoleColors = new List<string>();


public override void OnEnable()
{
Expand Down Expand Up @@ -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", "<color=red>Round Restart:</color>\n<color=yellow>Restarting round in {0} seconds due lack of players</color>");
Expand All @@ -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();
}

Expand Down
22 changes: 22 additions & 0 deletions SCPUtils/SCPSpeak.cs
Original file line number Diff line number Diff line change
@@ -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;
}

}

}
}
1 change: 1 addition & 0 deletions SCPUtils/SCPUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SCPSpeak.cs" />
<Compile Include="ConsoleCommands.cs" />
<Compile Include="Database.cs" />
<Compile Include="DatabasePlayer.cs" />
Expand Down

0 comments on commit b9b6450

Please sign in to comment.