Skip to content

✂️ Hairdresser ​

Documentation relating to jo_hairdresser.

1. Installation ​

jo_hairdresser works on all frameworks compatible with jo_libs (the list).

To install jo_hairdresser:

  • Download the library: jo_libs
  • Unzip the folder and drop it into your resources folder
  • Download jo_hairdresser from your account
  • Unzip the folder and drop it into your resources folder
  • Add this ensure to your server.cfg
    • ensure jo_libs
    • ensure jo_hairdresser

Congratulations, the Hairdresser script is ready to use!

WARNING

Make sure you have oxmysql ensured in your server.cfg.

For VORP

To fix clothes and skin, you have to edit two files:

lua
	LoadCharacterSelect(playerPed, value.skin, value.components)
	CachedSkin = value.skin
	canContinue = false
	ApplyFaceOverlays(value.skin)
	canContinue = true
	FaceOverlay("grime", value.skin.grime_visibility, value.skin.grime_tx_id, 0, 0, 0, 1.0, 0, 1, 0, 0, 0, 1, value.skin.grime_opacity)
	Wait(500)

	TriggerServerEvent("jo_libs:server:vorp:applySkinAndClothes", value.charIdentifier, playerPed) 
	Wait(2000) 
	IsPedReadyToRender(playerPed) 

	data.PedHandler = ClonePed(playerPed, false, false, false, false)

2. Usage ​

3. Configuration ​

The configuration files are located in the config folder within the resource. This folder contains two subfolders:

  • _default.lock/ - Contains the default configuration files. Do not edit these files directly as they may be overwritten during updates.
  • custom/ - This is where you place your custom configuration files to override the defaults.

How to customize the configuration ​

  1. Navigate to jo_hairdresser/config/_default.lock/
  2. Copy the file you want to modify (e.g., prices.lua )
  3. Paste it into jo_hairdresser/config/custom/
  4. Edit the copied file in the custom folder

The script automatically loads files from custom/ first, and only uses _default.lock/ as a fallback. This system ensures your customizations are preserved when updating the script.

Default configuration files ​

Loading configuration...

Add-ons ​

The Hairdresser script supports optional add-ons:

4. For developers ​

Actions ​

Actions are one of the two types of Hooks. They provide a way to run a function at a specific point in the execution of scripts. Callback functions for an Action do not return anything back to the calling Action hook. They are the counterpart to Filters.

Below is a complete list of all available actions in the jo_hairdresser script.

Client InitPrompt ​

Triggered after the hairdresser prompt groups are created.

lua
exports.jo_hairdresser:registerAction('InitPrompt', function()
    -- Your code here
end)

Client LoopIn ​

Triggered every frame while the player is inside the hairdresser menu.

lua
-- @param currentPrompt - string: current prompt group ("select" or "buy")
exports.jo_hairdresser:registerAction('LoopIn', function(currentPrompt)
    -- Your code here
end)

Client reloadAll ​

Triggered after hair, beard, hair accessories, teeth, and overlays are reloaded.

lua
exports.jo_hairdresser:registerAction('reloadAll', function()
    -- Your code here
end)

Client switchPrice ​

Triggered when the player switches between payment options.

lua
-- @param priceIndex - int: index of the selected price option
exports.jo_hairdresser:registerAction('switchPrice', function(priceIndex)
    -- Your code here
end)

Events ​

Client Listen menu closing ​

Triggered when the hairdresser menu closes.

lua
AddEventHandler('jo_hairdresser:event:Close', function()
    -- Your code here
end)

Client Listen menu opening ​

Triggered when the hairdresser menu opens.

lua
AddEventHandler('jo_hairdresser:event:Open', function()
    -- Your code here
end)

Client Open the hairdresser ​

Call this event from your own scripts to start the hairdresser interaction.

lua
TriggerEvent('jo_hairdresser:Enter')

Client Reload skin ​

Reload the player skin from the server, then apply hairdresser components.

lua
TriggerEvent('jo_hairdresser:client:reloadSkin')

Filters ​

Filters allow you to modify data or permissions synchronously at specific points in the script. Below is the complete list of jo_hairdresser filters and how to use them.

Server Can buy ​

Control whether the purchase can continue before money is charged.

lua
-- @param canBuy - boolean (default true)
-- @param source - serverID of the player
-- @param data - table: purchase data
-- @param moneyType - any: selected money type/payment context
exports.jo_hairdresser:registerFilter('canBuy', function(canBuy, source, data, moneyType)
	return canBuy
end)

Client Can open menu ​

Control whether the player can open the hairdresser menu.

lua
-- @param canOpen - boolean (default true)
exports.jo_hairdresser:registerFilter('canOpenMenu', function(canOpen)
	return canOpen
end)

Add entries to the native hairdresser menu.

lua
-- @param items - table
exports.jo_hairdresser:registerFilter('mainMenuItems', function(items)
	return items
end)

Client Reload all ​

Control whether hairdresser components can be reloaded.

lua
-- @param canUse - boolean
exports.jo_hairdresser:registerFilter('reloadAll', function(canUse)
	return canUse
end)

Client Root menu items ​

Add high-level entries to the root hairdresser menu.

lua
-- @param items - table
exports.jo_hairdresser:registerFilter('rootMenuItems', function(items)
	return items
end)

Client Update current data before buy ​

Modify the current buy data before it is sent to the server purchase flow.

lua
-- @param currentData - table: current menu item data
exports.jo_hairdresser:registerFilter('updateCurrentDataBeforeBuy', function(currentData)
	return currentData
end)

Client Update lang for NUI ​

Alter the language table before it is sent to the NUI menu.

lua
-- @param lang - table
exports.jo_hairdresser:registerFilter('updateLangForNUI', function(lang)
	return lang
end)

Client Update menu prompt ​

Override which prompt group is displayed while navigating menus.

lua
-- @param promptType - string ("select" or "buy")
-- @param currentData - table: current menu item data
exports.jo_hairdresser:registerFilter('updateMenuPrompt', function(promptType, currentData)
	return promptType
end)

Last updated: