@@ -40,6 +40,21 @@ public override void LoadPlugin()
4040 ChatManager . onCheckPermissions = Chat_OnCheckPermissions ;
4141
4242 LoadCurrentPlayers ( ) ;
43+
44+ Level . onLevelLoaded += OnLevelloaded ;
45+
46+ if ( ! Config . DelayStartEXECUtility )
47+ {
48+ execManager . Activate ( ) ;
49+ }
50+ }
51+
52+ private void OnLevelloaded ( int level )
53+ {
54+ if ( State == PluginState . Loaded && Config . DelayStartEXECUtility )
55+ {
56+ execManager . Activate ( ) ;
57+ }
4358 }
4459
4560 private void Chat_CheckCommand ( SteamPlayer Player , string Command )
@@ -208,7 +223,9 @@ public bool PlayerMuteExpired(PlayerData Data)
208223 { "SetAttachment_Fail_Item" , "Failed to find item." } ,
209224 { "SetAttachment_Fail_Blacklist" , "This attachment is blacklisted." } ,
210225 { "SetAttachment_GaveAttachment" , "Gave your gun {0}." } ,
211- { "Fail_Command_Disabled" , "This command is disabled." }
226+ { "Fail_Command_Disabled" , "This command is disabled." } ,
227+ { "Exec_Fail_NoPlayer" , "Failed to find player." } ,
228+ { "Exec_Fail_NotActive" , "ERROR: The EXEC Permissions utility is not active. Try restarting the server." }
212229 } ;
213230
214231 private void UnturnedPlayerEvents_OnPlayerUpdateGesture( UnturnedPlayer player , Rocket . Unturned . Events . UnturnedPlayerEvents . PlayerGesture gesture )
@@ -218,6 +235,7 @@ private void UnturnedPlayerEvents_OnPlayerUpdateGesture(UnturnedPlayer player, R
218235 PointToolManager. ManageGestureUpdate ( player , gesture ) ;
219236 }
220237 }
238+
221239 private void Events_OnBeforePlayerConnected( UnturnedPlayer player )
222240 {
223241 PlayerSessionStore. TryRegisterPlayer ( player ) ;
@@ -250,6 +268,8 @@ public void LoadCurrentPlayers()
250268
251269 public override void UnloadPlugin( PluginState state = PluginState. Unloaded)
252270 {
271+ execManager . Deactivate ( ) ;
272+ Level. onLevelLoaded -= OnLevelloaded ;
253273 U. Events . OnBeforePlayerConnected -= Events_OnBeforePlayerConnected ;
254274 U. Events . OnPlayerDisconnected -= Events_OnPlayerDisconnected ;
255275 VehicleManager. onEnterVehicleRequested -= VehicleManager_onEnterVehicleRequested ;
0 commit comments