Frank Shop — Documentation
Product documentation for the Frank Shop FiveM (ESX) convenience shop addon sold on the Cfx Marketplace.
# frank-shop
Small local convenience shop for FiveM (GTA V), ESX legacy. Built for the CodeM
server (ESX + oxmysql). Fixed in-game prices, zero chance mechanics, no
real-money linkage.
## What it does
- Player presses **F8** (or runs `/frank_shop`) to open a small NUI menu.
- Menu lists 6 items at fixed prices (see `shared/config.lua`):
| Item | ESX item name | Price (in-game $) |
|---|---|---|
| Water Bottle | `water` | 250 |
| Sandwich | `sandwich` | 800 |
| Burger | `burger` | 1200 |
| Bandage | `bandage` | 500 |
| Painkillers | `painkillers` | 700 |
| Cell Phone | `phone` | 15000 |
- Buying is validated **server-side only** (client is never trusted).
## Purchase rules (server.lua)
| Rule | Check | On failure |
|---|---|---|
| R1 | item exists in `Config.Items` | reject `unknown item` |
| R2 | price is an integer > 0 (config guard) | reject `bad price` |
| R3 | player exists on the server | reject `no player` |
| R4 | player money >= price | reject `insufficient funds` |
| R5 | same player cannot buy again within 500 ms (`Config.MinBuyIntervalMs`) | reject `rate limited` |
| R6 | success: `removeMoney(price)` + `addInventoryItem(name, 1)` + notify | — |
## Legality (Cfx Creator Platform License Agreement, 10 Sept 2026)
- §3.1: no cash-out, no gambling, no loot boxes/gacha/chance mechanics, no
real-money exchange of virtual currency — this shop has none of those:
fixed prices, in-game cash only.
- §2.3: third-party storefronts must not imply Rockstar approval and must not
use Rockstar IP in names/branding — the NUI footer carries the disclaimer
"Fixed in-game prices. Not affiliated with Rockstar Games." and the
resource is named `frank-shop`.
- Items use generic ESX item names; adjust `Config.Items` to whatever item
names actually exist on the target server (`esx_items` / `ox_inventory`).
## Files
fxmanifest.lua resource manifest (cerulean, gta5, deps: esx_core)
shared/config.lua items, prices, rate-limit, shop name (single source of truth)
server.lua purchase validation + sale (rules R1-R6)
client.lua F8 keybind, /frank_shop command, NUI callbacks
html/index.html self-contained NUI menu (no external assets)
test/harness.lua 25-check test harness (stubs FiveM + ESX)
## Tests
Verified 2026-11-06 with Lua 5.5 (`/opt/homebrew/bin/lua`, brew `lua`):
- `luac -p` syntax check: all 5 Lua files OK.
- `lua test/harness.lua` → **25 pass, 0 fail**, exit 0. Covers R1–R6
(unknown item, bad prices 0/-50/2.5, no player, insufficient funds,
exact deduction on success, 500 ms rate limit, post-window re-buy,
all 6 config items at exact listed prices, net-event wiring).
Note: `client.lua` is syntax-checked only — full client behaviour (keybind,
NUI) needs a live FiveM server, which is a human/deploy step.
## Publishing (needs an account — human step)
Per the order, STOP before any account work. When ready, the path is:
1. Cfx account (fivem.net) — Rockstar account required.
2. Creator application:
`https://support.cfx.re/hc/en-us/requests/new?ticket_form_id=26412427971484&tf_25882802333596=cfx_marketplace_creator_application`
3. List on the Cfx Marketplace (`https://marketplace.cfx.re`): one-time fee
(irrevocable license) or subscription (terminable) — §6 of the agreement.
No Rockstar Virtual Items resold, no brand servers — both compliant.