Sex change
This setting decides when a player can switch from Male to Female, or back, in the Peds tab of the clothing store. You choose it in the admin panel, under Settings → Sex change, and it reaches every player at once. While nobody has saved it there, Config.SexChange in shared/config.lua applies.
Free out of the box
As always, out of the box anyone can switch for free in any clothing store. Nothing changes until you choose another mode.
The three modes
| Mode | In Config.SexChange | What players get |
|---|---|---|
| Free | mode = 'free' (out of the box) | Switch for free in any clothing store, as always. |
| Only when creating the character | mode = 'creator' | The sex is chosen in the character creator. After that, stores never change it. |
| By request to the staff | mode = 'request' | The player asks from Peds, and the staff accepts or denies it in the panel. If accepted, they change it once. |
Only the freemode man and woman count. Peds from the ped shop keep their own rules (Config.PedShop), and admins can always change sex, in any mode ("You're an admin: you can change sex without asking.").
Changing the mode doesn't touch the sex each character already has saved. The framework's sex (charinfo.gender, ESX's sex) doesn't change with a sex change either, as before: other scripts' ID cards keep the one from the creation.
The server checks every save: a modified game can't save the other sex. See What the server checks.
Only when creating the character
- In the creator, a line under Male / Female says "Choose carefully: on this server your sex can't be changed after creating the character.", and the finish sheet adds "It stays fixed: on this server it can't be changed later." next to the sex chosen.
- In the clothing store, the other sex's card in Peds says Locked: "On this server your sex is chosen when the character is created: stores don't change it."
- With the creator off, or another resource creating the characters, each character's first save counts. Before that save, a new character's Peds tab and purchase sheet say "Your first save sets your character's sex: after that, stores don't change it."
- A character whose saved look this resource can't read (another menu's) keeps the sex its framework says, also in the creator.
By request to the staff
The other sex's card in Peds says Request change. It opens Ask the staff for the change: an optional reason of up to 140 characters (requests.reason) and Send request.
- One request per character at a time. While it waits, Peds shows Request sent to the staff, how long it has left ("Expires in … if nobody answers") and Cancel request.
- Nobody answers: the request expires after
hourshours (24 out of the box; in the panel, 12 h, 24 h or another number from 1 to 72), and the player is told. Changing the hours doesn't move requests already waiting. - Accepted: the player can change it once, in the Peds tab of a clothing store. The permission is used when they save, and comes back if the payment or the save fails. An accepted permission doesn't expire, and counts only in this mode.
- Denied: the player waits
requests.cooldownminutes (30) before asking again ("Wait N min"). A request that expired or that they canceled can be asked again at once. - A player who is offline when their request is answered finds out the next time they open a clothing store.
- A new character, before its first save, can still pick either sex. Peds and the purchase sheet say "Your first save sets your character's sex: after that, changing it takes a request to the staff."
The staff
The admins answer the requests, and so does Config.SexChange.requests.staff:
staff = { aces = { 'zaiders_appearance.requests' }, qb = {}, esx = {}, jobs = {}, onDuty = false },For example, your moderators, in server.cfg:
add_ace group.mod zaiders_appearance.requests allowIt also takes qb-core permissions, ESX groups or a job from a grade, for example jobs = { police = 3 } (with onDuty = true, only on duty).
The staff online get a notice with each new request. They answer in the panel, in Requests (/zappearance requests); staff who aren't admins see only that section.
- Each row shows the character and whether they're in game or offline, from → to, the reason (or No reason) and when it expires.
- Accept lets them change it once. Deny asks first for an optional reason that the player reads.
- Nobody answers their own request, nor one from another of their characters.
- History lists first every accepted permission not used yet, with Withdraw permission (press it twice), then the answered requests. It keeps them
requests.historydays (30), but never deletes a denial the player hasn't read yet, nor one they still have to wait for. - With height requests on too, the section counts both, with a Sex change | Height switch at the top.
- Every step goes to the server console.
The player is told when their request is accepted, denied or expires, and when the staff withdraws their permission.
Choosing the mode
The panel's Settings is for admins only: options for the whole server. Its Sex change card has the three modes and, for requests, how long one waits: 12 h, 24 h or Other (1 to 72 hours).
- Save applies it to everyone at once; Discard drops your changes. Until someone saves, Settings says "The config's values apply now (shared/config.lua): nobody has saved these settings yet."; afterwards, who saved and when.
- What you save goes to
saved/settings.jsonand wins overConfig.SexChangefrom then on. - Leaving By request to the staff closes the requests still waiting and the accepted permissions not used yet. When there are any, Settings says how many before you save and asks you to press Save twice (Press Save again); with none, one Save is enough. The players aren't told.
- Changing
modeinconfig.luainstead (while the panel has never saved Settings) closes nothing: requests and permissions stay as they were, neither counting nor shown, and come back if'request'comes back.
ESX with esx_skin running
esx_skin's own save event stores whatever a player's game sends, a sex change too: that's how esx_skin works, and esx_multicharacter needs it running. With Only when creating the character or By request to the staff, stop esx_skin when you can (ESX without a multicharacter), or protect that event in esx_skin.
This menu's own answer to esx_skin:save (only with Config.Compat.esxSkinSave = true) checks the mode, where an accepted permission doesn't count, and only takes skinchanger's sex 0 or 1.
The data
One table, zaiders_sex_requests (the requests and the permissions). It's in Appearancez.sql, and the resource also creates it by itself with the first request, so updating needs nothing.
