CityRP Documentation Repository

core.plugins.lite_character.sh_init

Lite Character System -- shared constants, exclusion table, and record wire format.

Functions

Sharedcityrp.litecharacter.CanUseSlot(ply, slot) → boolean, string|nilSource ☍

@return ok

@return reason — Player-facing rejection reason.

Parameters

Returns

  1. 1boolean
  2. 2string|nilPlayer-facing rejection reason.
Sharedcityrp.litecharacter.EmptyRecord() → tableSource ☍

A blank slot record -- used as the default when a slot has nothing saved yet.

Returns

  1. table
Sharedcityrp.litecharacter.FindTeamForModel(modelPath) → number|nilSource ☍

@return team — The first TEAM_* whose own model list (either gender) contains modelPath.

Parameters

  • modelPathstring

Returns

  1. number|nilThe first TEAM_* whose own model list (either gender) contains modelPath.
Sharedcityrp.litecharacter.GetSelectableTeams() → { index: number, name: string }[]Source ☍

Every real, selectable team for the "Character Team" browser -- excludes TEAM_AFK, sorted by name.

Returns

  1. { index: number, name: string }[]
Sharedcityrp.litecharacter.GetSlotRequirement(slot) → string|nil, fun(ply: any):boolean|nilSource ☍

@return label — The tier name gating this slot, or nil if unrestricted.

@return check

Parameters

  • slotnumber

Returns

  1. 1string|nilThe tier name gating this slot, or nil if unrestricted.
  2. 2fun(ply: any):boolean|nil
Sharedcityrp.litecharacter.GetTeamCharacterModels(team, gender) → string[]Source ☍

Every model path available to team's "Team Character" category for the given gender, de-duplicated

Parameters

  • teamnumberA TEAM_* constant.
  • genderstring"Male" or "Female".

Returns

  1. string[]
Sharedcityrp.litecharacter.GetTeamModelCategory(team) → tableSource ☍

@param team — A TEAM_* constant.

@return categoryTeams — Array of TEAM_* constants sharing team's category (always includes team itself, even if uncategorized).

Parameters

  • teamnumberA TEAM_* constant.

Returns

  1. tableArray of TEAM_* constants sharing team's category (always includes team itself, even if uncategorized).
Sharedcityrp.litecharacter.GetTeamModelCategoryNames(team) → string[]Source ☍

Display names of every job sharing team's "Team Character" category

Parameters

  • teamnumberA TEAM_* constant.

Returns

  1. string[]
Sharedcityrp.litecharacter.IsExcluded(uniqueID) → booleanSource ☍

Whether an item is excluded from the lite character system entirely.

Parameters

  • uniqueIDstring

Returns

  1. boolean
Sharedcityrp.litecharacter.NetReadRecord() → tableSource ☍

Reads a full slot record from the currently open net message.

Returns

  1. tableSee EmptyRecord for shape.
Sharedcityrp.litecharacter.NetWriteRecord(record)Source ☍

Writes a full slot record to the currently open net message. Shared wire format used both for the server sending a saved slot to the editor (SlotData) and the client sending its edits back (SaveSlot).

Parameters

  • recordtable|nilA record as shaped by EmptyRecord, or nil for blank.

Tables

SharedLITECHAR_ACCESSORY_SLOTSSource ☍

Every CityAccessories Type -- one dropdown per slot in the editor.

SharedLITECHAR_EXCLUDED_ITEMSSource ☍

Developer exclusion table. Anything listed here is invisible to every dropdown in this system (Model/Accessories/Bodygroup Accessories/Extras) and is also re-rejected server-side at save time and activation time, regardless of what a client sends. Extend by adding one line -- no other code changes required.

SharedLITECHAR_SLOT_TIERSSource ☍

Reserves slots off the END of the range for players who pass check, working backward through the list -- e.g. with the defaults below and LITECHAR_SLOTS = 10: the last 5 slots (6-10) require HasMembership, then the next 2 slots counting backward (4-5) require IsMember. Slots 1-3 stay unrestricted. Reorder/add/resize entries freely; both ply:IsMember() and ply:HasMembership() are defined shared (core/metatables/sh_player.lua) so this works identically client- and server-side.

SharedLITECHAR_TEAM_MODEL_CATEGORIESSource ☍

Groups jobs (TEAM_* constants) that should share one pooled "Team Character" model list -- e.g. a Police Officer and Police Chief can each pick from either job's own team models.

Fields

SharedLITECHAR_CHANNEL_SECONDSSource ☍

Flat seconds the player must stand still before an activation applies.

SharedLITECHAR_LOCKOUT_SECONDSSource ☍

How long the whole system is locked out for after an activation completes. Global across all slots, reset early on death or team change.

SharedLITECHAR_MOVE_TOLERANCESource ☍

Squared-distance tolerance (in units)

SharedLITECHAR_SLOTSSource ☍

Number of preset slots ("notches") each player has.