AudioClient

forceUseAudioGameObject

FORCE_USE_AUDIO_GAME_OBJECT0x4F0C413926060B38

The 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.

SignatureJavaScript
forceUseAudioGameObject(vehicle: Vehicle, audioName: string): void
SignatureLua
forceUseAudioGameObject(vehicle: Vehicle, audioName: string)

Usage

JavaScript
forceUseAudioGameObject(vehicle, audioName);
Lua
forceUseAudioGameObject(vehicle, audioName)

Parameters

ParameterTypeJavaScriptLua
vehicleVehiclenumberinteger
audioNamestringstringstring

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

Open in the interactive natives reference