-
Notifications
You must be signed in to change notification settings - Fork 0
SSSettings
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.
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.
Settings:Button
Settings:GroupHeader
Settings:TextArea
Settings:Dropdown
Settings:Keybind
Settings:Plaintext
Settings:Slider
Settings:TwoButtons
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)
SCriPt.LabAPI v0.5.3 | A plugin by TayTay | Give it a ⭐ to show your support