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
This 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'
By returning false, the action will be canceled
Example:
local hookId = exports["evo_sound_player"]:RegisterHook('openMenu', function(payload)
print('Triggered openMenu hook')
print(' - SoundId: ', payload.soundId)
print(' - Type: ', payload.type)
print(' - Vehicle: ', payload.vehicle)
print(' - Boombox: ', payload.boombox)
print(' - Zone: ', payload.zone)
return true
end)
This hook will be triggered when the user closes the sound player UI.
The payload sent to the hook function will contain:
type: 'carRadio' or 'boombox' or 'zone'
By returning false, the action will be canceled
Example:
createSound hook
This 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'
By returning false, the action will be canceled
Example:
Last updated