CityRP Documentation Repository

cityrp.settings

Client-side settings registry for the CityRP settings panel. Plugins register categories and individual settings here; the player_settings plugin renders them in a unified GUI. Existing ConVars, cookies, and chat commands are wired through rather than replaced.

Functions

Clientcityrp.settings.CanSeeStaffSettings() → booleanSource ☍

Returns whether the local player can see staff-only settings.

Returns

  1. booleanTrue when the player is a trial mod or above.
Clientcityrp.settings.Close()Source ☍

Closes the settings panel when it is open.

Clientcityrp.settings.GetCategoryEntries(categoryId) → CityRPSettingsEntry[]Source ☍

Returns settings for a category that are visible to the local player.

Parameters

  • categoryIdstringCategory identifier.

Returns

  1. CityRPSettingsEntry[]Visible settings for the category.
Clientcityrp.settings.GetVisibleCategories() → CityRPSettingsCategory[]Source ☍

Returns categories visible to the local player, sorted by order then name.

Returns

  1. CityRPSettingsCategory[]Visible categories.
Clientcityrp.settings.Open()Source ☍

Opens the settings panel, creating it when needed.

Clientcityrp.settings.Register(entry) → booleanSource ☍

Registers a single setting row in the unified settings panel.

Parameters

Returns

  1. booleanFalse when the id was already taken.
Clientcityrp.settings.RegisterCategory(id, name, order, staffOnly)Source ☍

Registers a sidebar category for grouping settings.

Parameters

  • idstringUnique category identifier.
  • namestringDisplay name shown in the sidebar.
  • ordernumber?Sort order (lower appears first).
  • staffOnlyboolean?When true, only trial mods and above see this category.
Clientcityrp.settings.Search(query) → CityRPSettingsSearchResult[]Source ☍

Returns visible settings matching a query, grouped by category in sidebar order. Matches case-insensitive plain text against the label, description, ConVar and category name; headers and labels are layout rather than settings, so they are never returned.

Parameters

  • querystringText to search for.

Returns

  1. CityRPSettingsSearchResult[]Matches per category; empty for a blank query.
Clientcityrp.settings.Toggle()Source ☍

Toggles the settings panel open or closed.

Fields

Clientcityrp.settingsSource ☍
Clientcityrp.settings.categoriesSource ☍
Clientcityrp.settings.entriesSource ☍
Clientcityrp.settings.registeredIdsSource ☍

CityRPSettingsCategory

4 fields Source ☍
ClientCityRPSettingsCategory.idSource ☍

Unique category identifier.

ClientCityRPSettingsCategory.nameSource ☍

Display name shown in the sidebar.

ClientCityRPSettingsCategory.orderSource ☍

Sort order (lower appears first).

ClientCityRPSettingsCategory.staffOnlySource ☍

When true, only trial mods and above see this category.

CityRPSettingsEntry

16 fields Source ☍
ClientCityRPSettingsEntry.actionSource ☍

Callback for button-type entries.

ClientCityRPSettingsEntry.categorySource ☍

Category id this entry belongs to.

ClientCityRPSettingsEntry.choicesSource ☍

Combo options as {label = string, value = string} rows, or a resolver.

ClientCityRPSettingsEntry.convarSource ☍

Client ConVar name for checkbox, slider, combo, and text types.

ClientCityRPSettingsEntry.decimalsSource ☍

Decimal places for sliders.

ClientCityRPSettingsEntry.descriptionSource ☍

Secondary help text.

ClientCityRPSettingsEntry.hintKeySource ☍

Hint registry key for hint-type entries.

ClientCityRPSettingsEntry.idSource ☍

Unique setting identifier.

ClientCityRPSettingsEntry.labelSource ☍

Primary label for the control.

ClientCityRPSettingsEntry.maxSource ☍

Maximum value for sliders.

ClientCityRPSettingsEntry.minSource ☍

Minimum value for sliders.

ClientCityRPSettingsEntry.onSelectSource ☍

Callback for combo rows without a convar.

ClientCityRPSettingsEntry.orderSource ☍

Sort order within a category (lower appears first).

ClientCityRPSettingsEntry.staffOnlySource ☍

When true, only trial mods and above see this entry.

ClientCityRPSettingsEntry.typeSource ☍

One of: header, label, checkbox, slider, combo, button, hint, text.

ClientCityRPSettingsEntry.visibleSource ☍

Optional visibility predicate evaluated when building the panel.

CityRPSettingsSearchResult

2 fields Source ☍
ClientCityRPSettingsSearchResult.categorySource ☍

Category the matches belong to.

ClientCityRPSettingsSearchResult.entriesSource ☍

Matching entries, in category order.