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.
- 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
- 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
- hintTopHintsHintThe hint to resolve an icon for.
Returns
- string?The resolved silkicon path, or nil if none applies.
- Sharedcityrp.topHints.GetPool() → TopHintsHint[]Source ☍
-
Build a shallow copy of the display pool.
Returns
- Sharedcityrp.topHints.GetPrefix(id) → TopHintsPrefix?Source ☍
-
Resolve a prefix by id.
Parameters
- idstring?Prefix id, as passed to RegisterPrefix.
Returns
- 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
- idstringPrefix id referenced by hints
- datatable|TopHintsPrefix
- Sharedcityrp.topHints.RemoveHint(index)Source ☍
-
Remove a registered hint by index.
Parameters
- indexnumber