Hooks (client-side only)
You can use this feature to execute code on some events and modify the script behaviour.
Use RegisterHook
export to add a hook and RemoveHook
or RemoveResourceHooks
exports to remove a hook
openMenu
hook
openMenu
hookThis hook will be triggered when the user opens the sound player UI. The payload sent to the hook function will contain:
type:
'carRadio'
or'boombox'
or'zone'
vehicle:
number
ornil
boombox:
number
ornil
fromType:
string
ornil
By returning false
, the action will be canceled
Example:
createSound
hook
createSound
hookThis hook will be triggered when the user starts playing a sound The payload sent to the hook function will contain:
type:
'carRadio'
or'boombox'
or'zone'
vehicle:
number
ornil
boombox:
number
ornil
fromType:
string
ornil
By returning false
, the action will be canceled
Example:
Last updated