Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(natives/audio): Updated documentation for unnamed audio natives and added examples #890

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions AUDIO/AudioIsMusicPlaying.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
ns: AUDIO
aliases: ["0x3D120012440E6683", "AUDIO_IS_SCRIPTED_MUSIC_PLAYING"]
---
## AUDIO_​IS_​MUSIC_​PLAYING

```c
// 0x845FFC3A4FEEFA3E 0x86E995D1
cs_type(Any) BOOL AUDIO_​IS_​MUSIC_​PLAYING();
```

## Return value
12 changes: 0 additions & 12 deletions AUDIO/AudioIsScriptedMusicPlaying.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
ns: AUDIO
---
## _0xF8AD2EED7C47E8FE
## _BLOCK_​ALL_​SPEECH_​FROM_​PED

```c
// 0xF8AD2EED7C47E8FE
void _0xF8AD2EED7C47E8FE(Ped ped, BOOL p1, BOOL p2);
void _BLOCK_​ALL_​SPEECH_​FROM_​PED(Ped ped, BOOL p1, BOOL p2);
```

BL*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
ns: AUDIO
---
## _0xA8A7D434AFB4B97B
## _BLOCK_​SPEECH_​CONTEXT_​GROUP

```c
// 0xA8A7D434AFB4B97B
void _0xA8A7D434AFB4B97B(char* p0, int p1);
void _BLOCK_​SPEECH_​CONTEXT_​GROUP(char* p0, int p1);
```

```
Expand Down
21 changes: 0 additions & 21 deletions AUDIO/CanPedSpeak.md

This file was deleted.

16 changes: 16 additions & 0 deletions AUDIO/CanVehicleReceiveCbRadio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
ns: AUDIO
aliases: ["_IS_VEHICLE_RADIO_LOUD"]
---
## CAN_​VEHICLE_​RECEIVE_​CB_​RADIO

```c
// 0x032A116663A4D5AC 0xCBA99F4A
BOOL CAN_​VEHICLE_​RECEIVE_​CB_​RADIO(Vehicle vehicle);
```

## Parameters
* **vehicle**: Vehicle for which you want to check if it can receive CB radio.

## Return value
A boolean value. If the vehicle can receive CB radio, it returns true. Otherwise, it returns false.
12 changes: 12 additions & 0 deletions AUDIO/CancelAllPoliceReports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
ns: AUDIO
aliases: ["0xB4F90FAF7670B16F","_DISABLE_POLICE_REPORTS", "_CANCEL_CURRENT_POLICE_REPORT"]
---
## CANCEL_​ALL_​POLICE_​REPORTS

```c
// 0xB4F90FAF7670B16F
void CANCEL_​ALL_​POLICE_​REPORTS();
```


12 changes: 0 additions & 12 deletions AUDIO/CancelCurrentPoliceReport.md

This file was deleted.

19 changes: 19 additions & 0 deletions AUDIO/DoesContextExistForThisPed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ns: AUDIO
aliases: ["0x49B99BF3FDA89A7A", "_CAN_PED_SPEAK"]
---
## DOES_​CONTEXT_​EXIST_​FOR_​THIS_​PED

```c
// 0x49B99BF3FDA89A7A 0x8BD5F11E
BOOL DOES_​CONTEXT_​EXIST_​FOR_​THIS_​PED(Ped ped, char* speechName, BOOL p2);
```

Checks if the ped can play the speech or has the speech file

## Parameters
* **ped**: Ped for which you want to check the context.
* **speechName**: The name of the speech to check.
* **p2**: A boolean value representing additional context information. It is usually set to 0.

## Return value
11 changes: 11 additions & 0 deletions AUDIO/EnableStuntJumpAudio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
ns: AUDIO
---
## ENABLE_​STUNT_​JUMP_​AUDIO

```c
// 0xB81CF134AEB56FFB
void ENABLE_​STUNT_​JUMP_​AUDIO();
```


15 changes: 15 additions & 0 deletions AUDIO/EnableVehicleFanbeltDamage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
ns: AUDIO
---
## ENABLE_​VEHICLE_​FANBELT_​DAMAGE

```c
// 0x1C073274E065C6D2 0x9365E042
void ENABLE_​VEHICLE_​FANBELT_​DAMAGE(Vehicle vehicle, BOOL toggle);
```


## Parameters
* **vehicle**:
* **toggle**:

23 changes: 23 additions & 0 deletions AUDIO/ForceMusicTrackList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
ns: AUDIO
aliases: ["0x4E0AF9114608257C", "_FORCE_RADIO_TRACK_LIST_POSITION"]
---
## FORCE_​MUSIC_​TRACK_​LIST

```c
// 0x4E0AF9114608257C
void FORCE_​MUSIC_​TRACK_​LIST(char* radioStation, char* trackListName, int milliseconds);
```

```
Changes start time of a tracklist (milliseconds)
R* uses a random int: MISC::GET_RANDOM_INT_IN_RANGE(0, 13) * 60000)

NativeDB Introduced: v2372
```


## Parameters
* **radioStation**: The name of the radio station
* **trackListName**: The name of the tracklist.
* **milliseconds**: The desired start time of the tracklist in milliseconds.
4 changes: 2 additions & 2 deletions AUDIO/N_0x062d5ead4da2fa6a.md → AUDIO/ForcePedPanicWalla.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
ns: AUDIO
---
## _0x062D5EAD4DA2FA6A
## FORCE_​PED_​PANIC_​WALLA

```c
// 0x062D5EAD4DA2FA6A 0xD87AF337
void _0x062D5EAD4DA2FA6A();
void FORCE_​PED_​PANIC_​WALLA();
```

```
Expand Down
19 changes: 0 additions & 19 deletions AUDIO/ForceRadioTrackListPosition.md

This file was deleted.

33 changes: 33 additions & 0 deletions AUDIO/ForceUseAudioGameObject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
ns: AUDIO
aliases: ["0x4F0C413926060B38","_SET_VEHICLE_AUDIO", "_FORCE_VEHICLE_ENGINE_AUDIO"]
---
## FORCE_​USE_​AUDIO_​GAME_​OBJECT

```c
// 0x4F0C413926060B38 0x33B0B007
void FORCE_​USE_​AUDIO_​GAME_​OBJECT(Vehicle vehicle, char* audioName);
```

This native sets the audio of the specified vehicle to the audioName (p1).

## Parameters
* **vehicle**: Vehicle for which you want to set the audio.
* **audioName**: The name of the audio to be used for the vehicle. This should be the audioNameHash found in vehicles.meta.


## Examples
```lua
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
ForceUseAudioGameObject(vehicle, "ADDER") -- going to add the audio of the Adder to the specified vehicle
```
```js
const vehicle = GetVehiclePedIsIn(PlayerPedId(), false);
ForceUseAudioGameObject(vehicle, "ADDER"); // going to add the audio of the Adder to the specified vehicle
```
```cs
using static CitizenFX.Core.Native.API;
// ...
var vehicle = GetVehiclePedIsIn(PlayerPedId(), false);
ForceUseAudioGameObject(vehicle, "ADDER"); // going to add the audio of the Adder to the specified vehicle
```
24 changes: 0 additions & 24 deletions AUDIO/ForceVehicleEngineAudio.md

This file was deleted.

6 changes: 3 additions & 3 deletions AUDIO/GetAmbientVoiceNameHash.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
ns: AUDIO
aliases: ["0x5E203DA2BA15D436"]
aliases: ["0x5E203DA2BA15D436", "_GET_AMBIENT_VOICE_NAME_HASH"]
---
## _GET_AMBIENT_VOICE_NAME_HASH
## GET_​AMBIENT_​VOICE_​NAME_​HASH

```c
// 0x5E203DA2BA15D436
cs_type(Any) Hash _GET_AMBIENT_VOICE_NAME_HASH(Ped ped);
cs_type(Any) Hash GET_​AMBIENT_​VOICE_​NAME_​HASH(Ped ped);
```

## Parameters
Expand Down
19 changes: 0 additions & 19 deletions AUDIO/GetCurrentRadioTrackName.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
ns: AUDIO
aliases: ["0x3E65CDE5215832C1","_GET_CURRENT_RADIO_STATION_HASH"]
aliases: ["0x3E65CDE5215832C1","_GET_CURRENT_RADIO_STATION_HASH", "_GET_CURRENT_RADIO_TRACK_PLAYBACK_TIME"]
---
## _GET_CURRENT_RADIO_TRACK_PLAYBACK_TIME
## GET_​CURRENT_​TRACK_​PLAY_​TIME

```c
// 0x3E65CDE5215832C1
int _GET_CURRENT_RADIO_TRACK_PLAYBACK_TIME(char* radioStationName);
int GET_​CURRENT_​TRACK_​PLAY_​TIME(char* radioStationName);
```

```
Expand Down
20 changes: 20 additions & 0 deletions AUDIO/GetCurrentTrackSoundName.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
ns: AUDIO
aliases: ["0x34D66BC058019CE0", "_GET_CURRENT_RADIO_TRACK_NAME"]
---
## GET_​CURRENT_​TRACK_​SOUND_​NAME

```c
// 0x34D66BC058019CE0
Hash GET_​CURRENT_​TRACK_​SOUND_​NAME(char* radioStationName);
```

```
NativeDB Introduced: v1493
```

## Parameters
* **radioStationName**: The name of the radio station for which you want to get the current track sound name.

## Return value
Return the hash of the radio stations current track.
12 changes: 12 additions & 0 deletions AUDIO/GetMusicVolSlider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
ns: AUDIO
---
## GET_​MUSIC_​VOL_​SLIDER

```c
// 0x3A48AB4445D499BE 0x93A44A1F
cs_type(Any) int GET_​MUSIC_​VOL_​SLIDER();
```


## Return value
18 changes: 18 additions & 0 deletions AUDIO/GetNextAudibleBeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
ns: AUDIO
---
## GET_​NEXT_​AUDIBLE_​BEAT

```c
// 0xC64A06D939F826F5
BOOL GET_​NEXT_​AUDIBLE_​BEAT(float* out1, cs_type(AnyPtr) float* out2, int* out3);
```

```
NativeDB Introduced: v1493
```

## Parameters
* **out1**:
* **out2**:
* **out3**:
Loading
Loading