setMicrophonePosition
SET_MICROPHONE_POSITION0xB6AE90EDDE95C762The GTA V native SET_MICROPHONE_POSITION of the AUDIO namespace, as LS:MP client scripts call it: the global function setMicrophonePosition, in JavaScript and in Lua.
setMicrophonePosition(
toggle: boolean,
x1: number,
y1: number,
z1: number,
x2: number,
y2: number,
z2: number,
x3: number,
y3: number,
z3: number
): voidsetMicrophonePosition(
toggle: boolean,
x1: number,
y1: number,
z1: number,
x2: number,
y2: number,
z2: number,
x3: number,
y3: number,
z3: number
)Usage
setMicrophonePosition(toggle, x1, y1, z1, x2, y2, z2, x3, y3, z3);setMicrophonePosition(toggle, x1, y1, z1, x2, y2, z2, x3, y3, z3)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
setMicrophonePosition(toggle, pos1, pos2, pos3);setMicrophonePosition(toggle, pos1, pos2, pos3)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
toggle | BOOL | boolean | boolean |
x1 | float | number | number |
y1 | float | number | number |
z1 | float | number | number |
x2 | float | number | number |
y2 | float | number | number |
z2 | float | number | number |
x3 | float | number | number |
y3 | float | number | number |
z3 | float | number | number |
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 controls where the game plays audio from. By default the microphone is positioned on the player.
When p0 is true the game will play audio from the 3 positions inputted.
It is recommended to set all 3 positions to the same value as mixing different positions doesn't seem to work well.
The scripts mostly use it with only one position such as in fbi3.c:
setMicrophonePosition(true, getEntityCoords(iLocal_3091, true), getEntityCoords(iLocal_3091, true), getEntityCoords(iLocal_3091, true));Reference
- Namespace
- Audio AUDIO
- In the game
void SET_MICROPHONE_POSITION(BOOL toggle, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)- Hash
0xB6AE90EDDE95C762