Charge per tattoo#
Price each new tattoo and set a few by hand in shared/tattoos.lua with a cost key:
-- shared/overrides/myserver.lua
Config.TattooFlatFee = false
Config.TattooCost = 250 -- tattoos without their own cost
The checkout prompt shows the shop fee plus each new tattoo. The server prices the tattoos again from the config, compares them with the saved skin, and charges nothing if its total differs from the one the prompt showed.
Add a walk-in barber#
-- shared/overrides/myserver.lua
Config.Stores[#Config.Stores + 1] = {
type = "barber",
coords = vector4(-814.3, -183.8, 37.6, 116.0),
size = vector3(4, 4, 4),
rotation = 30,
usePoly = false,
showBlip = true,
}
Players pay only within Config.ShopCheckRadius of a barber, so keep coords inside the shop.
Lock a uniform pack to a job#
-- shared/blacklist.lua or an override file
Config.CollectionLocks = {
{ label = "EMS", collections = { "mp_m_my_ems_pack", "mp_f_my_ems_pack" }, jobs = { "ambulance" } },
}
Players without the job do not see the items. With Config.ServerClothingLocks on, the server also puts back any of them a save or a share code tries to add. /clothinglocks writes every locked number to clothing_locks_male.txt and clothing_locks_female.txt.
Open the shops from your own script#
Client side:
TriggerEvent("illenium-appearance:client:openClothingShop")
TriggerEvent("illenium-appearance:client:openOutfitMenu")
TriggerEvent("illenium-appearance:client:reloadSkin")
From the server, open the ped menu for a player. Grant it first, or the ped they pick is not saved:
exports["glitch-appearance"]:GrantPedMenu(src, 15)
TriggerClientEvent("illenium-appearance:client:openClothingShopMenu", src, true)
Read a player's look#
local appearance = exports["glitch-appearance"]:getPedAppearance(cache.ped)
print(appearance.model, json.encode(appearance.components))
Old code that calls exports["illenium-appearance"] keeps working because the resource provides that name.
How saving works#
Clothes (components and props) can be saved from anywhere, because outfits, clothing items and uniform scripts all save through illenium-appearance:server:saveAppearance. The other parts of a look change only when the server has a reason to allow it:
| What | Changes after |
|---|---|
| Hair, makeup, eye colour, hair fades | A paid barber checkout |
| Face shape and heritage, eye colour | A paid surgeon checkout |
| Tattoos | A paid tattoo checkout, and only the tattoos that were paid for |
| Ped model and everything else | The character creator, or a ped menu grant |
A save from anywhere else keeps those parts from the saved skin. The model can only change to one the character already has a saved skin for.
Each paid checkout returns a one-time token that the shop sends back with its save within two minutes. Up to four unused tokens are kept per player. A clothing item or uniform script that saves in between cannot use them up.
Saves for one character are written one at a time, each in a single database transaction, at most one every half second. Saves that arrive in between are merged into the next one.