grantSurgery
Opens the surgery menu on a specific player, with no surgeon and every catalogue, cooldown, and gender rule waived.
๐ก Syntax
local ok, err = exports['kartik-clothing']:grantSurgery(target, opts)๐ฅ Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
target | number | No | Server ID of the player to open the menu on. |
opts | table | Yes | Session options, see below. |
opts
| Key | Type | Default | Description |
|---|---|---|---|
price | number | 0 | Bank charge taken from the player on confirm. 0 is free. |
tabs | string[] | Config.PedSurgery.Tabs | Tabs this visit may change: ped, heritage, face, hair, beard, makeup, skin, clothing, tattoos. |
label | string | Surgery | Menu title shown to the player. |
byCid | string | admin | Citizen ID recorded as the surgeon in kc_ped_surgeries. |
๐ค Returns
| Type | Description |
|---|---|
boolean | true if the menu was opened. |
string? | Error code when it was not: no_patient, patient_busy, or no_character. |
๐ Example
-- Free full character re-edit, e.g. from a support ticket resource
local ok, err = exports['kartik-clothing']:grantSurgery(playerId, {
price = 0,
label = 'Character fix',
})
if not ok then
print(('could not open surgery: %s'):format(err))
end-- A paid clinic that only reshapes faces
exports['kartik-clothing']:grantSurgery(playerId, {
price = 7500,
tabs = { 'heritage', 'face' },
label = 'Cosmetic Clinic',
})[!NOTE] This ignores
Config.PedSurgery.Enabled, so it works on servers that run no surgery roleplay.
[!WARNING] The caller is not checked. A server export is already inside the trust boundary, the resource calling it decides who is allowed to.