CityRP Documentation Repository

cityrp.topHints

Top-of-screen cycling tips API (cityrp.topHints). Distinct from entity look-at hints (cityrp.hints). Loaded as a core library so other plugins can RegisterPrefix/AddHint from sh_init regardless of alphabetical plugin load order.

Shared registrations (library defaults + plugin sh_init) are available on both realms — no server→client config sync is required for the tip pool.

Functions

Sharedcityrp.topHints.AddHint(data, source) → number?Source ☍

Add a hint to the shared pool.

Parameters

  • datastring|table|TopHintsHintHint text or table
  • sourcestring?Optional source key for ClearSource

Returns

  1. number?Index in hints, or nil if invalid
Sharedcityrp.topHints.ClearSource(source, clearPrefixes)Source ☍

Remove all registered hints (and optionally prefixes) for a source key. Use before re-registering on hot reload.

Parameters

  • sourcestring
  • clearPrefixesboolean?Also drop prefixes whose id equals source
Sharedcityrp.topHints.GetHintIcon(hint) → string?Source ☍

Resolve icon path for a hint (hint override, then prefix icon).

Parameters

Returns

  1. string?The resolved silkicon path, or nil if none applies.
Sharedcityrp.topHints.GetPool() → TopHintsHint[]Source ☍

Build a shallow copy of the display pool.

Returns

  1. TopHintsHint[]
Sharedcityrp.topHints.GetPrefix(id) → TopHintsPrefix?Source ☍

Resolve a prefix by id.

Parameters

  • idstring?Prefix id, as passed to RegisterPrefix.

Returns

  1. TopHintsPrefix?The registered prefix, or nil if id is unset/unknown.
Sharedcityrp.topHints.RegisterPrefix(id, data)Source ☍

Register or replace a named prefix (module tag + colour + optional icon).

Parameters

Sharedcityrp.topHints.RemoveHint(index)Source ☍

Remove a registered hint by index.

Parameters

  • indexnumber

Fields

Sharedcityrp.topHintsSource ☍
Sharedcityrp.topHints.cycleSecondsSource ☍
Sharedcityrp.topHints.hintsSource ☍
Sharedcityrp.topHints.prefixesSource ☍
Sharedcityrp.topHints.shuffleHintsSource ☍

TopHintsHint

4 fields Source ☍
SharedTopHintsHint.iconSource ☍

Optional icon override

SharedTopHintsHint.prefixSource ☍

Optional prefix id

SharedTopHintsHint.sourceSource ☍

Registration source key for clear/reload

SharedTopHintsHint.textSource ☍

Hint body text

TopHintsPrefix

3 fields Source ☍
SharedTopHintsPrefix.colorSource ☍

Prefix colour

SharedTopHintsPrefix.iconSource ☍

Optional silkicon path (icon16/...)

SharedTopHintsPrefix.labelSource ☍

Display label (shown as [label])