Custom Resources¶
All custom resources live in resources/[assets]/ and follow the ilg_ naming prefix. They are loaded automatically by ensure [assets] in server.cfg.
Resource Manifest Convention¶
Every ilg_* resource uses this manifest header:
fx_version 'cerulean'
game 'gta5'
lua54 'yes'
use_experimental_fxv2_oal 'yes'
Resource Inventory¶
Phase 1 — Core Systems (22 resources)¶
| Resource | Description |
|---|---|
ilg_achievements |
Player achievement tracking with NPWD app integration |
ilg_anticheat |
Server-side anti-cheat protections |
ilg_blackmarket |
Underground market system |
ilg_branding |
Server branding, loading screen, identity |
ilg_businesses |
Business ownership and management |
ilg_controls |
Keybind and control overrides |
ilg_crafting |
Item crafting system |
ilg_discord |
Discord integration and bridge |
ilg_economy |
Economy balancing and money sinks |
ilg_factions |
Faction management system |
ilg_heists |
Heist mechanics and progression |
ilg_insurance |
Vehicle and property insurance |
ilg_leaderboards |
Leaderboard tracking with NPWD app |
ilg_minigames |
Shared minigame library (lockpick, wires, etc.) |
ilg_narrative |
Dynamic story/mission system |
ilg_progression |
Player XP and leveling |
ilg_reputation |
Reputation system (criminal, civic, faction-based) |
ilg_seasons |
Seasonal content and events |
ilg_skilltrees |
Skill tree progression with NPWD app |
ilg_stafftools |
Admin/staff management tools |
ilg_tebex |
Tebex store integration |
ilg_territory |
Territory control system |
Phase 2 — World Immersion (6 resources)¶
| Resource | Files | Description |
|---|---|---|
ilg_welcome |
4 | Welcome Center NPC at Legion Square — rules, starter kit |
ilg_storenpcs |
3 | Shopkeeper NPCs at 28 store locations |
ilg_police |
7 | AI police with 5-star wanted system |
ilg_interiors |
6 | Interior access — 11 buildings, Casino, Cayo Perico |
ilg_cartheft |
7 | Car theft — carjacking, hotwiring, chop shops |
ilg_ainpc |
9 | AI NPCs with LLM conversation and persistent memory |
Phase 2 Details¶
ilg_welcome¶
Welcome Center NPC at Legion Square. Provides five menu options: server rules, getting started guide, jobs overview, key locations, and a one-time starter kit (phone, bread ×3, water ×3). Auto-opens on a player's first login.
Dependencies: qbx_core, ox_lib, ox_target, ox_inventory
| Config Key | Default | Notes |
|---|---|---|
Config.npc.coords |
Legion Square | NPC location |
Config.starterKit |
phone, bread ×3, water ×3 | Items given once per player |
Config.autoShowOnFirstJoin |
true |
Auto-open menu on first login |
ilg_storenpcs¶
Spawns cosmetic shopkeeper NPCs at all ox_inventory shop locations that lack built-in NPCs. Uses distance-based streaming (50m spawn, 75m despawn) to control performance. NPCs are purely visual — ox_inventory handles the actual shop interaction zones.
Dependencies: qbx_core, ox_lib, ox_target
| Store Type | Count | NPC Model |
|---|---|---|
| General Store | 10 | mp_m_shopkeep_01 |
| Liquor Store | 7 | mp_m_shopkeep_01 |
| YouTool Hardware | 2 | s_m_y_construct_01 |
| Ammunation | 9 | s_m_y_ammucity_01 |
| Config Key | Default | Notes |
|---|---|---|
Config.spawnDistance |
50.0 |
Streaming spawn radius |
Config.interactDistance |
2.5 |
ox_target range |
ilg_police¶
AI police system with a 1–5 star wanted level. Detects crimes (assault, murder, weapon discharge, vehicle theft, cop killing, robbery, military trespass), applies star increases, spawns AI police response that escalates with wanted level, and supports star decay when evading line-of-sight.
Dependencies: qbx_core, ox_lib, oxmysql
Optional: ilg_reputation (extra wanted stars for high-rep criminals, decay multiplier)
Wanted Response Tiers¶
| Stars | Behavior | Units | Vehicles | Helicopter | Weapons |
|---|---|---|---|---|---|
| 1 | Investigate | 2 foot cops | — | No | Pistol |
| 2 | Pursue | 3 cops | 1 cruiser | No | Pistol, Combat Pistol |
| 3 | Aggressive | 5 cops | 2 vehicles | Yes | Shotgun, Carbine |
| 4 | Aggressive | 7 SWAT | 3 vehicles | Yes | Carbine, SMG |
| 5 | Lethal | 10 military | 3 vehicles | Yes | Carbine, MG, RPG |
Server Exports¶
exports.ilg_police:GetWantedLevel(source) -- → number
exports.ilg_police:SetWantedLevel(source, stars)
exports.ilg_police:AddWantedStars(source, amount)
exports.ilg_police:ClearWantedLevel(source)
exports.ilg_police:ReportCrime(source, crimeType)
| Config Key | Default | Notes |
|---|---|---|
Config.exemptJobs |
police, bcso, sasp, ambulance | Immune to wanted system |
Config.realPoliceThreshold |
3 |
Real cops online before AI scales down |
Config.decayTime[1..5] |
120s–1200s | Decay timing per star level |
Config.losEvasionTime |
30 |
Seconds out-of-sight before decay |
Config.maxResponseNpcs |
15 |
Performance cap on AI cops |
ilg_interiors¶
Teleport-based interior access for 11 buildings plus Diamond Casino sub-areas and Cayo Perico island travel. Uses ox_target sphere zones at entry/exit points with fade-to-black transitions.
Dependencies: qbx_core, ox_lib, ox_target
Optional: ilg_police (military trespass reporting at Fort Zancudo)
Requires: bob74_ipl (interior props), game build ≥ 2060 (Casino), ≥ 2189 (Cayo Perico)
Available Interiors¶
| Location | Notes |
|---|---|
| Diamond Casino | Main floor + penthouse + management office |
| FIB Building | — |
| IAA Building | — |
| LifeInvader Office | — |
| Maze Bank Tower | — |
| Bahama Mamas | — |
| Tequi-La-La | — |
| Vanilla Unicorn | — |
| Fort Zancudo | Restricted — triggers military trespass |
| Sandy Shores Station | — |
| Paleto Bay Station | — |
| Cayo Perico | Airport + pier travel points |
ilg_cartheft¶
GTA-style vehicle theft system. Scans nearby NPC vehicles for unlock chance (varies by class), supports carjacking occupied vehicles (with NPC fight/flee reactions), hotwiring with minigame integration, and selling stolen vehicles at chop shop NPCs.
Dependencies: qbx_core, ox_lib, ox_target, oxmysql
Hard dependency: ilg_police (crime reporting, wanted stars)
Optional: ilg_reputation (criminal rep gains), ilg_minigames (hotwire minigame), qbx_vehiclekeys (key granting)
Chop Shop Locations¶
| Name | Location |
|---|---|
| Chop Shop - La Mesa | vector3(980.51, -1803.52, 31.14) |
| Chop Shop - Paleto | vector3(105.43, 6617.86, 32.44) |
| Config Key | Default | Notes |
|---|---|---|
Config.unlockChance[class] |
5%–50% | Per-class unlock probability |
Config.blockedClasses |
{18, 19} |
Emergency & military blocked |
Config.carjack.fightBackChance |
0.30 |
30% chance NPC fights |
Config.hotwire.difficulty[class] |
2–4 | Minigame difficulty |
Config.sellPrices[class] |
$2k–$15k | Base chop shop prices |
Config.sellCooldown |
600 |
10 min between sales |
ilg_ainpc¶
AI-driven NPCs with LLM-powered conversation, persistent memory, time-based schedules, and mood tracking. Ships with 8 unique NPC profiles, each with personality, backstory, daily schedule, and fallback responses for when the LLM is unavailable.
Dependencies: qbx_core, ox_lib, ox_target, oxmysql
Optional: ilg_reputation (player rep context in LLM prompts)
Requires: Ollama or OpenAI-compatible LLM endpoint
NPC Profiles¶
| ID | Name | Model | Personality |
|---|---|---|---|
mayor |
Mayor Johnson | a_m_m_business_01 |
Political, warm, evasive about corruption |
doctor |
Doc Martinez | s_m_m_doctor_01 |
Clinical, caring, dark humor |
mechanic |
Vinnie "The Wrench" | s_m_y_mechanic_02 |
Gruff, knowledgeable, streetwise |
cook |
Mama Rosa | a_f_o_genstreet_01 |
Warm, gossipy, maternal |
cop |
Officer Blake | s_m_y_cop_01 |
By-the-book, suspicious, fair |
gambler |
Lucky Liz | a_f_y_clubcust_01 |
Superstitious, fast-talking, risk-loving |
priest |
Reverend Thomas | a_m_o_genstreet_01 |
Philosophical, kind, occasionally judgmental |
informant |
Shadow | g_m_y_korean_01 |
Cryptic, paranoid, trades information |
LLM Configuration¶
| Config Key | Default | Notes |
|---|---|---|
Config.llm.endpoint |
http://localhost:11434/v1/chat/completions |
Ollama default |
Config.llm.model |
llama3.1 |
Any OpenAI-compatible model |
Config.llm.maxTokens |
150 |
Response token limit |
Config.llm.rateLimit.perPlayer |
5000 |
5s cooldown per player |
Config.llm.rateLimit.maxPerHour |
20 |
Hourly cap per player |
Config.llm.timeout |
15000 |
15s HTTP timeout |
Config.memory.contextCount |
5 |
Past memories in LLM context |
Config.memory.fadeAfterDays |
30 |
Auto-fade old memories |
LLM Endpoint Required
Without a running LLM endpoint, conversations fall back to pre-written fallbackResponses in each NPC profile. Install Ollama with llama3.1 for the full experience:
bash
ollama pull llama3.1
ollama serve # listens on :11434
Database Tables¶
Import before first start:
mysql -u qbadmin -p Qbox_C8A6FA < resources/[assets]/ilg_ainpc/sql/ilg_ainpc.sql
| Table | Purpose |
|---|---|
ilg_ainpc_memory |
Per-player conversation memories with auto-fade |
ilg_ainpc_state |
NPC mood and location tracking |
Cross-Resource Dependencies¶
ilg_cartheft ──→ ilg_police (ReportCrime, AddWantedStars)
ilg_interiors ──→ ilg_police (ReportCrime for military zones)
ilg_police ─────→ ilg_reputation (optional: extra stars, decay modifier)
ilg_cartheft ───→ ilg_reputation (optional: criminal rep gains)
ilg_cartheft ───→ ilg_minigames (optional: hotwire minigame)
ilg_ainpc ──────→ ilg_reputation (optional: player rep in LLM context)
All optional dependencies use pcall() wrappers and degrade gracefully if the target resource is not running.