Page cover

microchipCodexCore

Framework‑neutral API layer for RedM modules. This document enumerates every public function, export, and event, with client + server examples. Internal helpers (e.g., native wrappers, CheckVar) are o


🔰 Setup & Exports

Resource Order

Add in server.cfg:

ensure codex_core
# ensure your modules after this (e.g. codex_trustlevel)

fxmanifest.lua

Exports (Client)

  • getLibClient

  • CodexAPIsInit

  • Progressbar

Exports (Server)

  • getLibServer

Config

config.lua selects target framework and SQL driver.

CodexCore maps calls internally so your module code remains framework‑neutral.


🤝 Client Library — CodexCore

Get Library

Returns the CodexCore client facade.


Core Functions

CodexCore.RequestCoreAPI()

Returns the underlying framework client object.

⚠️ Use only if CodexCore does not already provide an abstraction.


CodexCore.IsLoaded()

Checks whether the local player is fully loaded.


CodexCore.GetCharacterIdentifier()

Returns a unique character identifier.


CodexCore.GetJob() / CodexCore.GetJobGrade()

Returns current job name and grade.


CodexCore.GetMoney() / CodexCore.GetGold()

Returns mapped balances.


CodexCore.GetGroup()

Returns permission group (e.g., admin, user).


🔁 RPC Callback (Client → Server)

CodexCore.TriggerServerCallback(name, cb, ...)

Parameter
Type
Description

name

string

Callback name registered on server

cb

function

Receives result from server

...

varargs

Arguments forwarded


🧰 Utility — AddBlipForCoords


🗯️ Client Sub‑APIs — CodexAPIsInit

Provides:

  • Prompt

  • Blip

  • Render

  • Buttons

  • Peds

  • Objects


⭐ Prompts API

Overview

Create grouped interaction prompts supporting: click, hold, customhold, mash, timed


Setup Prompt Group


Register Prompt


Prompt Loop Example


🗯️ Blips API

Create Blip

Radius


⭐ Buttons API


📍 Render API

Example — 3D Text


🧶 Objects API


🧍‍♂️ Peds API


📊 Progressbar


👮 Admin Command — /coords

Only available if:

Copies coordinates to clipboard in formats:

  • vec

  • vec4

  • json

  • xyz


💻 Server Library — CodexCore


🗄️ SQL Helper


👤 Player & Character


👮 Jobs & Groups


💰 Money & Accounts


🎒 Inventory


🔁 Callbacks

Server

Client


🛣️ Events Reference

Client Events

codex-core:playerLoaded


codex-core:notification


Server Events

codex-core:sendToDiscord


🔼 Versioning & Config

  • version.lua checks latest version and prints changelog

  • config.lua sets framework and SQL driver


💪 Best Practices

  • Stay framework‑neutral

  • Use callbacks for sensitive operations

  • Always guard DB results

  • Secure and rate‑limit critical events

  • Pair actions with notifications + progress bars


🔚 End‑to‑End Example — Shop Purchase

Client

Server

Last updated

Was this helpful?