SSSettings - tayjay/SCriPt GitHub Wiki
Background
As of SCP:SL Heavy Duty Northwood has added a feature to the game called "Server Specific Settings System (SSSS)". This allows plugin developers to add client side configurable settings to players, including Keybinds.
Settings
Check out the Globals page for more information on Settings.*
. This will include all functions for creating settings, we will define what they mean here.
Every Setting object when created is assigned a unique ID. If you want to know that this setting has been modified, you need to keep a reference to the object for later.
Button
Settings:Button
GroupHeader
Settings:GroupHeader
TextArea
Settings:TextArea
Dropdown
Settings:Dropdown
Keybind
Settings:Keybind
Plaintext
Settings:Plaintext
Slider
Settings:Slider
TwoButtons
Settings:TwoButtons
Creating a Setting
To create a setting, you need to create a SCriPt.Settings
object inside of a module.
settings_example = SCriPt:Module('SettingsExample')
-- Define the callback BEFORE passing it
function settings_example.settings_callback(player, SettingId)
if SettingId == settings_example.settings['example_button'].SettingId then
Server:SendBroadcast("You pressed the example button!")
end
end
settings_example.settings = SCriPt.Settings({
header = Settings:GroupHeader('Example Settings'),
example_button = Settings:Button('Example Button', 'Button')
}, settings_example.settings_callback)