Features
Cases and accessories
The official 3D case and accessory store and the player-run case market.
The Cases app dresses the player's phone. It has two sides that work together.
| Side | Config | What it is |
|---|---|---|
| Official store | Config.Accessories |
3D cases, accessories and name letters from fx-phone-assets. Bought once, kept forever, shown on the phone in the character's hand for everyone nearby |
| Player market | Config.Cases |
Players design printed cases and style kits, share them, sell them, run limited editions and resell numbered copies |
Cases is an App Store app (id = 'cases'), not installed by default. Everything is paid from the bank.
The tabs are Store, Explore, My Phone, Design and Studio.
#1. The official store (Config.Accessories)
#What is sold
The catalogue is the list of models in shared/accessories.lua, generated from fx-phone-assets.
| Section | Contents |
|---|---|
| Cases | Families: Solid, Clear, Rugged, Wallet, Battery, Teddy (bear), Alien and Job, each in several colours |
| Accessories | Charms, couple charms, lanyards, wrist straps, ring grips, MagSafe wallets, huggers, stickers, decos and flags |
| Letters | Letter styles (Black 3D, Bubble, Chrome, Gold, Sticker, White 3D). One set holds every letter, digit and symbol of that style |
A player buys an item once and owns it for good. Switching between owned items is free.
#My Phone
The My Phone tab shows the phone with what is on it, slot by slot: case, hugger, charm, strap, grip, stickers, decos, flag and name. The player puts on and takes off what they own. Apply to my phone saves it.
With a letter set the player writes a name or a short word on the back: up to MaxLetters characters, letters, digits and & @ ! # ? * ♥. The text can be changed any time without paying again.
Each letter takes the width of its own model, with the same gap between every two letters, so a wide letter (W, M) and a narrow one (I) stand evenly apart.
The name can also be moved from its usual place. In the phone shop's showroom, under the name field, Height moves it up or down the back and Left / Right moves it sideways, a millimetre per press; Centre puts it back. How far it can go is set by LetterMove. With LetterMove.Turn on, the name can also be turned on its side (reading up or down the phone), and the letters can be set closer together or further apart, between GapMin and GapMax times the normal gap. With every move value at 0 the position buttons are not shown and the name stays where the mount puts it.
A long name has less room across the back (Width), so it can move sideways less than a short one. Only the game knows how wide the letters are, so the Left / Right buttons go up to Side for every name: a long name may stop moving on the phone before the buttons stop.
The other parts (grip, hugger, stickers, decos, flag, charm, strap) can be moved the same way, each within its entry in PartMove. Cases never move.
#Who sees it
The kit is shown on the phone prop in the character's hand, for every player within DressRange metres. The parts are local objects on each player's game, so they add no networked entities. The player's own front camera leaves them out of the picture.
This needs the Config.Prop.Assets resource (fx-phone-assets) started. Without it the phone in hand is the plain game prop (Config.Prop.Model) and no kit is drawn.
#Job cases
Job cases (police, sheriff, EMS, fire, mechanic, news, taxi) cannot be bought. They are free for members of the job and show Job only to everyone else. When a player leaves the job, the case comes off their phone the next time the app or their kit is loaded.
JobCases maps each job case to the jobs that get it, by job type (QBCore and Qbox jobs.lua type) or by job name:
luaJobCases = {
police = { types = { 'leo' } },
fire = { jobs = { 'fire', 'firefighter', 'lsfd' } },
},
ESX jobs have no type, so on ESX list the job names under jobs.
#The battery case
The Battery family is a thick charging shell. While it is on, the battery drains at Config.Battery.BatteryCaseDrain of the normal rate (0.7, about 30 % slower). See Battery and signal.
#Prices
| Option | Default | What it changes |
|---|---|---|
Enabled |
true |
The store. false: nothing can be bought and no kit is drawn on phones |
CasePrices |
solid = 180, clear = 150, rugged = 420, wallet = 380, battery = 650, bear = 320, alien = 360, job = 0 |
Price per case family. A family left out costs 250 |
ItemPrices |
charm = 90, couple = 140, strap = 120, wriststrap = 140, ring = 110, magsafe = 160, hug = 220, sticker = 40, deco = 70, flag = 60 |
Price per accessory group. A group left out costs 100 |
LetterSetPrice |
450 |
One letter style |
MaxLetters |
10 |
Characters on the back |
LetterMove |
Up = 0.075, Down = 0.045, Side = 0.022, Width = 0.068, Turn = true, GapMin = 0.4, GapMax = 3.0, TurnSign = 1 |
How far, in metres, a player may move the name: Up towards the cameras, Down towards the bottom edge, Side left or right. Width is the room across the back; a long name is kept inside it. Turn: the name may be turned on its side. GapMin / GapMax: how much closer or further apart the letters may be set, as a share of the normal gap. TurnSign = -1 if a turned name reads backwards on your server. All moves 0: the name cannot be moved |
PartMove |
grip, hug, sticker, deco, flag, charm, strap | Per slot { Up, Down, Side } in metres: how far a player may shift that part from its mount. A slot left out, or all zeros, stays put |
Overrides |
{} |
Price of one model, e.g. ['fx_case_rugged_black'] = 500 |
JobCases |
7 jobs | Which jobs get each job case, see above |
Slots |
charm = 5, strap = 5, grip = 5, hug = 5, sticker = 5, deco = 5, flag = 5 |
How many parts of each slot a kit may hold, at most 5. 0 turns a slot off. charm holds charms and couple charms, strap holds straps and wrist straps, grip holds rings and MagSafe grips |
Spread |
per slot { x, z } |
Where the second and later parts of a slot go: each one a step further from the first, in metres (x across the back, z up it), taking turns on either side. inward = true makes every step go towards the middle of the phone (used for charms and straps). Stickers and decos use their own spots in Mounts first |
DressRange |
40.0 |
Other players' phones are dressed within this distance, in metres |
Mounts |
per slot | Where each slot sits on the phone, see below |
A model whose price works out to 0 is free for everyone: players can put it on without buying it.
#Mounts
Mounts gives each slot a position (pos, metres from the phone's centre, the back faces +Y) and a rotation (rot, degrees). sticker and deco have one entry per spot; parts beyond those spots are placed with Spread.
letters also has spacing (default 0.0072), which sets how airy the name is: the gap between two letters is 16 % of it, about 1.2 mm. For an exact gap, add gap in metres, for example gap = 0.0012. The width of each letter itself comes from its model.
The easier way is the Position tab in the phone shop's showroom (Phone shop). Admins (the fxphone.admin ace or a framework admin) move each slot on a real phone and press Save: the positions apply to every player at once and are kept by the server. Copy puts the mounts table on the clipboard, to paste into config.lua.
Positions saved from the showroom replace the config, slot by slot. After that, editing the same slot in config.lua has no effect until the saved positions are reset in the Position tab.
#The showroom
The phone shops can show the same store on a 3D phone on the counter, where the player tries everything on before buying. See Phone shop.
#2. The player market (Config.Cases)
#Prints and kits
| Kind | Made in | What it is |
|---|---|---|
| Design tab | A printed case drawn in the app: main colour, an optional fade, a finish (gloss, matte, clear), a pattern and its colour, up to MaxStickers stickers, an edge figure and a charm |
|
| Kit | My Phone tab, Sell this kit | A styled set of store parts (case, accessories, letters) |
A print is a picture in the app, not a 3D model: it is not drawn on the phone in the character's hand. Other scripts can read the print a player has on with GetEquippedCase. A kit is made of store parts and is drawn in 3D like any other kit.
#Publishing
When a player saves a design they choose:
- A name, 2 to 40 characters.
- Share in the shop or keep it private. A private design is free and only for its maker.
- A price, from 0 (free) to
MaxPrice. - Limited edition: a number of copies, from 1 to
MaxStock. Each buyer gets a numbered copy (#1, #2 ...). When they are gone, the edition is sold out.
A kit for sale needs at least two parts. Its price is the maker's design fee; the buyer pays that fee plus the store price of the parts they do not own yet.
A character can publish PerDay designs and kits in 24 hours.
#Explore
The feed has the tabs New, Popular (likes and sales of the last 14 days), Following, Limited and Resale, and a filter All / Prints / Kits. On a design the player can:
- Buy it, or Get it free. It goes into their collection and, if they choose, onto their phone.
- Gift it to a phone number. They pay, it goes into the other player's collection. A kit with a job case cannot be gifted.
- Like it, and Follow the designer. The designer gets a notification for a new follower.
- Design from this one: copy it into the editor as a starting point.
#Money
First sale. The buyer pays the price. The designer receives the price minus the cut of their creator level. The cut leaves the economy. For a kit, the money for missing parts goes to the store and also leaves the economy.
Creator levels. The designer's total copies sold sets their level. A higher level keeps less of each sale:
| Level | Copies sold | Cut |
|---|---|---|
| New Designer | 0 | 10 % |
| Rising | 25 | 8 % |
| Master | 100 | 6 % |
| Legend | 400 | 4 % |
Resale. An owner of a numbered copy can list it on Resale for 1 to MaxResalePrice. The copy keeps its number. When it sells, ResaleFee percent is kept by the market, Royalty percent goes to the designer (unless the designer is the seller) and the rest goes to the seller. A listing can be removed at any time.
The designer gets a notification for every copy sold, the seller for every resale.
#Studio
The Studio tab is the designer's dashboard: level and current cut, income over the last 14 days, copies sold, followers, copies listed for resale, best sellers and recent sales.
#Options
| Option | Default | What it changes |
|---|---|---|
Enabled |
true |
false switches the player market off for every request: nothing can be browsed, published, bought, gifted or resold. Copies players own stay theirs, and the one on their phone stays on. The official store is not affected |
MaxPrice |
5000 |
The most a creator may ask for a design or a kit fee (on top of the parts in a kit) |
Fee |
10 |
Percent kept from a sale at the first level, and at any level without a fee of its own (and for every sale when Levels is left out) |
PerDay |
10 |
Designs and kits one character may publish in 24 hours |
MaxStickers |
12 |
Stickers on a print. The editor and the server both follow it |
MaxStock |
500 |
Largest limited edition |
ResaleFee |
8 |
Percent kept by the market on a resale |
Royalty |
5 |
Percent of a resale paid to the creator |
MaxResalePrice |
50000 |
Highest resale price |
Levels |
4 levels: 0 sales (uses Fee), 25 sales 8 %, 100 sales 6 %, 400 sales 4 % |
{ sales, fee }: copies sold for the level and the cut it keeps, lowest first. A level without fee uses Fee |
#Setting it up
- Ensure
fx-phone-assetsin server.cfg.Config.Prop.Assetsmust be its resource name (default'fx-phone-assets'). - Check
JobCasesagainst your job names and types. - Open the showroom in a phone shop as an admin and check the accessory positions on a real phone. Save them there, or copy them into
Mounts. - Set the prices you want. Cases is not installed by default: players get it from the App Store, or set
default = trueoncasesinConfig.Apps.
#For scripts
GiveAccessory(identifier, model) gives a character a store item for free, for example as a reward. GetPhoneKit(src) returns what is on a player's phone. GetEquippedCase(identifier) returns the print they have on. All three are on Server exports: other.
#Good to know
- Nothing shows on the phone in hand.
fx-phone-assetsis not started,Config.Prop.Assetsdoes not match its name, orConfig.Accessories.Enabled = false. A part that will not load is skipped with a line in the F8 console. - A slot holds fewer parts than
Slotssays. Five per slot is the upper limit; higher values are lowered to it. - I changed
Mountsand nothing moved. Positions saved in the showroom take priority. Reset them there. - A job case came off. The player left the job, or the job is not in that case's
JobCasesentry. - The Cases app stays on phones with
Config.Cases.Enabled = false. It also holds the official store, which has its own switch (Config.Accessories.Enabled). Remove the app withhidden = trueinConfig.Appsif you want both gone.