core.plugins.lite_character.sv_init
Lite Character System -- server-side persistence, activation channel, and lockout. Slot data is never cached on the player for the session -- it's accessed rarely enough (open editor, save, activate) that every read/write goes straight to the DB instead of keeping a stale in-memory copy around.
- Servercityrp.litecharacter.BeginActivation(ply, slot)Source ☍
-
Begins the stand-still activation channel for a slot.
Parameters
- plyPlayer
- slotnumber
- Servercityrp.litecharacter.CancelActivation(ply, reason)Source ☍
-
Cancels a running activation channel, if any.
Parameters
- plyPlayer
- reasonstring|nilPlayer-facing notify message. Omit for a silent cancel (e.g. disconnect).
- Servercityrp.litecharacter.CompleteActivation(ply, slot, record) → boolean|nilSource ☍
-
@param
record— The already-fetched record for this activation.Parameters
- plyPlayer
- slotnumber
- recordtableThe already-fetched record for this activation.
Returns
- boolean|nil
- Servercityrp.litecharacter.DeleteSlot(ply, slot, callback)Source ☍
-
Deletes a player's saved slot entirely. Distinct from saving a slot withevery field blank.
Parameters
- plyPlayer
- slotnumber
- callbackfun(ok: boolean, reason: string|nil)
- Servercityrp.litecharacter.IsLockedOut(ply) → booleanSource ☍
-
Parameters
- plyPlayer
Returns
- boolean
- Servercityrp.litecharacter.PushLockoutState(ply)Source ☍
-
Pushes the player's current lockout countdown.
Parameters
- plyPlayer
- Servercityrp.litecharacter.ResetLockout(ply)Source ☍
-
Clears the lockout early (death / team change). No-op if not currently locked out.
Parameters
- plyPlayer
- Servercityrp.litecharacter.SaveSlot(ply, slot, data, callback)Source ☍
-
Validates and persists one slot from a client-submitted payload. Never trusts the client
Parameters
- plyPlayer
- slotnumber
- datatableShaped like cityrp.litecharacter.EmptyRecord (raw client input).
- callbackfun(ok: boolean, warnings: string[])
- Servercityrp.litecharacter.SendSummary(ply)Source ☍
-
Pushes the per-slot populated/name summary the notches render from.
Parameters
- plyPlayer
- Servercityrp.litecharacter.SetLockout(ply, until_)Source ☍
-
@param
until_— CurTime() timestamp the lockout ends at (0 to clear).Parameters
- plyPlayer
- until_numberCurTime() timestamp the lockout ends at (0 to clear).
- Servercityrp.litecharacter.ValidateActivation(ply, record) → boolean, string|nil, string|nil, string|nil, string|nil, boolean|nilSource ☍
-
Re-validates every saved selection in a record against the player's current inventory/authorization
Parameters
- plyPlayer
- recordtable
Returns
- 1boolean
- 2string|nilPlayer-facing rejection reason, only set when ok is false.
- 3string|nilOnly set when ok is true.
- 4string|nilResolved playermodel path. Only set when ok is true.
- 5string|nilNon-fatal notice for an otherwise-successful activation (Team Character job-mismatch, or a modelItem requirement no longer met).
- 6boolean|nilTrue when record.modelItem exists but was soft-failed (requirements no longer met) -- tells CompleteActivation's Phase 2 to leave the model alone instead of applying record.modelItem unconditionally.
- Servercityrp.litecharacter.ValidateOwnedAccessory(ply, uniqueID, expectedType) → boolean, string|tableSource ☍
-
@param
expectedType— CityAccessories .Type this dropdown slot is fixed to.Parameters
- plyPlayer
- uniqueIDstring
- expectedTypestringCityAccessories .Type this dropdown slot is fixed to.
Returns
- 1boolean
- 2string|table
- Servercityrp.litecharacter.ValidateOwnedBodygroupAccessory(ply, uniqueID, modelPath) → boolean, string|table, booleanSource ☍
-
@param
modelPath— The playermodel path this accessory must be compatible with.@return
ok@return
itemOrReason@return
modelMismatch— True only when the sole problem is item not fitting modelPath -- distinct from not owned/excluded/unregistered, which is a real "missing item". Lets callers (e.g. ValidateActivation) treat a mismatch as skip-worthy instead of a hard failure.Parameters
- plyPlayer
- uniqueIDstring
- modelPathstring|nilThe playermodel path this accessory must be compatible with.
Returns
- 1boolean
- 2string|table
- 3booleanTrue only when the sole problem is item not fitting modelPath -- distinct from not owned/excluded/unregistered, which is a real "missing item". Lets callers (e.g. ValidateActivation) treat a mismatch as skip-worthy instead of a hard failure.
- Servercityrp.litecharacter.ValidateOwnedItem(ply, uniqueID, requiredCategoryParent) → boolean, string|tableSource ☍
-
Validates that a player owns a usable, non-excluded item of the given parent category.
Parameters
- plyPlayer
- uniqueIDstring
- requiredCategoryParentstring|nilPass nil to skip the category check.
Returns
- 1boolean
- 2string|tableThe item table on success, a player-facing reason string on failure.