Hooks called by Settings

Summary

Hooks

Called on the client when the value of a setting has changed, after the on_change function of the setting.
Called on the server when a networked setting of a player has changed, and for every networked setting that is not at its default value when the player joins.
Lets plugins and the schema register their settings with ClientSettings:register_setting.

Hooks

ClientSettingChanged(setting.id, value, old_value)

client plugins/settings/plugin/cl_plugin.lua:63

Called on the client when the value of a setting has changed, after the on_change function of the setting. Do not return anything from the handler, or the plugins after it are not told.

Parameters

  • id String setting id
  • value Any new value of the setting
  • old_value Any previous value of the setting

Called from

  • value_changed

Call sites

PlayerSettingChanged(actor, id, value, old_value)

server plugins/settings/plugin/sv_nethooks.lua:34

Called on the server when a networked setting of a player has changed, and for every networked setting that is not at its default value when the player joins. The settings of a joining player arrive before PlayerInitialized runs for them, so the player may not be initialized yet. Do not return anything from the handler, or the plugins after it are not told.

Parameters

  • actor Player The player whose setting has changed
  • id String setting id
  • value Any new value of the setting
  • old_value Any previous value of the setting

Call sites

RegisterClientSettings()

shared plugins/settings/plugin/sh_plugin.lua:39

Lets plugins and the schema register their settings with ClientSettings:register_setting. Called on the server and the client once all plugins and the schema have been loaded, and again on every code refresh. Register a setting on both realms if it is networked; a setting that is not can be registered on the client only. A type added with ClientSettings:register_type has to be registered before the settings that use it. Do not return anything from the handler, or the plugins after it are not asked.

Called from

Call sites

Defined in