forceUseAudioGameObject
FORCE_USE_AUDIO_GAME_OBJECT0x4F0C413926060B38The GTA V native FORCE_USE_AUDIO_GAME_OBJECT of the AUDIO namespace, as LS:MP client scripts call it: the global function forceUseAudioGameObject, in JavaScript and in Lua.
forceUseAudioGameObject(vehicle: Vehicle, audioName: string): voidforceUseAudioGameObject(vehicle: Vehicle, audioName: string)Usage
JavaScript
forceUseAudioGameObject(vehicle, audioName);Lua
forceUseAudioGameObject(vehicle, audioName)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
vehicle | Vehicle | number | integer |
audioName | string | string | string |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
This native sets the audio of the specified vehicle to the audioName (p1).
Use the audioNameHash found in vehicles.meta
Example:
forceUseAudioGameObject(veh, "ADDER");The selected vehicle will now have the audio of the Adder.
Reference
- Namespace
- Audio AUDIO
- In the game
void FORCE_USE_AUDIO_GAME_OBJECT(Vehicle vehicle, const char* audioName)- Hash
0x4F0C413926060B38- Formerly
_SET_VEHICLE_AUDIO_FORCE_VEHICLE_ENGINE_AUDIO