Cut Players Hair
Installation
Installation
1. Drop the resource
Extract the package into your resources folder. The final path should look like:
server-data/resources/[suty]/suty-shave/
The folder must be named exactly suty-shave. A renamed copy prints FATAL: resource must be named "suty-shave" and stops. Check that fxmanifest.lua sits directly inside the folder (no suty-shave/suty-shave/).
The animations, the clipper prop and the trimmer sound ship inside the resource.
2. Start order in server.cfg
Ready-made examples live in install/server/. Merge only the one for your framework, without duplicating resources you already start. suty-shave goes after ox_lib, the inventory and the target.
setr inventory:framework "qbx"
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure ox_target
ensure suty-shave
ensure oxmysql
ensure ox_lib
ensure qb-core
# use ONE of the next two lines
ensure qb-inventory
# ensure ox_inventory
# use ONE of the next two lines
ensure qb-target
# ensure ox_target
ensure suty-shave
With ox_inventory on QB-Core, set inventory:framework for your QB bridge first.
setr inventory:framework "esx"
ensure oxmysql
ensure ox_lib
ensure es_extended
# remove the next line if you use the ESX inventory instead of ox_inventory
ensure ox_inventory
ensure ox_target
ensure suty-shave
OneSync must be enabled: the server checks that both players are really next to each other.
3. The clipper item
| Item | Label | What it does | ox_inventory export |
|---|---|---|---|
hairclipper |
Maquinita de recortar | Use it to take the clipper out (or put it away), then aim at a player and pick Recortar | suty-shave.useClipper |
Register it only in your inventory, inside the existing item table. Don't replace the file and don't duplicate the entry.
Add to ox_inventory/data/items.lua (QBX, QB-Core or ESX):
['hairclipper'] = {
label = 'Maquinita de recortar',
weight = 300,
stack = false,
close = true,
consume = 0,
description = 'Maquinita para recortar. Úsala para sacarla a la mano y apunta a otro jugador para raparle el pelo.',
client = { export = 'suty-shave.useClipper', image = 'hairclipper.png' }
},
Keep consume = 0: the clipper is never used up.
Add to QBCore.Shared.Items (or QBShared.Items) in qb-core/shared/items.lua:
hairclipper = { name = 'hairclipper', label = 'Maquinita de recortar', weight = 300, type = 'item', image = 'hairclipper.png', unique = true, useable = true, shouldClose = true, description = 'Maquinita para recortar. Úsala para sacarla a la mano y apunta a otro jugador para raparle el pelo.' },
Keep unique and useable. The resource registers the usable item by itself, so don't add another CreateUseableItem. If you run ox_inventory on QB-Core, use the ox_inventory tab, and add this line too only if your shops or admin menu read QBCore.Shared.Items.
If you run ESX with ox_inventory, use the ox_inventory tab instead.
Import install/esx/items.sql into your database:
INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('hairclipper', 'Maquinita de recortar', 1, 0, 1);
The resource registers the usable item with ESX by itself.
Item image
The image ships in install/ox_inventory/hairclipper.png. Copy it to your inventory's image folder:
| Inventory | Folder |
|---|---|
| ox_inventory | ox_inventory/web/images/ |
| qb-inventory | qb-inventory/html/images/ |
4. Restart
Restart ox_inventory (or the whole server) after adding the item. Restarting only suty-shave doesn't reload the inventory's items. On a healthy boot the console prints the SUTY SHAVE banner with the version and Loaded.
5. Quick test
- Give yourself a
hairclipperand stand next to another player. - Use the clipper from the inventory: it goes to your right hand (use it again to put it away).
- Aim at the other player with the target eye and pick Recortar.
- If
Config.ShaveConditions.consent = true, they get Solicitud de Recorte and have 15 seconds to press Aceptar or Negar. - Both players play the animation with the trimmer sound. The shaved player ends up bald for 20 minutes.
6. (Optional) Admin-granted players only
Config.RequirePermission = true
Then an admin grants access per player:
/recorteperm 5 on # grant player ID 5
/recorteperm 5 off # revoke
Grants are saved by license and survive restarts while Config.PersistGrants = true (default).
