About Admin Toggle
Installation
- Place the AdminToggle.cs file in /oxide/plugins/
- Place the XLIB.dll Dependency in /RustDedicated_Data/Managed/
- Grant yourself the default permission o.grant user YOURNAME admintoggle.master the .master permission selector needs to be adapted to what you called the permission setting for the mode
Information
- AdminToggle Allows admins with permission to toggle between player & admin mode
- Reset Command Open f1 console & write at.fix - Reverts you to player mode (the hard way)
- (Permission, Priority, Toggle Commands) - Must be unique
Core Mode Featues
- Unlimited custom modes
- Customizable permission name
- Priority system for modes
- Master mode
- Oxide group toggling
- Custom commands to toggle
-
Restriction system to specfic steam ids a certan mode
Mode Settings (admin)
- Require a reason to toggle
- Autorun commands on toggle
- Separated inventories
- Teleport back to toggle location upon exiting
- Revert auth to 0 on disconnect
- Blocked commands
- Custom outfit while in mode
- Notifications (global-chat notification, local-chat notification, popup notification, sound perfab notification & Discord embed Notification)
- Interface toggle button, pulsing panel, action menu
- Blocked actions
- Blocked plugins hooks
Mode Settings (player)
- Autorun commands on revert
- Notifications (global-chat notification, local-chat notification, popup notification, sound perfab notification & Discord embed Notification)
- Blocked commands
- Blocked plugins hooks
API Hooks
void admintoggle_onAdmin (BasePlayer player) { /*Do something epic*/ } void admintoggle_onPlayer (BasePlayer player) { /*Do something epic*/ }
API Methods
bool IsAdmin(BasePlayer player); object[] GetMode(BasePlayer player, bool TrueMode = false); /* IF player.userID IS ASSIGNED ANY MODE RETURNS TRUE IF player.userID IS NOT ASSIGNED ANY MODE RETURNS FALSE */ bool isAdmin = AdminToggle.Call<bool>("IsAdmin", player.userID); /* IF player IS NOT ASSIGNED MODE RETURNS NULL IF bool IS SET FALSE RETURNS CURRENT MODE -- object[0] permission (string), object[1] priority (int), object[2] isMaster (bool) IF bool IS SET TRUE RETURNS HIGHEST MODE -- object[0] permission (string), object[1] priority (int), object[2] isMaster (bool) */ object[] getMode = AdminToggle.Call<object[]>("GetMode", player, false);
Default Configuration (1 mode)
Quote{ "MODES": [ { "Permission": "master", "Priority": 999, "Master Level CAREFUL! (Enabling this does the following #Overrides priority, mode & permission system! #Allows to set/get modes for yourself or others! #Overrides limitations by current or lower modes": false, "Toggle Commands": [ "admin", "mode" ], "Restrict Mode To Specfic SteamIds (Leave blank to disable)": [], "Settings": { "On Admin": { "Require Reason": true, "Autorun Commands Use Forward Slash '/' For Chat-Commands & Leave It Blank For Console-Commands": [], "Toggle Groups To Grant (Leave blank to disable)": [ "admin" ], "Specified Auth Level (1 = moderators, 2 = owners) Must either be 1 or 2 cannot be below or above": 2, "Keep Separate Inventories": true, "Teleport Back Upon Exiting": true, "Revert On Disconnect, Restart, Reload": true, "Ignore Server Violations (Bans, Kicks Etc) (Recommended to keep true)": true, "Blocked Commands": [], "Name Prefix Changes your name to a set prefix (Leave blank to disable)": "", "Admin Outfit": { "Enabled": true, "Lock Outfit": true, "Settings": { "(Shortnam::SkinID)": [ "hoodie::1234567890", "pants::1234567890", "shoes.boots::1234567890" ] } }, "Notifications": { "Global Chat": { "Enabled": false, "Settings": { "Chat Icon (SteamID64)": 0, "Text Message Special Color (HEX) Example %message%": "#faaf19", "Text Message": "%{player.name}% Activated %{mode.permission}% Mode" } }, "Self Chat": { "Enabled": true, "Settings": { "Chat Icon (SteamID64)": 0, "Text Message Special Color (HEX) Example %message%": "#faaf19", "Text Message": "%You% Activated %{mode.permission}% Mode" } }, "Self Popup": { "Enabled": false, "Settings": { "Text Message Special Color (HEX) Example %message%": "#faaf19", "Text Message": "%You% Activated %{mode.permission}% Mode" } }, "Self Sound": { "Enabled": false, "Settings": { "Sound (Prefab)": "assets/prefabs/misc/easter/painted eggs/effects/eggpickup.prefab" } }, "Discord": { "Enabled": false, "Settings": { "Webhook": "https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks", "Embed Color": 3315400 } } }, "Interface": { "Button": { "Enabled": false, "Settings": { "Opacity (0.0 to 1.0)": 0.64, "Active Color (HEX)": "#008000", "Inactive Color (HEX)": "#800000", "Active Text": "Activated", "Inactive Text": "Disabled", "Active Text Color (HEX)": "#ffffff", "Inactive Text Color (HEX)": "#ffffff", "Design (Advanced)": { "Anchor": { "Min Width (0.0 - 1.0)": 0.5, "Min Height (0.0 - 1.0)": 0.0, "Max Width (0.0 - 1.0)": 0.5, "Max Height (0.0 - 1.0)": 0.0 }, "Offset": { "Min Width (pixels)": 0, "Min Height (pixels)": 0, "Max Width (pixels)": 60, "Max Height (pixels)": 60, "Offset Points (Relative To Offset)": { "Top (pixels)": 0, "Bottom (pixels)": 18, "Left (pixels)": 0, "Right (pixels)": 263 } } } } }, "Panel": { "Enabled": false, "Settings": { "Text": "A D M I N M O D E A C T I V A T E D", "Text Color (HEX)": "#ffffff", "Pulse Duration ": 1.0, "Design (Advanced)": { "Anchor": { "Min Width (0.0 - 1.0)": 0.5, "Min Height (0.0 - 1.0)": 0.0, "Max Width (0.0 - 1.0)": 0.5, "Max Height (0.0 - 1.0)": 0.0 }, "Offset": { "Min Width (pixels)": 0, "Min Height (pixels)": 0, "Max Width (pixels)": 380, "Max Height (pixels)": 20, "Offset Points (Relative To Offset)": { "Top (pixels)": 0, "Bottom (pixels)": 82, "Left (pixels)": 0, "Right (pixels)": 200 } } } } }, "Menu": { "Enabled": true, "Settings": { "Opacity (0.0 to 1.0)": 0.64, "Not Found Color (HEX)": "#000000", "Active Color (HEX)": "#008000", "Inactive Color (HEX)": "#800000", "Text Color (HEX)": "#ffffff", "Design (Advanced)": { "Anchor": { "Min Width (0.0 - 1.0)": 1.0, "Min Height (0.0 - 1.0)": 0.0, "Max Width (0.0 - 1.0)": 1.0, "Max Height (0.0 - 1.0)": 0.0 }, "Offset": { "Min Width (pixels)": 0, "Min Height (pixels)": 0, "Max Width (pixels)": 180, "Max Height (pixels)": 81, "Offset Points (Relative To Offset)": { "Top (pixels)": 0, "Bottom (pixels)": 16, "Left (pixels)": 0, "Right (pixels)": 392 } } } } } }, "Actions": { "Allow All Actions (Overrides Specfic Actions)": false, "Allow Specfic Actions": { "Can Build": false, "Can Craft": false, "Can Loot Players": true, "Can Loot Entities": true, "Can Damage Structures": true, "Can Interact With Items In Weapons Category": true, "Can Hurt Players": true, "Can Drop Items": true } }, "Third-Party Plugins": { "Autorun Plugins": { "Autorun All": false, "Autorun Specfic": { "AdminRadar": false, "Vanish": true, "Godmode": true } }, "Blocked Plugins": { "Block All": false, "Block Specfic": { "Backpacks": false, "AdminRadar": false, "Vanish": false, "Godmode": false } } } }, "On Player": { "Autorun Commands Use Forward Slash '/' For Chat-Commands & Leave It Blank For Console-Commands": [], "Toggle Groups To Revoke (Leave blank to disable)": [ "admin" ], "Notifications": { "Global Chat": { "Enabled": false, "Settings": { "Chat Icon (SteamID64)": 0, "Text Message Special Color (HEX) Example %message%": "#faaf19", "Text Message": "%{player.name}% Returned To %Player% Mode" } }, "Self Chat": { "Enabled": true, "Settings": { "Chat Icon (SteamID64)": 0, "Text Message Special Color (HEX) Example %message%": "#faaf19", "Text Message": "%You% Returned To %Player% Mode" } }, "Self Popup": { "Enabled": false, "Settings": { "Text Message Special Color (HEX) Example %message%": "#faaf19", "Text Message": "%You% Returned To %Player% Mode" } }, "Self Sound": { "Enabled": false, "Settings": { "Sound (Prefab)": "assets/prefabs/misc/easter/painted eggs/effects/eggpickup.prefab" } }, "Discord": { "Enabled": false, "Settings": { "Webhook": "https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks", "Embed Color": 3315400 } } }, "Blocked Commands": [ "god", "vanish", "freeze", "viewinv", "inspect", "padmin", "playeradministration.show", "spectate" ], "Third-Party Plugins": { "Blocked Plugins": { "Block All": true, "Block Specfic": { "AdminRadar": false, "Vanish": false, "Godmode": false } } } } } } ] }
Known incompatible plugins
- Server Armour (Compatible with v2.29.44 and above)