Page cover

sunTrust Level System

🧭 Codex Studios – TrustLevel System (RedM) A modular trust reputation & black‑market system for RedM servers powered by CodexCore. Supports VORP, RSGCore, and TPZCore frameworks.


šŸš€ Overview

The Codex TrustLevel System introduces a player-based reputation system designed for immersive RedM gameplay.

Players earn or lose trust in multiple categories (moonshine, breaker, drugcooker, etc.), unlocking:

  • Black‑market shops

  • Exclusive missions

  • Special NPC interactions

Built on CodexCore, it integrates directly with your:

  • Economy

  • Inventory

  • Prompts

  • Character data


šŸŽÆ Key Features

  • Persistent trust levels per player (stored in SQL)

  • Dynamic trust‑gated black‑market shops

  • Custom missions and contraband systems

  • Cinematic draggable NUI HUD

  • Full CodexCore API integration

  • Plug‑and‑play with VORP, RSGCore, TPZCore

  • Developer‑friendly exports & events


āš™ļø Setup & Installation

Requirements

  • RedM Server (latest build)

  • CodexCore (required)

  • MySQL driver (ghmattimysql, oxmysql, or mysql-async)

  • Optional: codex_security for anti‑abuse handling


Installation Steps

  1. Drop the resource into your resources/ directory.

  2. Ensure CodexCore starts before this resource.

In server.cfg:

  1. Configure framework in:

Shared/codex-main_shared.lua

  1. Start your server. The system auto‑creates the trust table if migrations are enabled.


🧱 Database Schema

If Codex.Databasemigration = true is disabled, run manually:

Trust JSON Format


šŸ’» Client‑Side Developer Documentation

šŸ“¦ Exported Functions

getTrustLevel(category)

Returns: number — player’s trust value (defaults to 0).


šŸ”” Client Events

Event
Description

codex:setTrustLevel

Sync trust table from server

codex:openTrustShop

Opens trust‑based shop

codex-core:toggleTrustHUD

Toggle HUD visibility

codex:openUI

Open UI settings manually


šŸ›’ Trust‑Based Shops

Defined in codex-main_shared.lua under Codex.TrustShopPos.

Behavior

  • Player approaches NPC → Prompt appears (E)

  • If trust ≄ required → Shop opens

  • Else → Notification shown


šŸŽ® Custom Missions & Interactions

Selling Contraband (Client)


Requesting a Mission


šŸŽØ UI & Settings

Open in‑game:

You can:

  • Change icon color & size

  • Toggle HUD visibility

  • Import / export layouts (JSON)

All settings are stored locally using localStorage.


šŸ–„ļø Server‑Side Developer Documentation

šŸ”¹ Core Trust Events

Add Trust


Remove Trust


Sync Trust to Client


šŸ’° Example — Selling Contraband (Server)


šŸŖ Example — Server‑Side Purchases


🧩 Integration Examples

šŸŽ Reward Trust After a Mission


šŸ”’ Restrict Access by Trust Level


āš°ļø Remove Trust on Death

Already built‑in:


🧠 Customization & Extension

āž• Add a New Trust Category

  1. Open Shared/codex-main_shared.lua

  2. Add category:

  1. Add icon: /html/images/smuggler.png

  2. Duplicate a HUD block in index.html

  3. Reward players:


🧩 Developer Commands

Command
Description

/uisettings

Open UI settings

/getuidata

Print trust data + refresh

/add_trust

Add 1 breaker trust (dev)

/remove_trust

Remove 25 breaker trust (dev)

/trustui_active

Show HUD

/trustui_hide

Hide HUD

/close_ui_menu

Force close UI


šŸ” Security & Debugging

  • Enable secure events:

  • Enable developer logging:

All transactions & trust updates will be logged when enabled.


🧩 Framework Compatibility

Framework
Status

VORP

āœ… Fully supported

RSGCore

āœ… Fully supported

TPZCore

āœ… Supported

CodexCore

🧠 Required base library

Last updated

Was this helpful?