Jixryo Criminal
NPCs your staff build in game, with dialogue the server checks and pays out all or nothing, and scenarios built in the world from the same builder.
Version 0.2.0 Updated See it on its script page
On this page
Jixryo Criminal is the resource jixryo_criminal, version 0.2.0. Staff make NPCs in game, place them, give them hours and behaviour, and write what they say. Players find those NPCs in the world and talk to them in a dialogue screen. What a player learns is kept as flags on their character, which later answers, other NPCs and other scripts can ask for. The same builder has a scenario tab: staff make a scenario (one job at one site), build it in the world, and a Live scenario's props stand in every game near it. Running a scenario (test runs, stages, loot, the alarm) is the next phase and is not in this build: the Spawn, Stop and Reset calls answer that test runs come with the scenario engine.
Every NPC, line, answer and scenario lives on the server. A player's game only learns about the NPCs standing within 120 m of it, and only one line of dialogue at a time while talking.
What players get
- NPCs in the world. An NPC stands at its spot doing what staff set (standing still, a GTA scenario or an animation, with a prop in hand if set). Close up it looks at you and greets you. The Talk option is on the NPC through ox_target.
- A dialogue screen. Talking turns the NPC to you and moves the camera between you onto its face. The screen shows the name, the role, the line typed out along the bottom and the answers on the right. Leave is always last.
- Locked and hidden answers. An answer you do not qualify for either shows locked with what it needs ("Needs: $100 cash", "Needs: 2 more people with you", "Needs: Come back later") or is hidden, as staff chose. Hidden answers never leave the server.
- Payouts that are all or nothing. When an answer takes money, gives an item, sets a flag or calls another script, everything is checked first and then done in order. If one step fails, the steps before it are put back. What cannot be undone (XP, a map mark, mail, a notification, a shop) only happens after all of that worked.
- Documents. An answer can hand over a note with a name and words on it (the presets use
stickynote). A later NPC can ask for that exact document by its id and take the whole copy. - Shops. An answer can open an ox_inventory shop next to the NPC. It opens only for the player the answer let in, for 90 seconds.
- Map marks, mail, notifications and XP. An answer can mark a place on the map for a while (with the GPS set if staff chose), send phone mail from the NPC, show a notification, or give skill XP.
- NPCs with a schedule and a temper. An NPC can be out only in certain hours of GTA's clock, on certain days, or only while the police on duty are within a range. It can refuse on-duty police with its own line. If set to run from a gun, a gun drawn within 15 m sends it off for everyone until it comes back after its minutes.
- Conversations that end cleanly. Walking away, nobody answering for three minutes, getting hurt, the NPC leaving or logging out all end the conversation on the server too.
- Live scenario sites. The props of a Live scenario that are there from the start stand near the site as frozen local objects. Nothing on them does anything yet (that is the scenario engine, the next phase).
What staff get
Staff with the builder ACE open the builder with /criminal.
- The NPC list. Every NPC with its group (a coloured slash), Live / Draft / Off and its lock. Search, filter by group or state, and pick one to see what talking to it needs (hours, days, police, refuses cops, runs from guns), its first words and its chain: the flags its answers ask for and who teaches them, the flags it teaches and who asks for them. A flag nobody teaches shows in amber.
- Edit, Test, Go live / Take down, Switch off, Lock, Duplicate, Export code, Delete. Delete asks for the name typed. Test runs the dialogue screen with nothing done for real and lists what each answer would do; hidden answers show and say so.
- New NPC opens the editor on a blank NPC in front of you. The editor's sections: Details (name, role, area, group), Appearance (any ped model, Copy my look, Randomise, every clothing part and prop the model really has, and on the online models heritage, face features, hair, beards, makeup and marks), Dialogue (lines and answers with their conditions and actions), Placement (up to 12 spots, used fixed, at random each restart or rotating every few hours), Schedule (hours, days, police on duty) and Behaviour (idle, prop in hand, mood, looks at you, greeting, refuses cops, runs from a gun and the minutes before it comes back).
- Presets. Five NPCs in one chain, each added as a Draft standing in front of you: Lebron sells the Stab City stash location, marks it on the map and sends you to Dutch; Dutch opens his back room shop for people Lebron sent; Vince only talks to people Lebron vouched for and wants a crew; Tiny sells the Paleto guard shift, at night only; Moira draws the vault blueprint (a document) for the people who know the shift.
- Codes. Export code gives a
JXC1-code for an NPC; Import code takes one back as a new Draft, checked like anything made in the builder. A broken code, a code of the other kind or an empty paste is refused. - Versions and locks. Every save carries the version it was opened at. If someone else saved since, the save is refused rather than lost. A locked NPC or scenario can only be changed by its author or by head staff.
- The scenario builder tab. The list of scenarios with group, status, lock and what it takes to start (the crew, the police, its needs). New scenario makes a Draft centred where you stand. The chosen one has Edit, Spawn (for now it says test runs come with the engine), Go live (it needs a stage first) or Switch off, Lock, Duplicate, Export code (a
JXS1-code), Delete (type the name), and a budget bar: props, guards and vehicles (600 at most), networked guards and vehicles (50 at most) and what your game already draws near you. - The catalog. 47 props in 7 categories with their pictures, 10 guard models and 8 vehicles, placed as object, storage, interactive, grabbable, alarm or camera, shop, zone, door, guard, vehicle, or one of your NPCs as a dialogue thing. Picking one puts it in your hand in build mode.
- The scenario editor. The camera goes over the site with everything placed standing there. Sections: Details, Start (where it starts, crew 1 to 4 by default, police, needs, what the world says when a start fails), Stages (up to 12, each with up to 6 objectives on placed things, a clock, and effects when it starts, is done or fails), Things (each thing's settings), Loot (tables of rows), Alarm and Reset. Save checks everything on the server and says what is wrong in plain words.
- Build mode. Walk and aim or fly the freecam; what you hold follows the aim, sits on what it lands on and faces you; the wheel turns it (or sizes a zone); snapping, a grid and lying on the surface; GTA's gizmo for fine moves; Enter places and saves at once with the next one already in hand; pick, move, copy and delete placed things; add one of ox_doorlock's doors near you or aim at a vault door of the map. A locked scenario can be flown round by other staff but nothing can be picked or placed.
Install
Stop nothing. Jixryo Criminal replaces no other resource.
Upload the folder whole. The page is already built in
web/build, with the catalog's pictures inweb/build/props.Order in
server.cfg. It needs ox_lib, oxmysql, qbx_core and Jixryo Core 1.3.0 or later (for the clock and the gizmo). It uses ox_inventory (items, shops), ox_target (the Talk option), ox_doorlock (a scenario's doors), lb-phone (mail) and Jixryo Skills (XP) through Jixryo Core when they are running, so start those before it too.server.cfg ensure ox_lib ensure oxmysql ensure qbx_core ensure ox_inventory ensure ox_target ensure ox_doorlock ensure jixryo_core ensure jixryo_criminalGive staff the builder. The first ACE opens the builder; the second also edits and unlocks NPCs and scenarios someone else locked.
group.godpasses both without an ACE.server.cfg add_ace group.admin jixryo.criminal allow add_ace group.god jixryo.criminal.head allowItems. It adds no items of its own. Answers give, take and sell the items your ox_inventory already has, and the server refuses any item it does not know ("there is no item called ..."). The presets use
lockpick,advancedlockpick,thermite,usb_drive,stickynoteand the crowbar, which the Jixryo ox_inventory fork has.The database. The resource makes its tables itself through Jixryo Core's migrations, in two steps:
jixryo_criminal_npcsandjixryo_criminal_flags, thenjixryo_criminal_scenarios.Full restart. On start it prints
version 0.2.0: N NPCs, N live; N scenarios, N live.
Coming from 0.1.0: upload the whole folder again (the page changed and the props pictures are new), then a full restart. The scenarios table is added by itself; the NPCs and flags stay as they are.
How other scripts' calls behave
Jixryo Criminal does not stand in for any other resource and provides no other resource's name. What it does for the rest of the suite:
- Its own conditions and actions. Any resource can register a condition or an action with
RegisterConditionandRegisterAction. They appear in the builder as "Another script" rows, and they go away when that resource stops: an answer that depended on one hides until the resource is back. - Flags.
HasFlag,GetFlag,SetFlagandClearFlagread and write the flags on a character by server id or by citizen id, online or offline. They are kept injixryo_criminal_flags. - Shops. Each shop action registers an ox_inventory shop called
jxcrim_<npc id>_<spot number>at the NPC's spots. AnopenShophook with the filter^jxcrim_asks this resource before any of them opens, and it opens only for a player an answer let in within the last 90 seconds, while the NPC is out. - Mail, XP, doors, the Talk option, the clock and the gizmo go through Jixryo Core's phone, skills, doors, target, clock and gizmo modules. XP goes to the crime skills, which list this resource as a source; other skills refuse it.
- Audit. Staff changes and answers that do something are written to Jixryo Core's audit log.
Its own API
Server exports (who is a player's server id or a citizen id):
| Export | What it does |
|---|---|
HasFlag(who, flag) | true or false. |
GetFlag(who, flag) | The flag's value (true when set without one), or nil. |
SetFlag(who, flag, value, minutes) | Sets a flag; value and minutes are optional (nil minutes is for good). false for a bad name, a name starting with @ (this resource's own marks) or a character it cannot find. |
ClearFlag(who, flag) | Clears a flag. |
IsTalking(src) | The id of the NPC the player is talking to, or false. |
RegisterCondition(name, { test, needs, label }) | A condition for the builder's "Another script" rows: test(src, arg) answers true or false; needs is the locked note. |
RegisterAction(name, { apply, check, undo, label }) | An action for the builder: check(src, arg) may refuse with false, 'why' before anything moves; apply(src, arg) does it (false, 'why' puts everything before it back); undo(src, arg) is called if a later step fails. |
Flag names are letters, digits and _ - . :, up to 48 characters. Names starting with @ are this resource's own marks and cannot be set from outside.
Client export:
| Export | What it does |
|---|---|
IsTalking() | The id of the NPC this player is talking to, or false. |
Callbacks (ox_lib, client to server):
| Callback | Who | What |
|---|---|---|
jixryo_criminal:server:staff | Staff | The NPC builder: open, list, get, save, status, lock, delete, duplicate, export, import, preset, test. |
jixryo_criminal:server:scenario | Staff | The scenario builder: list, get, doors, create, save, place, removeThing, status, lock, delete, duplicate, export, import. spawn, stop and reset answer "Test runs come with the scenario engine (phase B3)." |
jixryo_criminal:server:talk | Players | Starts talking to an NPC by id: its name, role and first line with the answers you may see. |
jixryo_criminal:server:answer | Players | Picks an answer by its number on the line you are on, or leave. |
Events:
| Event | Direction | What |
|---|---|---|
jixryo_criminal:client:stream | Server to a game | The Live NPCs within 120 m to add or remove: look, spot and behaviour only. |
jixryo_criminal:client:sites | Server to a game | The Live scenario sites near the game: each prop's model and where it stands, nothing else. |
jixryo_criminal:client:builder | Server to a game | Opens the builder (after /criminal passed the ACE check). |
jixryo_criminal:client:flee | Server to games | An NPC runs off. |
jixryo_criminal:client:talkEnd | Server to a game | The server ended the conversation. |
jixryo_criminal:server:leave | Game to server | The player left the dialogue. |
jixryo_criminal:server:spooked | Game to server | A game reports a gun out near a fleeing NPC; the server checks the gun and the distance itself. |
Codes: an NPC's export code is JXC1-<base64>-<checksum>; a scenario's is JXS1-<base64>-<checksum>. Both are checked for the checksum and then cleaned like anything the builder sends.
Audit actions: criminal.answer, criminal.create, criminal.save, criminal.status, criminal.lock, criminal.delete, criminal.duplicate, criminal.import, criminal.preset, and for scenarios criminal.scenario.create, criminal.scenario.save, criminal.scenario.place, criminal.scenario.unplace, criminal.scenario.status, criminal.scenario.lock, criminal.scenario.delete (with its code), criminal.scenario.duplicate, criminal.scenario.import.
Commands and keybinds
| Command or key | Who | What |
|---|---|---|
/criminal | Anyone types it; the server opens the builder only for staff with the ACE | Opens the builder. Everyone else is told "Staff only". The command name is Config.command. |
| Arrows or 1 to 9, Enter, Esc | Players, in the dialogue screen | Choose an answer, answer, leave. |
| Drag, wheel, F, R | Staff, in the NPC editor | Turn the camera round the NPC, zoom, frame the face, reset. Ctrl+S saves. N opens a new NPC from the list. |
| F | Staff, placing or building | The freecam: W A S D, Q and E down and up, Shift faster, Ctrl slower (Alt slower when placing an NPC). You stay where you are; the camera flies up to 400 m from you. |
| Mouse wheel | Staff, placing or building | Turns what you hold in 15 degree steps (1 degree with Shift); sizes a zone from 1 to 60 m. |
| G | Staff, building | Snapping down onto what is below, on or off. |
| Tab | Staff, placing or building | Hands what you hold to GTA's gizmo; Tab again switches move and rotate; the right button looks round; Space drops it to the floor. |
| Enter, or a left click | Staff, placing or building | Places what you hold (E also places when placing an NPC). In build mode it is saved at once and the next one is in your hand. |
| Left click on a placed thing | Staff, building | Picks it up (it lights up as you point at it). |
| Ctrl D | Staff, building | A copy of what you hold, with its settings. |
| Del, twice | Staff, building | Takes the thing you hold out of the scenario. |
| Left Alt | Staff, building | The cursor for the panel (snapping, the grid, lying on the surface, placing as something else, the strip of props). |
| Esc or Backspace | Staff, placing or building | Leaves the gizmo, then puts down what you hold, then leaves. |
The keys above are read directly by the resource and are not key mappings, so they cannot be rebound in the game's settings. There are no RegisterKeyMapping or lib.addKeybind entries.
Configuration
config.lua is listed in escrow_ignore, so it can be edited after upload.
| Key | Default | What it does |
|---|---|---|
Config.access.builder | { 'jixryo.criminal', 'group.god' } | ACEs that open the builder. |
Config.access.head | { 'jixryo.criminal.head', 'group.god' } | ACEs that also edit and unlock what someone else locked. |
Config.command | 'criminal' | The builder's command. |
Config.groups | jackson, staff, events, gangs, pd | Who an NPC or scenario is for: the coloured slash on its row. Ids are saved with each one. |
Config.stream.radius | 120.0 | Metres: a game gets the NPCs and Live sites within this of the player, and nothing else. |
Config.stream.every | 1500 | Milliseconds between the server's looks. |
Config.talk.reach | 2.5 | Metres: the Talk option's reach. |
Config.talk.slack | 1.5 | Metres the server allows on top of the reach (a player's position on the server lags). |
Config.talk.idle | 180 | Seconds: a conversation nobody answers ends. |
Config.talk.label, Config.talk.icon | 'Talk', 'fa-solid fa-comment' | The Talk option's label and icon. |
Config.flee.radius | 15.0 | Metres: a gun drawn this close sends a fleeing NPC off. |
Config.flee.report | 4 | Seconds between one game's flee reports. |
Config.blip | sprite 280, colour 0, scale 0.85 | The map mark an answer gives. |
Config.camera | distance 1.25, side 0.38, height 0.04, fov 40.0, ease 650 | The dialogue camera between the player and the NPC. |
Config.moods | 11 moods (Normal, Happy, Angry, Stressed, Sulky, Smug, Frustrated, Drunk, Injured, Sleepy, Focused) | The facial idle clips an NPC can wear. |
Config.limits.npcs | 400 | NPCs on the server. |
Config.limits.spots | 12 | Spots per NPC. |
Config.limits.lines | 60 | Lines per NPC. |
Config.limits.answers | 6 | Answers per line (Leave is added after them). |
Config.limits.rules | 8 | Conditions, and actions, per answer. |
Config.limits.text | 400 | Characters in a line the NPC says. |
Config.limits.label | 64 | Characters in an answer, a name, a note. |
Config.limits.money | 1000000 | The most one action pays or takes. |
Config.limits.count | 100 | The most of one item one action gives or takes. |
Config.limits.xp | 250 | The most XP one action gives. |
Config.limits.minutes | 43200 | The longest a flag, a cooldown or a map mark lasts (30 days). |
Config.limits.shop | 24 | Items in a shop. |
Config.limits.code | 120000 | Characters in an NPC import code. |
Config.accounts | { 'cash', 'bank' } | The money accounts an answer may pay into or take from. |
Config.shop.pass | 90 | Seconds a shop stays open to the player an answer let in. |
Config.mail.sender | 'Unknown' | The mail sender when the answer names none. |
Config.scenarios.limits.scenarios | 200 | Scenarios on the server. |
Config.scenarios.limits.placed | 200 | Things placed in one scenario. |
Config.scenarios.limits.objects | 600 | Props one scenario streams to players (the budget bar). |
Config.scenarios.limits.networked | 50 | Guards and vehicles one scenario spawns (the budget bar). |
Config.scenarios.limits.render | 2200 | The builder's world render load bar: objects the game already holds near you plus this site's. |
Config.scenarios.limits.stages | 12 | Stages per scenario. |
Config.scenarios.limits.objectives | 6 | Objectives per stage. |
Config.scenarios.limits.tables, .rows | 12, 12 | Loot tables, and rows per table. |
Config.scenarios.limits.patrol | 8 | Patrol points per guard. |
Config.scenarios.limits.needs | 4 | Items one piece of work asks for. |
Config.scenarios.limits.code | 400000 | Characters in a scenario import code. |
Config.scenarios.build.reach | 60.0 | Metres the aim reaches in build mode. |
Config.scenarios.build.leash | 400.0 | How far the freecam may fly from you, and how far from you a thing may be placed. |
Config.scenarios.build.grid | { 0.25, 0.5, 1.0 } | The grid sizes the panel's grid button steps through (none first). |
Config.scenarios.doors.radius, .max | 80.0, 30 | ox_doorlock's doors within this of you are offered, this many at most. |
The catalog of props, guard models and vehicles is shared/catalog.lua. The limits are enforced on the server: everything the builder sends is cut to them.
Security
- Staff calls check the ACE every time. Every action of both builder callbacks and
/criminalitself are refused without it ("Staff only"). Changes check the lock and the version, and a stale save is refused rather than written over someone else's. - Everything the builder sends is cleaned on the server. Text is trimmed and cut to length, numbers out of range go back to their defaults, unknown groups, moods, kinds, conditions and effects are dropped, and an item the server does not have is refused with its name. Import codes are checksummed and then cleaned the same way, so a forged code cannot carry a bad NPC or scenario in.
- A game gets only what stands near it. The stream carries the look, the spot and the behaviour of the Live NPCs within 120 m: never the name (until they talk), the list, their other spots or a word they say. A Live site sends only the models and places of the props there from the start: never the stages, the loot, the guards, the codes or what anything does.
- The dialogue comes one line at a time and hidden answers never leave the server. Every pick is checked again: the player is still there and close enough (reach plus slack), it is an answer on the line the server showed them, and its conditions still pass. On-duty police get the refusal line and no answers.
- Actions are all or nothing with undo for items, money, flags and other scripts' actions; what cannot be undone happens only after all of that worked.
- Shops are gated by the
openShophook: no pass from an answer in the last 90 seconds, no shop, and nobody else's pass works. - Running off is checked: the server reads the gun in the player's hands and the distance itself, at most once every 4 seconds per game.
- Build mode's placing is checked to be within the leash of you, the ox_doorlock door to exist, and the whole scenario is cleaned again on every change. Delete needs the name typed.
- Audit. Made, saved, status, lock, deleted (with its code), duplicated, imported and preset, for NPCs and scenarios, plus answers that did something, go to Jixryo Core's audit log.
- Rate limits on the talk and answer callbacks come from Jixryo Core's rate module
[inferred: the suites load the real rate module and the README says rate limits and one pick at a time stop double answers; the exact limits are not in config.lua].
Tests
Both suites run the real server on a real database (the resource's own migrations on SQLite) with Jixryo Core's real modules, then the real client in a stand-in game. Run on 2026-10-31.
| Suite | Result | What it covers |
|---|---|---|
jixryo_criminal.lua | 29 passed, 0 failed | The tables and cleaning, what the builder is told, the ACE, versions and locks, Live / Draft / Duplicate, codes, the five presets, the stream and its radius, hours / days / police, spot modes, talking a line at a time, refusing cops, answers checked again, all or nothing with undo, documents, once and cooldowns, crew / chance / skill / job / gang / time / flag values, after-actions (mark, notify, mail, XP), shops and the 90 second pass, running off, staff test runs, the flag exports, other scripts' conditions and actions, conversations ending, a restart, and the player's game (the frozen ped with Talk, the camera and page, Leave). |
jixryo_criminal_scenarios.lua | 18 passed, 0 failed | The scenario tab's data (47 props, 7 categories, 10 guards, 8 vehicles, 9 need kinds, 16 effect kinds, the doors near you), the ACE, create, save with every section cleaned, what the builder is told, needs and effects, build mode's place on the server (new, move, copy, ox_doorlock's door, too far, refused things), removeThing and what points at it, Live needs a stage, duplicate, delete with its code, codes, spawn / stop / reset's message, what each game gets of a Live site, a restart with a broken row skipped, the editor's camera over the site with stand-ins, build mode in the game (aim, wheel, snapping, grid, gizmo, Enter, Esc, pick, move, copy, delete, locked, zones, map doors, ox_doorlock doors, NPCs, Alt cursor, placing as, closing), and a player's game drawing a Live site. |
cd dev-tools/luarun && node run.mjs ../../jixryo_scripts/jixryo_criminal tests/jixryo_criminal.luacd dev-tools/luarun && node run.mjs ../../jixryo_scripts/jixryo_criminal tests/jixryo_criminal_scenarios.luaBoth suites share tests/jixryo_criminal.setup.lua. A filter word after the suite name runs only the tests whose name has it.
Check it in game
/criminalas staff opens the builder with the game blurred behind it. Without the ACE: "Staff only".- Presets, then Add Lebron where you stand: he appears as a Draft in the list. Edit him: he stands in the world and the camera turns round him (drag, wheel, F, R).
- Appearance: change his model, then Copy my look and Randomise. Each shows on him at once.
- Placement: aim, wheel, F for the freecam, Tab for the gizmo, Space, Enter. The page comes back with the spot. Check his feet are on the floor.
- Save, then Go live. Walk away past 120 m and back: he disappears and reappears, smoking.
- Walk up: he looks at you and says hi. The Talk option opens the dialogue on his face. With too little cash the paid answer shows locked with what it needs; with the money it takes the cash, marks the map with the GPS, shows a notification and hides itself after.
- Test from the builder runs the same screen with nothing done for real and lists what each answer would do.
- On duty as police, Lebron gives the refusal line only. Draw a gun close to him: he runs, for everyone, and comes back after his minutes.
- Add Dutch, go live, and talk to him after Lebron sent you: the shop opens next to him. Away from him, or without the answer, it does not.
- Lock an NPC with one staff account and try to save it with another: refused. Head staff can.
- Export code on one NPC, then Import code: a Draft copy arrives. Restart the resource: the NPCs come back where they were and the flags stay.
- Scenario builder: type a name and press Enter for a Draft centred where you stand. Catalog, Grabbable, Cash trolley: build mode with the trolley in your hand, following the aim, sitting on the floor and facing you. Wheel, G, Tab; Enter places it ("Cash trolley placed.") and the next is in hand; Esc puts it down; Esc again leaves.
- Build again and press F for the freecam. Hold Left Alt for the panel's cursor (try the grid and placing as Storage); let go to carry on. Point at the trolley and click: it lights up and is in your hand. Enter saves the move. Ctrl D copies it. Pick the copy, Del, Del: gone.
- Zone (the wheel sizes the ring), an ox_doorlock door near you (added at once), a vault door of the map (aim and Enter), a guard model (a frozen stand-in), a vehicle, one of your NPCs as itself, a security camera (what it watches drawn in red).
- Edit the scenario: the camera over the site with everything standing round it. Add a stage with an objective on the trolley and Save; then break something on purpose (an objective with nothing picked) and read what the save says.
- Go live with no stage: refused. With one: Live. Walk away past about 160 m and back: the props go and come. A thing set to show up at stage 2 is not there for players.
- Spawn: "Test runs come with the scenario engine (phase B3)."
- Lock the scenario with one staff account: another can fly round it but not build in it or save it. Export code then Import, and Duplicate: Draft copies. Delete (type the name): gone from every game at once. Restart the resource in build mode: nothing it made is left standing, and the scenarios come back as they were.