Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SuperAdminMenu v1.0.4
BepInEx\plugins\SuperAdminMenu\SuperAdminMenu.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SuperAdminMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SuperAdminMenu")] [assembly: AssemblyTitle("SuperAdminMenu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SuperAdminMenu { public class AdminMenuGUI : MonoBehaviour { private bool _visible; private int _tab; private Rect _windowRect = new Rect(50f, 30f, 480f, 700f); private readonly string[] _tabNames = new string[6] { "SELF", "PLAYERS", "ITEMS", "KEYS", "SETTINGS", "INFO" }; private static readonly Color C_Bg = new Color(0.07f, 0.06f, 0.11f, 0.97f); private static readonly Color C_BgPanel = new Color(0.1f, 0.09f, 0.15f, 1f); private static readonly Color C_BgCard = new Color(0.13f, 0.12f, 0.2f, 1f); private static readonly Color C_Accent = new Color(0.55f, 0.35f, 0.85f, 1f); private static readonly Color C_AccentH = new Color(0.65f, 0.45f, 0.95f, 1f); private static readonly Color C_AccentDim = new Color(0.35f, 0.22f, 0.55f, 1f); private static readonly Color C_On = new Color(0.65f, 0.4f, 0.95f, 1f); private static readonly Color C_OnH = new Color(0.75f, 0.5f, 1f, 1f); private static readonly Color C_Red = new Color(0.6f, 0.18f, 0.18f, 1f); private static readonly Color C_RedH = new Color(0.75f, 0.25f, 0.25f, 1f); private static readonly Color C_Text = new Color(0.92f, 0.9f, 0.95f); private static readonly Color C_TextDim = new Color(0.55f, 0.52f, 0.62f); private static readonly Color C_TextAcc = new Color(0.75f, 0.6f, 1f); private static readonly Color C_Sep = new Color(0.22f, 0.2f, 0.3f, 1f); private GUIStyle _sWin; private GUIStyle _sTitle; private GUIStyle _sSection; private GUIStyle _sLabel; private GUIStyle _sDim; private GUIStyle _sCenter; private GUIStyle _sBtnOn; private GUIStyle _sBtnOff; private GUIStyle _sBtnAct; private GUIStyle _sBtnDng; private GUIStyle _sBtnSm; private GUIStyle _sBtnTab; private GUIStyle _sBtnTabA; private GUIStyle _sBtnBind; private GUIStyle _sBtnBindW; private GUIStyle _sSlider; private GUIStyle _sThumb; private GUIStyle _sSearch; private GUIStyle _sLogo; private GUIStyle _sLink; private GUIStyle _sInfoVal; private bool _stylesReady; private Dictionary<long, Texture2D> _texCache = new Dictionary<long, Texture2D>(); private Vector2 _scrollPlayers; private Vector2 _scrollItems; private Vector2 _scrollMobs; private string _itemSearch = ""; private NetworkManager _lastNM; private float _permsSyncTimer; private Texture2D _logoTex; private Texture2D _bgTex; private Texture2D _shadowTex; private Texture2D _accentTex; private Texture2D _sepTex; private Texture2D _bgCardTex; private string _waitingForBind; private Dictionary<string, Texture2D> _itemIconCache = new Dictionary<string, Texture2D>(); private Dictionary<string, Texture2D> _allIcons = new Dictionary<string, Texture2D>(); private Dictionary<string, Texture2D> _mobIcons = new Dictionary<string, Texture2D>(); private Dictionary<string, Texture2D> _mobIconCache = new Dictionary<string, Texture2D>(); private bool _iconsLoaded; private bool _mobIconsLoaded; private PlayerControllerB _mobSelectTarget; private bool _showMobSelect; private ushort _lastPerms = ushort.MaxValue; private static readonly Dictionary<string, string> MobNameMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) { { "Centipede", "snare_flea" }, { "SnareFlea", "snare_flea" }, { "Bunker Spider", "bunker_spider" }, { "SandSpider", "bunker_spider" }, { "Hoarding bug", "hoarding_bug" }, { "HoarderBug", "hoarding_bug" }, { "Flowerman", "bracken" }, { "Bracken", "bracken" }, { "Crawler", "thumper" }, { "Thumper", "thumper" }, { "Blob", "hygrodere" }, { "Hygrodere", "hygrodere" }, { "Girl", "ghost_girl" }, { "DressGirl", "ghost_girl" }, { "Ghost Girl", "ghost_girl" }, { "Puffer", "spore_lizard" }, { "Spore Lizard", "spore_lizard" }, { "Nutcracker", "nutcracker" }, { "Jester", "jester" }, { "Coil-Head", "coil_head" }, { "CoilHead", "coil_head" }, { "Spring", "coil_head" }, { "MouthDog", "eyeless_dog" }, { "Eyeless Dog", "eyeless_dog" }, { "ForestGiant", "forest_keeper" }, { "Forest Keeper", "forest_keeper" }, { "Earth Leviathan", "earth_leviathan" }, { "Sandworm", "earth_leviathan" }, { "Baboon hawk", "baboon_hawk" }, { "BaboonHawk", "baboon_hawk" }, { "Old Bird", "old_bird" }, { "RadMech", "old_bird" }, { "Tulip Snake", "tulip_snake" }, { "FlowerSnake", "tulip_snake" }, { "Kidnapper Fox", "kidnapper_fox" }, { "Bush Wolf", "kidnapper_fox" }, { "BushWolf", "kidnapper_fox" }, { "Circuit Bees", "circuit_bees" }, { "Red Locust Bees", "circuit_bees" }, { "DocileLocustBees", "circuit_bees" }, { "Masked", "masked" }, { "MaskedPlayer", "masked" }, { "Barber", "barber" }, { "ClaySurgeon", "barber" }, { "Butler", "butler" }, { "ButlerBees", "butler" }, { "Maneater", "maneater" }, { "CaveDweller", "maneater" } }; private void Start() { LoadLogo(); PreloadIcons(); PreloadMobIcons(); } private void Update() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (_waitingForBind != null) { Keyboard current = Keyboard.current; if (current == null) { return; } Enumerator<KeyControl> enumerator = current.allKeys.GetEnumerator(); try { while (enumerator.MoveNext()) { KeyControl current2 = enumerator.Current; if (((ButtonControl)current2).wasPressedThisFrame) { KeyCode val = InputHelper.KeyToKeyCode(current2.keyCode); if ((int)val == 27) { SetKeybind(_waitingForBind, (KeyCode)0); _waitingForBind = null; } else if ((int)val != 0) { SetKeybind(_waitingForBind, val); _waitingForBind = null; } break; } } return; } finally { ((IDisposable)enumerator).Dispose(); } } if (InputHelper.GetKeyDown(SAMPlugin.KeyMenu.Value)) { _visible = !_visible; Cursor.lockState = (CursorLockMode)((!_visible) ? 1 : 0); Cursor.visible = _visible; } if (!_visible) { TryBind(SAMPlugin.KeyNoclip, ref FeatureManager.NoclipEnabled, "Noclip"); TryBind(SAMPlugin.KeyFastRun, ref FeatureManager.FastRunEnabled, "Fast Run"); TryBind(SAMPlugin.KeyInfStamina, ref FeatureManager.InfiniteStaminaEnabled, "Stamina Infinie"); TryBind(SAMPlugin.KeySuperJump, ref FeatureManager.SuperJumpEnabled, "Super Jump"); TryBind(SAMPlugin.KeyExtraJump, ref FeatureManager.ExtraJumpEnabled, "Double Saut"); } NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton != (Object)null && ((Object)(object)singleton != (Object)(object)_lastNM || !NetworkMessenger.HandlersRegistered)) { NetworkMessenger.RegisterHandlers(); if (NetworkMessenger.HandlersRegistered) { _lastNM = singleton; } _permsSyncTimer = 0f; } if (NetworkHelper.IsHost() && (Object)(object)singleton != (Object)null && singleton.IsListening) { _permsSyncTimer -= Time.deltaTime; if (_permsSyncTimer <= 0f) { NetworkMessenger.BroadcastPermissions(); _permsSyncTimer = 5f; } } FeatureManager.Tick(); } private void TryBind(ConfigEntry<KeyCode> b, ref bool f, string n) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if ((int)b.Value != 0 && InputHelper.GetKeyDown(b.Value)) { f = !f; HUDManager instance = HUDManager.Instance; if (instance != null) { instance.DisplayTip("SAM", n + " : " + (f ? "ON" : "OFF"), false, false, "__general"); } } } private void OnGUI() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (_visible) { InitStyles(); if ((Object)(object)_bgTex == (Object)null) { _bgTex = MakeTex(1, 1, C_Bg); } GUI.DrawTexture(new Rect(((Rect)(ref _windowRect)).x + 5f, ((Rect)(ref _windowRect)).y + 5f, ((Rect)(ref _windowRect)).width, ((Rect)(ref _windowRect)).height), (Texture)(object)_shadowTex); GUI.DrawTexture(_windowRect, (Texture)(object)_bgTex); GUI.DrawTexture(new Rect(((Rect)(ref _windowRect)).x, ((Rect)(ref _windowRect)).y, ((Rect)(ref _windowRect)).width, 2f), (Texture)(object)_accentTex); GUI.backgroundColor = Color.white; _windowRect = GUI.Window(9988, _windowRect, new WindowFunction(DrawWindow), "", _sWin); } } private void InitStyles() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Expected O, but got Unknown //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Expected O, but got Unknown //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Expected O, but got Unknown //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Expected O, but got Unknown //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Expected O, but got Unknown //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Expected O, but got Unknown //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Expected O, but got Unknown //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Expected O, but got Unknown //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) if (!_stylesReady) { _stylesReady = true; Texture2D t = MakeTex(1, 1, C_Bg); _sWin = new GUIStyle(GUI.skin.window); AllBg(_sWin, t); _sWin.padding = new RectOffset(18, 18, 10, 12); _sTitle = MkLabel(16, (FontStyle)1, C_Text, (TextAnchor)3); _sSection = MkLabel(12, (FontStyle)1, C_TextAcc, (TextAnchor)3); _sSection.margin = new RectOffset(0, 0, 0, 0); _sSection.padding = new RectOffset(0, 0, 0, 0); _sLabel = MkLabel(12, (FontStyle)0, C_Text, (TextAnchor)3); _sDim = MkLabel(10, (FontStyle)0, C_TextDim, (TextAnchor)5); _sCenter = MkLabel(11, (FontStyle)0, C_TextDim, (TextAnchor)4); _sBtnTab = MkRoundBtn(C_BgPanel, new Color(0.16f, 0.14f, 0.24f), C_TextDim, 11, bold: false, 6); _sBtnTabA = MkRoundBtn(C_AccentDim, C_Accent, C_Text, 11, bold: true, 6); _sBtnOn = MkRoundBtn(C_On, C_OnH, C_Text, 12, bold: true, 5); _sBtnOn.alignment = (TextAnchor)3; _sBtnOn.padding = new RectOffset(18, 14, 0, 0); _sBtnOff = MkRoundBtn(C_BgCard, new Color(0.18f, 0.16f, 0.26f), C_TextDim, 12, bold: false, 5); _sBtnOff.alignment = (TextAnchor)3; _sBtnOff.padding = new RectOffset(18, 14, 0, 0); _sBtnAct = MkRoundBtn(C_AccentDim, C_Accent, C_Text, 12, bold: true, 5); _sBtnDng = MkRoundBtn(C_Red, C_RedH, C_Text, 12, bold: true, 5); _sBtnSm = MkRoundBtn(new Color(0.15f, 0.13f, 0.22f), new Color(0.22f, 0.2f, 0.32f), C_TextDim, 10, bold: false, 4); _sBtnBind = MkRoundBtn(new Color(0.12f, 0.1f, 0.2f), new Color(0.18f, 0.16f, 0.28f), C_TextAcc, 11, bold: false, 5); _sBtnBindW = MkRoundBtn(C_Accent, C_AccentH, C_Text, 11, bold: true, 5); Texture2D t2 = MakeRounded(200, 8, 4, new Color(0.18f, 0.16f, 0.26f)); _sSlider = new GUIStyle(GUI.skin.horizontalSlider); AllBg(_sSlider, t2); _sSlider.fixedHeight = 8f; _sSlider.margin = new RectOffset(0, 0, 10, 10); _sSlider.border = new RectOffset(4, 4, 0, 0); Texture2D t3 = MakeCircle(16, C_Accent); Texture2D background = MakeCircle(16, C_AccentH); _sThumb = new GUIStyle(GUI.skin.horizontalSliderThumb); AllBg(_sThumb, t3); _sThumb.hover.background = background; _sThumb.active.background = background; _sThumb.fixedWidth = 16f; _sThumb.fixedHeight = 16f; _sThumb.overflow = new RectOffset(0, 0, 4, 4); _sSearch = new GUIStyle(GUI.skin.textField); _sSearch.normal.background = MakeRounded(200, 24, 6, C_BgCard); _sSearch.focused.background = MakeRounded(200, 24, 6, new Color(0.16f, 0.14f, 0.24f)); _sSearch.normal.textColor = C_Text; _sSearch.fontSize = 12; _sSearch.padding = new RectOffset(10, 10, 4, 4); _sSearch.border = new RectOffset(6, 6, 6, 6); _sLogo = MkLabel(18, (FontStyle)1, new Color(0.72f, 0.68f, 0.8f), (TextAnchor)4); _sLink = MkLabel(10, (FontStyle)0, C_Accent, (TextAnchor)4); _sInfoVal = MkLabel(12, (FontStyle)0, C_Text, (TextAnchor)5); Texture2D t4 = MakeRounded(8, 100, 4, new Color(0.1f, 0.09f, 0.15f, 0.5f)); Texture2D t5 = MakeRounded(8, 40, 4, C_AccentDim); Texture2D background2 = MakeRounded(8, 40, 4, C_Accent); GUI.skin.verticalScrollbar.fixedWidth = 6f; AllBg(GUI.skin.verticalScrollbar, t4); GUI.skin.verticalScrollbar.border = new RectOffset(0, 0, 4, 4); GUI.skin.verticalScrollbarThumb.fixedWidth = 6f; AllBg(GUI.skin.verticalScrollbarThumb, t5); GUI.skin.verticalScrollbarThumb.hover.background = background2; GUI.skin.verticalScrollbarThumb.active.background = background2; GUI.skin.verticalScrollbarThumb.border = new RectOffset(0, 0, 4, 4); GUI.skin.verticalScrollbarUpButton.fixedHeight = 0f; GUI.skin.verticalScrollbarDownButton.fixedHeight = 0f; _shadowTex = MakeTex(1, 1, new Color(0f, 0f, 0f, 0.4f)); _accentTex = MakeTex(1, 1, C_Accent); _sepTex = MakeTex(1, 1, C_Sep); _bgCardTex = MakeTex(1, 1, C_BgCard); } } private void DrawWindow(int id) { //IL_0192: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(4f); GUILayout.Label("SUPER ADMIN MENU", _sTitle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.FlexibleSpace(); if (GUILayout.Button("x", _sBtnSm, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(26f), GUILayout.Height(26f) })) { _visible = false; Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; } GUILayout.EndHorizontal(); GUILayout.Space(6f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); for (int i = 0; i < _tabNames.Length; i++) { if (GUILayout.Button(_tabNames[i], (i == _tab) ? _sBtnTabA : _sBtnTab, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { _tab = i; } if (i < _tabNames.Length - 1) { GUILayout.Space(3f); } } GUILayout.EndHorizontal(); GUILayout.Space(8f); if (_tab == 0) { DrawMoi(); } else if (_tab == 1) { DrawJoueurs(); } else if (_tab == 2) { DrawObjets(); } else if (_tab == 3) { DrawKeybinds(); } else if (_tab == 4) { DrawSettings(); } else { DrawInfo(); } GUILayout.FlexibleSpace(); DrawFooter(); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width, 34f)); } private void DrawMoi() { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) Section("MONEY"); if (FeatureManager.IsAllowed(FeatureManager.PermMoney)) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button("+$1 000", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { FeatureManager.AddMoney(1000); } GUILayout.Space(4f); if (GUILayout.Button("+$5 000", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { FeatureManager.AddMoney(5000); } GUILayout.Space(4f); if (GUILayout.Button("+$50 000", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { FeatureManager.AddMoney(50000); } GUILayout.EndHorizontal(); } else { GUILayout.Label("Disabled by host", _sCenter, Array.Empty<GUILayoutOption>()); } Section("SUITS"); if (FeatureManager.IsAllowed(FeatureManager.PermSuits)) { if (GUILayout.Button("Unlock All Suits", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { FeatureManager.UnlockAllSuits(); } } else { GUILayout.Label("Disabled by host", _sCenter, Array.Empty<GUILayoutOption>()); } Section("MOVEMENT"); if (FeatureManager.IsAllowed(FeatureManager.PermNoclip)) { FeatureManager.NoclipEnabled = ToggleBind("Noclip", FeatureManager.NoclipEnabled, SAMPlugin.KeyNoclip.Value); if (FeatureManager.NoclipEnabled) { FeatureManager.NoclipSpeed = Slider("Speed", FeatureManager.NoclipSpeed, 5f, 50f); } } else { GUILayout.Label("Noclip disabled by host", _sCenter, Array.Empty<GUILayoutOption>()); } if (FeatureManager.IsAllowed(FeatureManager.PermFastRun)) { FeatureManager.FastRunEnabled = ToggleBind("Fast Run", FeatureManager.FastRunEnabled, SAMPlugin.KeyFastRun.Value); if (FeatureManager.FastRunEnabled) { FeatureManager.FastRunSpeed = Slider("Speed", FeatureManager.FastRunSpeed, 5f, 50f); } } if (FeatureManager.IsAllowed(FeatureManager.PermSuperJump)) { FeatureManager.SuperJumpEnabled = ToggleBind("Super Jump", FeatureManager.SuperJumpEnabled, SAMPlugin.KeySuperJump.Value); if (FeatureManager.SuperJumpEnabled) { FeatureManager.SuperJumpForce = Slider("Force", FeatureManager.SuperJumpForce, 15f, 150f); } } if (FeatureManager.IsAllowed(FeatureManager.PermDoubleJump)) { FeatureManager.ExtraJumpEnabled = ToggleBind("Double Jump", FeatureManager.ExtraJumpEnabled, SAMPlugin.KeyExtraJump.Value); } if (FeatureManager.IsAllowed(FeatureManager.PermInfStamina)) { FeatureManager.InfiniteStaminaEnabled = ToggleBind("Infinite Stamina", FeatureManager.InfiniteStaminaEnabled, SAMPlugin.KeyInfStamina.Value); } Section("SURVIVAL"); if (FeatureManager.IsAllowed(FeatureManager.PermGodMode)) { FeatureManager.GodModeEnabled = Toggle("God Mode", FeatureManager.GodModeEnabled); } if (FeatureManager.IsAllowed(FeatureManager.PermNoFallDmg)) { FeatureManager.NoFallDamageEnabled = Toggle("No Fall Damage", FeatureManager.NoFallDamageEnabled); } Section("VISION"); if (FeatureManager.IsAllowed(FeatureManager.PermBright)) { FeatureManager.BrightModeEnabled = Toggle("Bright", FeatureManager.BrightModeEnabled); } GUILayout.Space(6f); GUILayout.Label("Noclip: hold Shift = 2x speed", _sCenter, Array.Empty<GUILayoutOption>()); } private void DrawJoueurs() { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) if (_showMobSelect) { if (!((Object)(object)_mobSelectTarget == (Object)null) && !_mobSelectTarget.isPlayerDead) { DrawMobSelect(); return; } _showMobSelect = false; _mobSelectTarget = null; } Section("TROLL OPTIONS"); GUILayout.Label("All players must have the mod installed", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); if ((Object)(object)StartOfRound.Instance == (Object)null) { GUILayout.Label("Not in game.", _sCenter, Array.Empty<GUILayoutOption>()); return; } if (FeatureManager.IsAllowed(FeatureManager.PermClearMobs)) { if (GUILayout.Button("Clear All Mobs", _sBtnDng, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { FeatureManager.ClearAllMobs(); } GUILayout.Space(4f); } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; _scrollPlayers = GUILayout.BeginScrollView(_scrollPlayers, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); PlayerControllerB[] array = allPlayerScripts; foreach (PlayerControllerB val2 in array) { if ((Object)(object)val2 == (Object)null || (!val2.isPlayerControlled && !val2.isPlayerDead)) { continue; } bool flag = (Object)(object)val2 == (Object)(object)val; bool isPlayerDead = val2.isPlayerDead; GUILayout.Space(3f); if (isPlayerDead) { GUI.color = new Color(0.5f, 0.3f, 0.3f); } else { GUI.color = (flag ? new Color(0.7f, 0.55f, 1f) : new Color(1f, 0.85f, 0.5f)); } GUILayout.Label(isPlayerDead ? (val2.playerUsername + " (DEAD)") : (flag ? (val2.playerUsername + " (you)") : val2.playerUsername), _sLabel, Array.Empty<GUILayoutOption>()); GUI.color = Color.white; if (!isPlayerDead) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); if (!flag) { if (FeatureManager.IsAllowed(FeatureManager.PermFreeze)) { if (GUILayout.Button("Freeze", _sBtnDng, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { NetworkMessenger.SendFreezePlayer(val2); } GUILayout.Space(3f); } if (FeatureManager.IsAllowed(FeatureManager.PermTeleport)) { if (GUILayout.Button("TP to", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { FeatureManager.TeleportToPlayer(val2); } GUILayout.Space(3f); } if (FeatureManager.IsAllowed(FeatureManager.PermTeleport) && GUILayout.Button("TP to me", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { NetworkMessenger.SendTeleportToMe(val2); } } GUILayout.Space(10f); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); if (FeatureManager.IsAllowed(FeatureManager.PermSpawnMob)) { if (GUILayout.Button("Spawn Mob", _sBtnDng, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _mobSelectTarget = val2; _showMobSelect = true; _scrollMobs = Vector2.zero; } GUILayout.Space(3f); } GUILayout.Space(10f); GUILayout.EndHorizontal(); } GUILayout.Space(3f); Sep(); } GUILayout.EndScrollView(); } private void DrawMobSelect() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_mobSelectTarget == (Object)null) { _showMobSelect = false; return; } GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button("< Back", _sBtnSm, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) })) { _showMobSelect = false; _mobSelectTarget = null; } GUILayout.Space(6f); GUILayout.Label("Spawn on: " + _mobSelectTarget.playerUsername, _sTitle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.EndHorizontal(); GUILayout.Space(6f); RoundManager instance = RoundManager.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.currentLevel == (Object)null) { GUILayout.Label("Not in a round.", _sCenter, Array.Empty<GUILayoutOption>()); return; } bool isInsideFactory = _mobSelectTarget.isInsideFactory; List<SpawnableEnemyWithRarity> enemies = instance.currentLevel.Enemies; List<SpawnableEnemyWithRarity> outsideEnemies = instance.currentLevel.OutsideEnemies; _scrollMobs = GUILayout.BeginScrollView(_scrollMobs, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); if (enemies != null && enemies.Count > 0) { Section("INDOOR ENEMIES"); if (!isInsideFactory) { GUILayout.Label("Player is outside — indoor mobs may not work", _sCenter, Array.Empty<GUILayoutOption>()); } for (int i = 0; i < enemies.Count; i++) { SpawnableEnemyWithRarity val = enemies[i]; if (!((Object)(object)val.enemyType == (Object)null)) { DrawMobRow(val.enemyType.enemyName, _mobSelectTarget, indoor: true, i); } } } GUILayout.Space(4f); if (outsideEnemies != null && outsideEnemies.Count > 0) { Section("OUTDOOR ENEMIES"); if (isInsideFactory) { GUILayout.Label("Player is inside — outdoor mobs may not work", _sCenter, Array.Empty<GUILayoutOption>()); } for (int j = 0; j < outsideEnemies.Count; j++) { SpawnableEnemyWithRarity val2 = outsideEnemies[j]; if (!((Object)(object)val2.enemyType == (Object)null)) { DrawMobRow(val2.enemyType.enemyName, _mobSelectTarget, indoor: false, j); } } } GUILayout.EndScrollView(); } private void DrawMobRow(string name, PlayerControllerB target, bool indoor, int idx) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(2f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); Texture2D mobIcon = GetMobIcon(name); Rect rect = GUILayoutUtility.GetRect(38f, 38f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(38f), GUILayout.Height(38f) }); GUI.DrawTexture(rect, (Texture)(object)_bgCardTex); if ((Object)(object)mobIcon != (Object)null) { GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), (Texture)(object)mobIcon, (ScaleMode)2); } GUILayout.Space(8f); GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); GUILayout.Label(name, _sLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) }); GUILayout.FlexibleSpace(); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Spawn", _sBtnDng, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(32f) })) { FeatureManager.SpawnSpecificMob(target, indoor, idx); } GUILayout.EndHorizontal(); Sep(); } private void DrawObjets() { //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) Section("SPAWN SCRAP"); GUILayout.Label("Spawns in front of you", _sCenter, Array.Empty<GUILayoutOption>()); if (!FeatureManager.IsAllowed(FeatureManager.PermSpawnScrap)) { GUILayout.Label("Disabled by host", _sCenter, Array.Empty<GUILayoutOption>()); return; } GUILayout.Space(6f); if ((Object)(object)StartOfRound.Instance == (Object)null) { GUILayout.Label("Not in game.", _sCenter, Array.Empty<GUILayoutOption>()); return; } GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("Search", _sLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); _itemSearch = GUILayout.TextField(_itemSearch, _sSearch, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); if (_itemSearch.Length > 0 && GUILayout.Button("x", _sBtnSm, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(26f), GUILayout.Height(26f) })) { _itemSearch = ""; } GUILayout.EndHorizontal(); GUILayout.Space(4f); Sep(); List<Item> scrapItems = FeatureManager.GetScrapItems(); _scrollItems = GUILayout.BeginScrollView(_scrollItems, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); int num = 0; foreach (Item item in scrapItems) { if (!string.IsNullOrEmpty(_itemSearch) && item.itemName.ToLower().IndexOf(_itemSearch.ToLower()) < 0) { continue; } GUILayout.Space(2f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); Texture2D icon = GetIcon(item); Rect rect = GUILayoutUtility.GetRect(38f, 38f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(38f), GUILayout.Height(38f) }); GUI.DrawTexture(rect, (Texture)(object)_bgCardTex); if ((Object)(object)icon != (Object)null) { GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), (Texture)(object)icon, (ScaleMode)2); } GUILayout.Space(6f); GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUILayout.Space(4f); GUILayout.Label(item.itemName, _sLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(18f) }); GUILayout.Label($"${item.minValue} - ${item.maxValue}", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(14f) }); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Spawn", _sBtnAct, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(65f), GUILayout.Height(32f) })) { FeatureManager.SpawnScrapItem(item); } GUILayout.Space(3f); if (GUILayout.Button("x5", _sBtnSm, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(30f), GUILayout.Height(32f) })) { for (int i = 0; i < 5; i++) { FeatureManager.SpawnScrapItem(item); } } GUILayout.EndHorizontal(); Sep(); num++; } if (num == 0) { GUILayout.Label("No items found.", _sCenter, Array.Empty<GUILayoutOption>()); } GUILayout.EndScrollView(); } private void DrawKeybinds() { Section("KEYBINDINGS"); GUILayout.Label("Click then press a key | Escape = unbind", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); BindRow("Menu", "Menu", SAMPlugin.KeyMenu); BindRow("Noclip", "Noclip", SAMPlugin.KeyNoclip); BindRow("Fast Run", "FastRun", SAMPlugin.KeyFastRun); BindRow("Infinite Stamina", "InfStamina", SAMPlugin.KeyInfStamina); BindRow("Super Jump", "SuperJump", SAMPlugin.KeySuperJump); BindRow("Double Jump", "ExtraJump", SAMPlugin.KeyExtraJump); } private void BindRow(string label, string name, ConfigEntry<KeyCode> e) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); GUILayout.Label(label, _sLabel, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(140f), GUILayout.Height(34f) }); bool flag = _waitingForBind == name; object obj; if (!flag) { if ((int)e.Value != 0) { KeyCode value = e.Value; obj = ((object)(KeyCode)(ref value)).ToString(); } else { obj = "Not set"; } } else { obj = "...press a key..."; } if (GUILayout.Button((string)obj, flag ? _sBtnBindW : _sBtnBind, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(34f), GUILayout.ExpandWidth(true) })) { _waitingForBind = (flag ? null : name); } GUILayout.Space(10f); GUILayout.EndHorizontal(); GUILayout.Space(4f); } private void SetKeybind(string n, KeyCode k) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) switch (n) { case "Menu": SAMPlugin.KeyMenu.Value = k; break; case "Noclip": SAMPlugin.KeyNoclip.Value = k; break; case "FastRun": SAMPlugin.KeyFastRun.Value = k; break; case "InfStamina": SAMPlugin.KeyInfStamina.Value = k; break; case "SuperJump": SAMPlugin.KeySuperJump.Value = k; break; case "ExtraJump": SAMPlugin.KeyExtraJump.Value = k; break; } ((BaseUnityPlugin)SAMPlugin.Instance).Config.Save(); } private void DrawSettings() { if (!NetworkHelper.IsHost()) { Section("PERMISSIONS"); GUILayout.Label("Only the HOST can change settings.", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); GUILayout.Label("Current permissions from host:", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Space(4f); PermLabel("Noclip", FeatureManager.PermNoclip); PermLabel("Fast Run", FeatureManager.PermFastRun); PermLabel("Super Jump", FeatureManager.PermSuperJump); PermLabel("Double Jump", FeatureManager.PermDoubleJump); PermLabel("Infinite Stamina", FeatureManager.PermInfStamina); PermLabel("God Mode", FeatureManager.PermGodMode); PermLabel("No Fall Damage", FeatureManager.PermNoFallDmg); PermLabel("Bright", FeatureManager.PermBright); Sep(); PermLabel("Money", FeatureManager.PermMoney); PermLabel("Suits", FeatureManager.PermSuits); PermLabel("Spawn Mob", FeatureManager.PermSpawnMob); PermLabel("Clear Mobs", FeatureManager.PermClearMobs); PermLabel("Spawn Scrap", FeatureManager.PermSpawnScrap); Sep(); PermLabel("Freeze", FeatureManager.PermFreeze); PermLabel("Teleport", FeatureManager.PermTeleport); return; } Section("PLAYER PERMISSIONS"); GUILayout.Label("Allow or block features for other players.", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); Section("CLIENT-SIDE"); FeatureManager.PermNoclip = Toggle("Noclip", FeatureManager.PermNoclip); FeatureManager.PermFastRun = Toggle("Fast Run", FeatureManager.PermFastRun); FeatureManager.PermSuperJump = Toggle("Super Jump", FeatureManager.PermSuperJump); FeatureManager.PermDoubleJump = Toggle("Double Jump", FeatureManager.PermDoubleJump); FeatureManager.PermInfStamina = Toggle("Infinite Stamina", FeatureManager.PermInfStamina); FeatureManager.PermGodMode = Toggle("God Mode", FeatureManager.PermGodMode); FeatureManager.PermNoFallDmg = Toggle("No Fall Damage", FeatureManager.PermNoFallDmg); FeatureManager.PermBright = Toggle("Bright", FeatureManager.PermBright); Section("HOST ACTIONS"); FeatureManager.PermMoney = Toggle("Money", FeatureManager.PermMoney); FeatureManager.PermSuits = Toggle("Suits", FeatureManager.PermSuits); FeatureManager.PermSpawnMob = Toggle("Spawn Mob", FeatureManager.PermSpawnMob); FeatureManager.PermClearMobs = Toggle("Clear Mobs", FeatureManager.PermClearMobs); FeatureManager.PermSpawnScrap = Toggle("Spawn Scrap", FeatureManager.PermSpawnScrap); Section("MULTIPLAYER"); FeatureManager.PermFreeze = Toggle("Freeze", FeatureManager.PermFreeze); FeatureManager.PermTeleport = Toggle("Teleport", FeatureManager.PermTeleport); ushort num = FeatureManager.PackPermissions(); if (num != _lastPerms) { _lastPerms = num; NetworkMessenger.BroadcastPermissions(); } } private void PermLabel(string name, bool allowed) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(14f); GUILayout.Label(name, _sLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }); GUILayout.FlexibleSpace(); GUI.color = (allowed ? new Color(0.4f, 0.9f, 0.4f) : new Color(0.9f, 0.3f, 0.3f)); GUILayout.Label(allowed ? "Allowed" : "Blocked", _sInfoVal, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(80f), GUILayout.Height(22f) }); GUI.color = Color.white; GUILayout.Space(14f); GUILayout.EndHorizontal(); } private void DrawInfo() { Section("MOD INFO"); InfoRow("Name", "Super Admin Menu"); InfoRow("Version", "1.0.4"); InfoRow("Author", "Swif2D"); InfoRow("Game", "Lethal Company"); Section("IMPORTANT"); GUILayout.Label("Most features only work as HOST.", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Label("The host has full control over the", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Label("server (money, spawns, mobs, etc).", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Label("Client-side features cannot override", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Label("the host's authority.", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Space(4f); GUILayout.Label("If you encounter any bugs, make sure", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Label("you are the HOST before reporting.", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Label("Join the Discord below to report!", _sLabel, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); GUILayout.Label("Thanks everyone! See you soon", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Label("for more mods!", _sCenter, Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); Section("LINKS"); if (GUILayout.Button("Discord: discord.gg/4FDbXeTDAM", _sBtnBind, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { Application.OpenURL("https://discord.gg/4FDbXeTDAM"); } } private void InfoRow(string label, string value) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(10f); GUILayout.Label(label, _sDim, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(100f), GUILayout.Height(22f) }); GUILayout.Label(value, _sInfoVal, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(22f) }); GUILayout.Space(10f); GUILayout.EndHorizontal(); } private void DrawFooter() { Sep(); GUILayout.Space(4f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if ((Object)(object)_logoTex != (Object)null) { GUILayout.Label((Texture)(object)_logoTex, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(48f), GUILayout.Height(48f) }); GUILayout.Space(10f); } GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); GUILayout.Label("By Swif2D", _sLogo, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }); if (GUILayout.Button("discord.gg/4FDbXeTDAM", _sLink, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(16f) })) { Application.OpenURL("https://discord.gg/4FDbXeTDAM"); } GUILayout.FlexibleSpace(); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(4f); } private void Section(string t) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(4f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUI.DrawTexture(GUILayoutUtility.GetRect(3f, 18f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(3f), GUILayout.Height(18f) }), (Texture)(object)_accentTex); GUILayout.Space(6f); GUILayout.Label(t, _sSection, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(18f) }); GUILayout.EndHorizontal(); GUILayout.Space(2f); } private void Sep() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(2f); GUI.DrawTexture(GUILayoutUtility.GetRect(1f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }), (Texture)(object)_sepTex); GUILayout.Space(2f); } private float Slider(string label, float val, float min, float max) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Space(26f); GUILayout.Label(label, _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(55f) }); float num = GUILayout.HorizontalSlider(val, min, max, _sSlider, _sThumb, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); num = Mathf.Round(num * 10f) / 10f; GUILayout.Label($"{num:F1}", _sLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(42f) }); GUILayout.EndHorizontal(); return num; } private bool Toggle(string label, bool cur) { if (GUILayout.Button((cur ? "● " : "○ ") + label, cur ? _sBtnOn : _sBtnOff, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { return !cur; } return cur; } private bool ToggleBind(string label, bool cur, KeyCode key) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); bool flag = GUILayout.Button((cur ? "● " : "○ ") + label, cur ? _sBtnOn : _sBtnOff, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) }); if ((int)key != 0) { GUILayout.Label(((object)(KeyCode)(ref key)).ToString(), _sDim, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(50f), GUILayout.Height(32f) }); } GUILayout.EndHorizontal(); if (!flag) { return cur; } return !cur; } private void PreloadIcons() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "scrap_icons"); if (!Directory.Exists(path)) { _iconsLoaded = true; return; } string[] files = Directory.GetFiles(path); foreach (string path2 in files) { string text = Path.GetExtension(path2).ToLower(); if (text != ".png" && text != ".jpg") { continue; } try { byte[] array = File.ReadAllBytes(path2); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { ((Texture)val).filterMode = (FilterMode)1; _allIcons[Path.GetFileNameWithoutExtension(path2).ToLower()] = val; } else { Object.Destroy((Object)(object)val); } } catch { } } _iconsLoaded = true; SAMPlugin.Log.LogInfo((object)$"Scrap icons: {_allIcons.Count} chargees"); } private void PreloadMobIcons() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "mob_icons"); if (!Directory.Exists(path)) { _mobIconsLoaded = true; return; } string[] files = Directory.GetFiles(path); foreach (string path2 in files) { string text = Path.GetExtension(path2).ToLower(); if (text != ".png" && text != ".jpg") { continue; } try { byte[] array = File.ReadAllBytes(path2); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { ((Texture)val).filterMode = (FilterMode)1; _mobIcons[Path.GetFileNameWithoutExtension(path2).ToLower()] = val; } else { Object.Destroy((Object)(object)val); } } catch { } } _mobIconsLoaded = true; SAMPlugin.Log.LogInfo((object)$"Mob icons: {_mobIcons.Count} loaded"); } private Texture2D GetMobIcon(string enemyName) { if (_mobIconCache.TryGetValue(enemyName, out var value)) { return value; } if (!_mobIconsLoaded) { _mobIconCache[enemyName] = null; return null; } Texture2D value2 = null; if (MobNameMap.TryGetValue(enemyName, out var value3)) { _mobIcons.TryGetValue(value3, out value2); } if ((Object)(object)value2 == (Object)null) { string text = Clean(enemyName); string key = enemyName.ToLower().Replace(" ", ""); if (!_mobIcons.TryGetValue(text, out value2) && !_mobIcons.TryGetValue(key, out value2)) { foreach (KeyValuePair<string, Texture2D> mobIcon in _mobIcons) { if (mobIcon.Key.Contains(text) || text.Contains(mobIcon.Key)) { value2 = mobIcon.Value; break; } } } if ((Object)(object)value2 == (Object)null) { string[] array = text.Split('_'); int num = 0; foreach (KeyValuePair<string, Texture2D> mobIcon2 in _mobIcons) { int num2 = 0; string[] array2 = array; foreach (string text2 in array2) { if (text2.Length >= 3 && mobIcon2.Key.Contains(text2)) { num2++; } } if (num2 > num) { num = num2; value2 = mobIcon2.Value; } } if (num == 0) { value2 = null; } } } if ((Object)(object)value2 == (Object)null) { SAMPlugin.Log.LogWarning((object)string.Format("No mob icon found for '{0}' (icons loaded: {1}, keys: {2})", enemyName, _mobIcons.Count, string.Join(", ", _mobIcons.Keys))); } _mobIconCache[enemyName] = value2; return value2; } private Texture2D GetIcon(Item item) { string itemName = item.itemName; if (_itemIconCache.TryGetValue(itemName, out var value)) { return value; } if (!_iconsLoaded) { _itemIconCache[itemName] = null; return null; } string text = Clean(itemName); Texture2D value2 = null; if (_allIcons.TryGetValue(text, out value2)) { _itemIconCache[itemName] = value2; return value2; } foreach (KeyValuePair<string, Texture2D> allIcon in _allIcons) { if (allIcon.Key.Contains(text) || text.Contains(allIcon.Key)) { _itemIconCache[itemName] = allIcon.Value; return allIcon.Value; } } string[] array = text.Split('_'); int num = 0; foreach (KeyValuePair<string, Texture2D> allIcon2 in _allIcons) { int num2 = 0; string[] array2 = array; foreach (string text2 in array2) { if (text2.Length >= 3 && allIcon2.Key.Contains(text2)) { num2++; } } if (num2 > num) { num = num2; value2 = allIcon2.Value; } } _itemIconCache[itemName] = ((num > 0) ? value2 : null); return _itemIconCache[itemName]; } private static string Clean(string n) { StringBuilder stringBuilder = new StringBuilder(); string text = n.ToLower(); foreach (char c in text) { if (char.IsLetterOrDigit(c)) { stringBuilder.Append(c); } else if (c == ' ' || c == '-' || c == '_') { stringBuilder.Append('_'); } } return stringBuilder.ToString().Trim('_'); } private void LoadLogo() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "logo.png"); if (File.Exists(path)) { _logoTex = new Texture2D(2, 2); ImageConversion.LoadImage(_logoTex, File.ReadAllBytes(path)); } } private static Texture2D MakeTex(int w, int h, Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(w, h, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[w * h]; for (int i = 0; i < array.Length; i++) { array[i] = c; } val.SetPixels(array); val.Apply(); return val; } private static Texture2D MakeCircle(int s, Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(s, s, (TextureFormat)4, false); float num = (float)s / 2f; for (int i = 0; i < s; i++) { for (int j = 0; j < s; j++) { val.SetPixel(j, i, (Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(num, num)) <= num) ? c : Color.clear); } } val.Apply(); return val; } private static Texture2D MakeRounded(int w, int h, int rad, Color col) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(w, h, (TextureFormat)4, false); for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { bool flag = true; if (j < rad && i < rad) { flag = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)rad, (float)rad)) <= (float)rad; } else if (j >= w - rad && i < rad) { flag = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)(w - rad - 1), (float)rad)) <= (float)rad; } else if (j < rad && i >= h - rad) { flag = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)rad, (float)(h - rad - 1))) <= (float)rad; } else if (j >= w - rad && i >= h - rad) { flag = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)(w - rad - 1), (float)(h - rad - 1))) <= (float)rad; } val.SetPixel(j, i, flag ? col : Color.clear); } } val.Apply(); ((Texture)val).filterMode = (FilterMode)1; return val; } private static GUIStyle MkLabel(int size, FontStyle fs, Color col, TextAnchor align) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = size, fontStyle = fs }; val.normal.textColor = col; val.alignment = align; return val; } private GUIStyle MkRoundBtn(Color bg, Color hov, Color txt, int fontSize, bool bold, int radius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.button); Texture2D t = MakeRounded(120, 32, radius, bg); Texture2D background = MakeRounded(120, 32, radius, hov); AllBg(val, t); val.hover.background = background; val.onHover.background = background; val.active.background = background; val.onActive.background = background; val.normal.textColor = txt; val.hover.textColor = txt; val.active.textColor = txt; val.fontSize = fontSize; val.fontStyle = (FontStyle)(bold ? 1 : 0); val.border = new RectOffset(radius, radius, radius, radius); val.margin = new RectOffset(0, 0, 1, 1); val.padding = new RectOffset(14, 14, 4, 4); val.alignment = (TextAnchor)4; return val; } private static void AllBg(GUIStyle s, Texture2D t) { s.normal.background = t; s.onNormal.background = t; s.focused.background = t; s.onFocused.background = t; s.hover.background = t; s.onHover.background = t; s.active.background = t; s.onActive.background = t; } } public static class FeatureManager { [CompilerGenerated] private sealed class <SetScrapValueDelayed>d__72 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject obj; public int value; public NetworkObject netObj; public string itemName; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetScrapValueDelayed>d__72(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = null; <>1__state = 2; return true; case 2: { <>1__state = -1; GrabbableObject component = obj.GetComponent<GrabbableObject>(); if ((Object)(object)component != (Object)null) { component.SetScrapValue(value); if ((Object)(object)netObj != (Object)null) { RoundManager.Instance.SyncScrapValuesClientRpc((NetworkObjectReference[])(object)new NetworkObjectReference[1] { NetworkObjectReference.op_Implicit(netObj) }, new int[1] { value }); } } SAMPlugin.Log.LogInfo((object)$"Scrap '{itemName}' spawned (value: {value})"); HUDManager instance = HUDManager.Instance; if (instance != null) { instance.DisplayTip("SuperAdminMenu", $"'{itemName}' spawned (${value})!", false, false, "__general"); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool NoclipEnabled = false; public static bool SuperJumpEnabled = false; public static bool FastRunEnabled = false; public static bool ExtraJumpEnabled = false; public static bool InfiniteStaminaEnabled = false; public static bool NoFallDamageEnabled = false; public static bool GodModeEnabled = false; public static bool BrightModeEnabled = false; public static bool PermNoclip = true; public static bool PermFastRun = true; public static bool PermSuperJump = true; public static bool PermDoubleJump = true; public static bool PermInfStamina = true; public static bool PermGodMode = true; public static bool PermNoFallDmg = true; public static bool PermBright = true; public static bool PermMoney = true; public static bool PermSuits = true; public static bool PermSpawnMob = true; public static bool PermClearMobs = true; public static bool PermSpawnScrap = true; public static bool PermFreeze = true; public static bool PermTeleport = true; public static bool PermRevive = true; public const float DefaultMoveSpeed = 4.6f; public const float DefaultJumpForce = 13f; public static float FastRunSpeed = 15f; public static float SuperJumpForce = 45f; public static float NoclipSpeed = 10f; public const float FastRunSpeedMin = 5f; public const float FastRunSpeedMax = 50f; public const float SuperJumpMin = 15f; public const float SuperJumpMax = 150f; public const float NoclipSpeedMin = 5f; public const float NoclipSpeedMax = 50f; private static bool _noclipWasEnabled = false; private static bool _ctrlWasEnabled = false; public static int ExtraJumpsRemaining = 0; private static bool _wasAirborne = false; private static bool _brightWasEnabled = false; private static float _origNVIntensity; private static float _origNVRange; private static LightType _origNVType; private static float _origNVAngle; private static Color _origNVColor; private static float _freezeTimer = 0f; public static ushort PackPermissions() { ushort num = 0; if (PermNoclip) { num = (ushort)(num | 1u); } if (PermFastRun) { num = (ushort)(num | 2u); } if (PermSuperJump) { num = (ushort)(num | 4u); } if (PermDoubleJump) { num = (ushort)(num | 8u); } if (PermInfStamina) { num = (ushort)(num | 0x10u); } if (PermGodMode) { num = (ushort)(num | 0x20u); } if (PermNoFallDmg) { num = (ushort)(num | 0x40u); } if (PermBright) { num = (ushort)(num | 0x80u); } if (PermMoney) { num = (ushort)(num | 0x100u); } if (PermSuits) { num = (ushort)(num | 0x200u); } if (PermSpawnMob) { num = (ushort)(num | 0x400u); } if (PermClearMobs) { num = (ushort)(num | 0x800u); } if (PermSpawnScrap) { num = (ushort)(num | 0x1000u); } if (PermFreeze) { num = (ushort)(num | 0x2000u); } if (PermTeleport) { num = (ushort)(num | 0x4000u); } if (PermRevive) { num = (ushort)(num | 0x8000u); } return num; } public static void UnpackPermissions(ushort v) { PermNoclip = (v & 1) != 0; PermFastRun = (v & 2) != 0; PermSuperJump = (v & 4) != 0; PermDoubleJump = (v & 8) != 0; PermInfStamina = (v & 0x10) != 0; PermGodMode = (v & 0x20) != 0; PermNoFallDmg = (v & 0x40) != 0; PermBright = (v & 0x80) != 0; PermMoney = (v & 0x100) != 0; PermSuits = (v & 0x200) != 0; PermSpawnMob = (v & 0x400) != 0; PermClearMobs = (v & 0x800) != 0; PermSpawnScrap = (v & 0x1000) != 0; PermFreeze = (v & 0x2000) != 0; PermTeleport = (v & 0x4000) != 0; PermRevive = (v & 0x8000) != 0; if (!PermNoclip) { NoclipEnabled = false; } if (!PermFastRun) { FastRunEnabled = false; } if (!PermSuperJump) { SuperJumpEnabled = false; } if (!PermDoubleJump) { ExtraJumpEnabled = false; } if (!PermInfStamina) { InfiniteStaminaEnabled = false; } if (!PermGodMode) { GodModeEnabled = false; } if (!PermNoFallDmg) { NoFallDamageEnabled = false; } if (!PermBright) { BrightModeEnabled = false; } SAMPlugin.Log.LogInfo((object)$"Permissions received from host: 0x{v:X4}"); } public static bool IsAllowed(bool perm) { if (NetworkHelper.IsHost()) { return true; } return perm; } public static void DisableAll() { NoclipEnabled = false; SuperJumpEnabled = false; FastRunEnabled = false; ExtraJumpEnabled = false; InfiniteStaminaEnabled = false; NoFallDamageEnabled = false; GodModeEnabled = false; BrightModeEnabled = false; PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if ((Object)(object)val != (Object)null && !val.isPlayerDead) { if (val.movementSpeed != 4.6f) { val.movementSpeed = 4.6f; } if (val.jumpForce != 13f) { val.jumpForce = 13f; } if (_noclipWasEnabled) { ((Collider)val.thisController).enabled = true; _noclipWasEnabled = false; } } } public static void Tick() { PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)val == (Object)null) && !val.isPlayerDead) { TickNoclip(val); TickSpeed(val); TickStamina(val); TickExtraJump(val); TickGodMode(val); TickBrightMode(); TickFreeze(val); } } private static void TickNoclip(PlayerControllerB player) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) if (NoclipEnabled && !_noclipWasEnabled) { _ctrlWasEnabled = ((Collider)player.thisController).enabled; ((Collider)player.thisController).enabled = false; _noclipWasEnabled = true; SAMPlugin.Log.LogInfo((object)"Noclip ON"); } else if (!NoclipEnabled && _noclipWasEnabled) { ((Collider)player.thisController).enabled = _ctrlWasEnabled; _noclipWasEnabled = false; SAMPlugin.Log.LogInfo((object)"Noclip OFF"); } if (NoclipEnabled) { Camera gameplayCamera = player.gameplayCamera; float num = (InputHelper.GetKey((KeyCode)304) ? (NoclipSpeed * 2f) : NoclipSpeed); Vector3 val = Vector3.zero; if (InputHelper.GetKey((KeyCode)119)) { val += ((Component)gameplayCamera).transform.forward; } if (InputHelper.GetKey((KeyCode)115)) { val -= ((Component)gameplayCamera).transform.forward; } if (InputHelper.GetKey((KeyCode)97)) { val -= ((Component)gameplayCamera).transform.right; } if (InputHelper.GetKey((KeyCode)100)) { val += ((Component)gameplayCamera).transform.right; } if (InputHelper.GetKey((KeyCode)32)) { val += Vector3.up; } if (InputHelper.GetKey((KeyCode)306)) { val -= Vector3.up; } Transform transform = ((Component)player).transform; transform.position += ((Vector3)(ref val)).normalized * num * Time.deltaTime; } } private static void TickSpeed(PlayerControllerB player) { if (FastRunEnabled) { player.movementSpeed = FastRunSpeed; } else if (player.movementSpeed != 4.6f && !NoclipEnabled) { player.movementSpeed = 4.6f; } if (SuperJumpEnabled) { player.jumpForce = SuperJumpForce; } else if (player.jumpForce != 13f) { player.jumpForce = 13f; } } private static void TickStamina(PlayerControllerB player) { if (InfiniteStaminaEnabled) { player.sprintMeter = 1f; player.isExhausted = false; } } private static void TickExtraJump(PlayerControllerB player) { if (!ExtraJumpEnabled) { return; } bool isGrounded = player.thisController.isGrounded; if (isGrounded && _wasAirborne) { ExtraJumpsRemaining = 1; _wasAirborne = false; } else if (!isGrounded) { _wasAirborne = true; } if (!isGrounded && ExtraJumpsRemaining > 0 && InputHelper.GetKeyDown((KeyCode)32)) { ExtraJumpsRemaining--; player.fallValue = player.jumpForce; player.fallValueUncapped = 0f; player.takingFallDamage = false; Animator playerBodyAnimator = player.playerBodyAnimator; if (playerBodyAnimator != null) { playerBodyAnimator.SetTrigger("Jump"); } } } private static void TickGodMode(PlayerControllerB player) { if (GodModeEnabled) { player.health = 100; player.criticallyInjured = false; } } private static void TickBrightMode() { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)val == (Object)null) && !((Object)(object)val.nightVision == (Object)null)) { if (BrightModeEnabled && !_brightWasEnabled) { _origNVIntensity = val.nightVision.intensity; _origNVRange = val.nightVision.range; _origNVType = val.nightVision.type; _origNVAngle = val.nightVision.spotAngle; _origNVColor = val.nightVision.color; val.nightVision.type = (LightType)2; val.nightVision.intensity = 5000f; val.nightVision.range = 9999f; val.nightVision.color = Color.white; val.nightVision.shadows = (LightShadows)0; ((Behaviour)val.nightVision).enabled = true; _brightWasEnabled = true; SAMPlugin.Log.LogInfo((object)"Bright Mode ON"); } else if (BrightModeEnabled) { val.nightVision.type = (LightType)2; val.nightVision.intensity = 5000f; val.nightVision.range = 9999f; val.nightVision.color = Color.white; val.nightVision.shadows = (LightShadows)0; ((Behaviour)val.nightVision).enabled = true; } else if (!BrightModeEnabled && _brightWasEnabled) { val.nightVision.intensity = _origNVIntensity; val.nightVision.range = _origNVRange; val.nightVision.type = _origNVType; val.nightVision.spotAngle = _origNVAngle; val.nightVision.color = _origNVColor; _brightWasEnabled = false; SAMPlugin.Log.LogInfo((object)"Bright Mode OFF"); } } } public static void AddMoney(int amount) { if (NetworkHelper.IsHost()) { AddMoneyHost(amount); } else { NetworkMessenger.SendHostAction(HostAction.Money, amount); } } public static void AddMoneyHost(int amount) { Terminal val = Object.FindObjectOfType<Terminal>(); if ((Object)(object)val == (Object)null) { SAMPlugin.Log.LogWarning((object)"Terminal introuvable !"); return; } val.groupCredits = Mathf.Max(0, val.groupCredits + amount); val.SyncGroupCreditsClientRpc(val.groupCredits, val.numberOfItemsInDropship); SAMPlugin.Log.LogInfo((object)$"Money added: +${amount} => Total: ${val.groupCredits}"); HUDManager instance = HUDManager.Instance; if (instance != null) { instance.DisplayTip("SuperAdminMenu", $"+${amount} credits!", false, false, "__general"); } } public static void UnlockAllSuits() { if (NetworkHelper.IsHost()) { UnlockAllSuitsHost(); } else { NetworkMessenger.SendHostAction(HostAction.Suits, 0); } } public static void UnlockAllSuitsHost() { StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { return; } Terminal val = Object.FindObjectOfType<Terminal>(); int num = (((Object)(object)val != (Object)null) ? val.groupCredits : 0); int num2 = 0; for (int i = 0; i < instance.unlockablesList.unlockables.Count; i++) { UnlockableItem val2 = instance.unlockablesList.unlockables[i]; if (val2.unlockableType == 0 && !val2.alreadyUnlocked && !val2.hasBeenUnlockedByPlayer) { instance.BuyShipUnlockableServerRpc(i, num); num2++; } } if ((Object)(object)val != (Object)null) { val.groupCredits = num; val.SyncGroupCreditsClientRpc(num, val.numberOfItemsInDropship); } SAMPlugin.Log.LogInfo((object)$"{num2} suits unlocked!"); HUDManager instance2 = HUDManager.Instance; if (instance2 != null) { instance2.DisplayTip("SuperAdminMenu", $"{num2} suits unlocked!", false, false, "__general"); } } public static void TeleportToPlayer(PlayerControllerB target) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)val == (Object)null) && !((Object)(object)target == (Object)null)) { Vector3 val2 = ((Component)target).transform.position + Vector3.up * 0.5f; val.TeleportPlayer(val2, false, 0f, false, true); SAMPlugin.Log.LogInfo((object)("Teleported to " + target.playerUsername)); HUDManager instance = HUDManager.Instance; if (instance != null) { instance.DisplayTip("SuperAdminMenu", "Teleported to " + target.playerUsername + "!", false, false, "__general"); } } } public static void SpawnSpecificMob(PlayerControllerB target, bool indoor, int enemyIndex) { if (NetworkHelper.IsHost()) { SpawnSpecificMobHost(target, indoor, enemyIndex); } else { NetworkMessenger.SendSpawnMob(target.actualClientId, indoor, enemyIndex); } } public static void SpawnSpecificMobHost(PlayerControllerB target, bool indoor, int enemyIndex) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) RoundManager instance = RoundManager.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.currentLevel == (Object)null) { return; } List<SpawnableEnemyWithRarity> list = (indoor ? instance.currentLevel.Enemies : instance.currentLevel.OutsideEnemies); if (list == null || enemyIndex < 0 || enemyIndex >= list.Count) { return; } EnemyType enemyType = list[enemyIndex].enemyType; if (!((Object)(object)enemyType == (Object)null) && !((Object)(object)enemyType.enemyPrefab == (Object)null)) { Vector3 val = ((Component)target).transform.position + Vector3.up * 0.5f; NetworkObject component = Object.Instantiate<GameObject>(enemyType.enemyPrefab, val, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)).GetComponent<NetworkObject>(); if ((Object)(object)component != (Object)null) { component.Spawn(true); } string text = enemyType.enemyName ?? "Unknown"; SAMPlugin.Log.LogInfo((object)("Mob '" + text + "' spawned on " + target.playerUsername + " (" + (indoor ? "indoor" : "outdoor") + ")")); HUDManager instance2 = HUDManager.Instance; if (instance2 != null) { instance2.DisplayTip("SuperAdminMenu", "'" + text + "' spawned on " + target.playerUsername + "!", false, false, "__general"); } } } public static void SpawnSpecificMobByClientId(ulong targetClientId, bool indoor, int enemyIndex) { PlayerControllerB val = FindPlayerByClientId(targetClientId); if (!((Object)(object)val == (Object)null)) { SpawnSpecificMobHost(val, indoor, enemyIndex); } } public static void ClearAllMobs() { if (NetworkHelper.IsHost()) { ClearAllMobsHost(); } else { NetworkMessenger.SendHostAction(HostAction.ClearMobs, 0); } } public static void ClearAllMobsHost() { EnemyAI[] array = Object.FindObjectsOfType<EnemyAI>(); int num = 0; EnemyAI[] array2 = array; foreach (EnemyAI val in array2) { if ((Object)(object)val == (Object)null) { continue; } try { NetworkObject component = ((Component)val).GetComponent<NetworkObject>(); if ((Object)(object)component != (Object)null && component.IsSpawned) { component.Despawn(true); num++; } else { Object.Destroy((Object)(object)((Component)val).gameObject); num++; } } catch { } } SAMPlugin.Log.LogInfo((object)$"Cleared {num} mobs"); HUDManager instance = HUDManager.Instance; if (instance != null) { instance.DisplayTip("SuperAdminMenu", $"{num} mobs cleared!", false, false, "__general"); } } public static void ReviveSelf() { if (NetworkHelper.IsHost()) { ReviveAllHost(); } else { NetworkMessenger.SendHostAction(HostAction.Revive, 0); } } public static void ReviveLocalPlayer() { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) StartOfRound instance = StartOfRound.Instance; PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)instance == (Object)null) && !((Object)(object)val == (Object)null)) { SAMPlugin.Log.LogInfo((object)$"ReviveLocalPlayer: isPlayerDead={val.isPlayerDead}, isPlayerControlled={val.isPlayerControlled}"); val.isPlayerDead = false; val.isPlayerControlled = true; val.health = 100; val.disableMoveInput = false; val.disableLookInput = false; val.disableInteract = false; val.isInElevator = true; val.isInHangarShipRoom = true; val.isInsideFactory = false; ((Component)val.thisPlayerBody).gameObject.SetActive(true); ((Component)val).gameObject.SetActive(true); Vector3 val2 = (((Object)(object)instance.playerSpawnPositions[0] != (Object)null) ? instance.playerSpawnPositions[0].position : ((Component)instance).transform.position); val.TeleportPlayer(val2, false, 0f, false, true); ((Behaviour)val.gameplayCamera).enabled = true; ((Behaviour)val.visorCamera).enabled = true; instance.SetSpectateCameraToGameOverMode(false, val); ((Component)HUDManager.Instance).gameObject.SetActive(true); HUDManager.Instance.gasHelmetAnimator.SetBool("gasmark", false); if ((Object)(object)val.deadBody != (Object)null) { Object.Destroy((Object)(object)((Component)val.deadBody).gameObject); val.deadBody = null; } StartOfRound.Instance.UpdatePlayerVoiceEffects(); SAMPlugin.Log.LogInfo((object)"ReviveLocalPlayer: local player revived successfully"); HUDManager instance2 = HUDManager.Instance; if (instance2 != null) { instance2.DisplayTip("SuperAdminMenu", "You have been revived!", false, false, "__general"); } } } public static void ReviveAllHost() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { return; } instance.allPlayersDead = false; List<ulong> list = new List<ulong>(); PlayerControllerB[] allPlayerScripts = instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && val.isPlayerDead && val.isPlayerControlled) { list.Add(val.actualClientId); } } instance.ReviveDeadPlayers(); Vector3 val2 = (((Object)(object)instance.playerSpawnPositions[0] != (Object)null) ? instance.playerSpawnPositions[0].position : ((Component)instance).transform.position); allPlayerScripts = instance.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (!((Object)(object)val3 == (Object)null) && val3.isPlayerControlled) { val3.TeleportPlayer(val2, false, 0f, false, true); } } RagdollGrabbableObject[] array = Object.FindObjectsOfType<RagdollGrabbableObject>(); foreach (RagdollGrabbableObject val4 in array) { if ((Object)(object)val4 == (Object)null) { continue; } try { NetworkObject component = ((Component)val4).GetComponent<NetworkObject>(); if ((Object)(object)component != (Object)null && component.IsSpawned) { component.Despawn(true); } else { Object.Destroy((Object)(object)((Component)val4).gameObject); } } catch { } } allPlayerScripts = instance.allPlayerScripts; foreach (PlayerControllerB val5 in allPlayerScripts) { if ((Object)(object)val5 != (Object)null) { val5.deadBody = null; } } ulong localClientId = NetworkManager.Singleton.LocalClientId; foreach (ulong item in list) { if (item == localClientId) { ReviveLocalPlayer(); } else { NetworkMessenger.SendReviveToClient(item); } } SAMPlugin.Log.LogInfo((object)$"ReviveAllHost: revived {list.Count} players"); HUDManager instance2 = HUDManager.Instance; if (instance2 != null) { instance2.DisplayTip("SuperAdminMenu", "All players revived!", false, false, "__general"); } } public static void SpawnScrapItem(Item item, int scrapValue = -1) { if (NetworkHelper.IsHost()) { SpawnScrapItemHost(item, scrapValue, 0uL); return; } StartOfRound instance = StartOfRound.Instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.allItemsList == (Object)null)) { int num = instance.allItemsList.itemsList.IndexOf(item); if (num >= 0) { NetworkMessenger.SendSpawnScrap(num, scrapValue); } } } public static void SpawnScrapItemHost(Item item, int scrapValue, ulong requesterClientId = 0uL) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = ((requesterClientId == 0L) ? GameNetworkManager.Instance?.localPlayerController : FindPlayerByClientId(requesterClientId)); if (!((Object)(object)val == (Object)null)) { int value = ((scrapValue > 0) ? scrapValue : Random.Range(item.minValue, item.maxValue + 1)); Vector3 val2 = ((Component)val).transform.position + ((Component)val).transform.forward * 2f + Vector3.up * 0.5f; GameObject val3 = Object.Instantiate<GameObject>(item.spawnPrefab, val2, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); NetworkObject component = val3.GetComponent<NetworkObject>(); if ((Object)(object)component != (Object)null) { component.Spawn(true); } AdminMenuGUI adminMenuGUI = Object.FindObjectOfType<AdminMenuGUI>(); if ((Object)(object)adminMenuGUI != (Object)null) { ((MonoBehaviour)adminMenuGUI).StartCoroutine(SetScrapValueDelayed(val3, component, value, item.itemName)); } } } public static void SpawnScrapByIndex(int itemIndex, int scrapValue, ulong requesterClientId) { StartOfRound instance = StartOfRound.Instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.allItemsList == (Object)null) && itemIndex >= 0 && itemIndex < instance.allItemsList.itemsList.Count) { Item val = instance.allItemsList.itemsList[itemIndex]; if (!((Object)(object)val == (Object)null) && val.isScrap && !((Object)(object)val.spawnPrefab == (Object)null)) { SpawnScrapItemHost(val, scrapValue, requesterClientId); } } } [IteratorStateMachine(typeof(<SetScrapValueDelayed>d__72))] private static IEnumerator SetScrapValueDelayed(GameObject obj, NetworkObject netObj, int value, string itemName) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetScrapValueDelayed>d__72(0) { obj = obj, netObj = netObj, value = value, itemName = itemName }; } public static List<Item> GetScrapItems() { List<Item> list = new List<Item>(); StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.allItemsList == (Object)null) { return list; } foreach (Item items in instance.allItemsList.itemsList) { if ((Object)(object)items != (Object)null && items.isScrap && (Object)(object)items.spawnPrefab != (Object)null) { list.Add(items); } } return list; } public static void RevivePlayer(PlayerControllerB player) { if (!((Object)(object)player == (Object)null) && player.isPlayerDead) { StartOfRound instance = StartOfRound.Instance; if (instance != null) { instance.ReviveDeadPlayers(); } } } public static void FreezeLocalPlayer(float duration) { _freezeTimer = duration; SAMPlugin.Log.LogInfo((object)$"Freeze started: {duration}s"); } private static void TickFreeze(PlayerControllerB player) { if (!(_freezeTimer <= 0f)) { _freezeTimer -= Time.deltaTime; player.disableMoveInput = true; player.disableLookInput = true; if (_freezeTimer <= 0f) { _freezeTimer = 0f; player.disableMoveInput = false; player.disableLookInput = false; SAMPlugin.Log.LogInfo((object)"Freeze ended"); } } } public static PlayerControllerB FindPlayerByClientId(ulong clientId) { StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { return null; } PlayerControllerB[] allPlayerScripts = instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && val.actualClientId == clientId && val.isPlayerControlled) { return val; } } return null; } } public enum HostAction : byte { Money, Suits, ClearMobs, Revive } public static class NetworkHelper { public static bool IsHost() { NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton != (Object)null) { if (!singleton.IsHost) { return singleton.IsServer; } return true; } return false; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] internal static class PlayerUpdate_Patch { private static void Postfix(PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance?.localPlayerController) && !__instance.isPlayerDead) { if (FeatureManager.FastRunEnabled && !FeatureManager.NoclipEnabled) { __instance.movementSpeed = FeatureManager.FastRunSpeed; } if (FeatureManager.SuperJumpEnabled) { __instance.jumpForce = FeatureManager.SuperJumpForce; } else { __instance.jumpForce = 13f; } } } } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] internal static class PlayerLateUpdate_Patch { private static void Postfix(PlayerControllerB __instance) { if (FeatureManager.InfiniteStaminaEnabled && !((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance?.localPlayerController) && !__instance.isPlayerDead) { __instance.sprintMeter = 1f; __instance.isExhausted = false; } } } [HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")] internal static class PlayerJump_Patch { private static bool Prefix(PlayerControllerB __instance) { if (FeatureManager.NoclipEnabled && (Object)(object)__instance == (Object)(object)GameNetworkManager.Instance?.localPlayerController) { return false; } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] internal static class PlayerDamage_Patch { private static bool Prefix(PlayerControllerB __instance, int damageNumber, bool hasDamageSFX, bool callRPC, CauseOfDeath causeOfDeath) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 if ((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance?.localPlayerController) { return true; } if (FeatureManager.GodModeEnabled) { return false; } if (FeatureManager.NoFallDamageEnabled && (int)causeOfDeath == 2) { return false; } return true; } } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] internal static class PlayerKill_Patch { private static bool Prefix(PlayerControllerB __instance) { if ((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance?.localPlayerController) { return true; } if (FeatureManager.GodModeEnabled) { __instance.health = 100; __instance.criticallyInjured = false; return false; } return true; } } public static class InputHelper { public static bool GetKeyDown(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((int)key == 0) { return false; } Keyboard current = Keyboard.current; if (current == null) { return false; } Key val = KeyCodeToKey(key); if ((int)val == 0) { return false; } return ((ButtonControl)current[val]).wasPressedThisFrame; } public static bool GetKey(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or miss