Skip to content

Configuration

This page documents hooks in the configuration category.


CanPlayerModifyConfig(client, key)View Source

Purpose

Allows plugins or modules to control whether a player may view or modify configuration values.

Category

Configuration

Realm

Shared

Parameters

Player client The player attempting to access or modify configuration values.

string key The configuration key being modified. This argument is only provided during a configuration change.

Returns

boolean|nil Return false to block access or modification. Return nil or true to allow it.

Example Usage

  hook.Add("CanPlayerModifyConfig", "liaExampleCanPlayerModifyConfig", function(client, key)
      if IsValid(client) and client:IsAdmin() then
          return true
      end
  end)

ConfigChanged(key, newValue, oldValue, client)View Source

Purpose

Runs on the server after a player successfully changes a configuration value.

Category

Configuration

Realm

Server

Parameters

string key The configuration key that changed.

any newValue The new value assigned to the configuration key.

any oldValue The previous value for the configuration key.

Player client The player who changed the configuration value.

Example Usage

  hook.Add("ConfigChanged", "liaExampleConfigChanged", function(key, newValue, oldValue, client)
      if not IsValid(client) then return end
      print(string.format("[MyModule] handled ConfigChanged for %s", client:Name()))
  end)

CreateMenuButtons(tabs)View Source

Purpose

Allows menu tabs to be collected for the `DefaultMenuTab` configuration option.

Category

Configuration

Realm

Client

Parameters

table tabs A table that should be populated with menu tab definitions.

Example Usage

  hook.Add("CreateMenuButtons", "liaExampleCreateMenuButtons", function(tabs)
      print("[MyModule] handled CreateMenuButtons")
  end)

CreateSalaryTimers()View Source

Purpose

Runs shortly after the `SalaryInterval` configuration value changes so salary timers can be rebuilt.

Category

Configuration

Realm

Server

Example Usage

  hook.Add("CreateSalaryTimers", "liaExampleCreateSalaryTimers", function()
      print("[MyModule] handled CreateSalaryTimers")
  end)

DermaSkinChanged(skin)View Source

Purpose

Runs when the `DermaSkin` configuration value changes.

Category

Configuration

Realm

Shared

Parameters

string skin The selected Derma skin name.

Example Usage

  hook.Add("DermaSkinChanged", "liaExampleDermaSkinChanged", function(skin)
      print("[MyModule] handled DermaSkinChanged")
  end)

InitializedConfig()View Source

Purpose

Runs after configuration values have been loaded on the server or received by the client.

Category

Configuration

Realm

Shared

Example Usage

  hook.Add("InitializedConfig", "liaExampleInitializedConfig", function()
      print("[MyModule] handled InitializedConfig")
  end)

OnConfigUpdated(key, oldValue, newValue)View Source

Purpose

Runs whenever a configuration value is updated locally through `lia.config.set`, `lia.config.forceSet`, or a networked configuration update.

Category

Configuration

Realm

Shared

Parameters

string key The configuration key that changed.

any oldValue The previous value for the configuration key.

any newValue The new value for the configuration key.

Example Usage

  hook.Add("OnConfigUpdated", "liaExampleOnConfigUpdated", function(key, oldValue, newValue)
      print("[MyModule] handled OnConfigUpdated")
  end)

VoiceToggled(enabled)View Source

Purpose

Runs when the `IsVoiceEnabled` configuration value changes.

Category

Configuration

Realm

Shared

Parameters

boolean enabled True when voice chat is enabled, false when it is disabled.

Example Usage

  hook.Add("VoiceToggled", "liaExampleVoiceToggled", function(enabled)
      print("[MyModule] handled VoiceToggled")
  end)