CityRP Documentation Repository

cityrp.model

Model registration/access-condition library.

Functions

Servercityrp.model.all(model_str) → table<string, { access: fun(player: Player):(boolean, conds: function[]) }>Source ☍

Gets the internal index of every registered model.

Parameters

  • model_strstringUnused.

Returns

  1. table<string, { access: fun(player: Player):(boolean, conds: function[]) }>The registered model index.
Servercityrp.model.exists(model_str) → booleanSource ☍

Checks whether a model is registered.

Parameters

  • model_strstringThe model path to check.

Returns

  1. booleanWhether the model is registered.
Servercityrp.model.register(model_var, cond_fn)Source ☍

Registers one or more models, optionally gated by an access-condition function.

Parameters

  • model_varstring|tableA model path, or a (possibly nested) table of model paths, to register.
  • cond_fnfun(player?: Player):booleanAn access-condition function evaluated per model access.
Servercityrp.model.remove(model_str)Source ☍

Deregisters a registered model.

Parameters

  • model_strstringThe model path to remove.

Tables

Servercityrp.modelSource ☍
Servercityrp.model.idxSource ☍