Package: 7722216
# Overview
A burner phone script for criminal roleplay. Players buy a phone from a dealer, underground contacts message them through the Relay messenger and hand out jobs: picking people up, moving packages and supplying buyers.
Works with Qbox, QBCore and ESX Legacy. Framework, inventory and target are detected automatically and can be forced in the config.
# Requirements
- Framework: Qbox, QBCore or ESX Legacy (detected automatically)
- Inventory: ox_inventory, or qb-inventory and forks on QBCore. ESX requires ox_inventory
- Target: ox_target or qb-target. Without either, an [E] prompt is used
- Libraries: ox_lib and oxmysql
- OneSync: required. sv_entityLockdown must not be set to strict
- Database: 3 tables, created automatically on first start
# Installation
- Place ct-underground in your resources folder
- Register the items burner_phone and ct_paperbag: for ox_inventory add the entries from install/ox_inventory.lua to ox_inventory/data/items.lua, for qb-inventory add the entries from install/qb-core.lua to qb-core/shared/items.lua
- Copy install/burner_phone.png and install/paperbag.png into your inventory's image folder
- Start ct-underground after your framework, inventory and target in your server.cfg (see below)
- Restart the server. The database tables are created on first start
- Set the dealer position and price in config.lua
Start order in your server.cfg:
```
ensure ox_lib
ensure oxmysql
# your framework, inventory and target
ensure ct-underground
```
# Configuration
All settings are in config.lua:
- Config.Dealer.coords: where the dealer stands, use ground-level coordinates
- Config.Dealer.model / scenario: ped model and idle scenario (default s_m_y_dealer_01, smoking)
- Config.Purchase.price / account: default 1500, cash (cash maps to money on ESX automatically)
- Config.Purchase.ownershipCheck: inventory = one phone in the pockets at a time, a lost phone can be bought again. once = one purchase per character
- Config.Phone.registerUnknown: phones without a serial (e.g. from /giveitem) get registered on first use
- Config.Phone.animation: holding animation and prop while the phone is open
- Config.Phone.defaultTheme: dark or light for new phones
- Config.Pin.maxAttempts / lockout: wrong PINs before the phone locks, and for how many seconds (default 3, 60)
- Config.Locale: false follows ox_lib's ox:locale convar. Ships with en and de
# Texts and contacts
- Locales: all texts, including the dealer's lines and every message, are in locales/[lang].json
- Config.Contacts: defines the contacts. delay sets the seconds between unlocking a contact and its first messages
- Message keys: messages are stored by key, so changing a text updates it on every existing phone
# Jobs
Jobs are defined in missions.lua or built in game with CT Studio (sold separately).
Job types:
- pickup: find a person in a search area, take them along by threatening or talking, hand them over somewhere else
- fetch: get a package from a place, possibly guarded, and bring it to a receiver
- courier: get a package from someone in person and bring it to a receiver
- supply: bring a list of items to a buyer, all at once or bit by bit
Options per job:
- contact, requires, reward, timeLimit, retryCooldown, declineCooldown, unlocks, unlockDelay, scenes
Rules:
- One regular job per character at a time. Supply jobs run alongside
- Each job is completed once per character unless it is repeatable
- Only the character who accepted a job can continue it. Passing the phone on doesn't hand the job over
- A job fails when the target or the player dies, the time limit runs out, the player cancels, disconnects or switches character, or the phone or target stays away too long (graceTime)
- After a failure the contact offers the job again after retryCooldown
- All job NPCs, vehicles and packages are removed when a run ends. Leftovers from a crash are cleaned up on the next start
# Packages and guards
- package.mode item: a real inventory item. It can be dropped or stolen, whoever delivers it gets the reward
- package.mode prop: carried visibly in the hands, no running and no weapon while carrying, vehicles optional
- guardMode passive: guards only fight back once one of them gets hurt
- guardMode defend: guards open fire on anyone within alertRadius, and as soon as the target or package is taken
# Included jobs
- The Pickup: a man hides at the Yellow Jack Inn, watched by three bikers. Bring him to a meeting point in the hills
- The Bag: unlocks after The Pickup. A paper bag on a lot in Grapeseed, guarded by six armed agents. Bring it to a middleman at the Alamo Sea
# Admin commands
- /resetburnerpin [serial]: removes a phone's PIN. The serial is shown in the item description
- /ctunderground status [player ID]: shows a player's phones, running job, progress and pending messages
- /ctunderground reset [player ID] [mission|contacts|all] [mission ID]: resets job progress, contacts or both. The phone, its PIN and its settings are never deleted
- All commands also work from the server console
# Exports
Available for other resources:
```
setCatalog(data)
getConfigCatalog()
getMissionTypes()
startTestRun(source, document, scene)
stopTestRun(source)
```
# Usage
- Close the phone with Esc or the home button. Backspace goes back one screen
- If the phone leaves the inventory while it's open, it closes