Skip to content

Commit

Permalink
Update hairdresser.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KadDarem committed Jun 24, 2024
1 parent 37bd548 commit cee33f8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/RedM/hairdresser.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,25 @@ Two client events are fired when you use the script :
1. When you open the menu : `kd_hairdresser:event:Open`
2. When you close the menu : `kd_hairdresser:event:Close`

### Filters

[Filters](/DeveloperResources/filters) are the new way to modify data used by the script. These filters are fired at a specific point in time during the execution of the script. But contrary to events, filters are **synchronous**.

- Syntax:
```lua
-- @param <actionName> - name of the action
-- @param <argumentList> - list of arguments which are passed
exports.kd_haidresser:registerFilter(<actionName>, function(variable)
-- Add your new data here
return variable -- Don't forget to return the value
end)
```

#### <Badge type="client" text="Client" /> canOpenMenu
Fires before sit on the chair. Return false to disable the menu
```lua
-- @param canUse - boolean
exports.kd_haidresser:registerFilter('canOpenMenu', function(canOpen)
return canOpen
end)
```

0 comments on commit cee33f8

Please sign in to comment.