forked from Simnation/Main
Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
This commit is contained in:
commit
f925fba0b1
11 changed files with 10695 additions and 0 deletions
723
resources/[voice]/yaca-voice/README.md
Normal file
723
resources/[voice]/yaca-voice/README.md
Normal file
|
@ -0,0 +1,723 @@
|
||||||
|
# [yaca.systems](https://yaca.systems/) for [FiveM](https://fivem.net/) & [RedM](https://redm.net/)
|
||||||
|
|
||||||
|
This is a example implementation for [FiveM](https://fivem.net/) & [RedM](https://redm.net/).
|
||||||
|
Feel free to report bugs via issues or contribute via pull requests.
|
||||||
|
|
||||||
|
Join our [Discord](http://discord.yaca.systems/) to get help or make suggestions and start
|
||||||
|
using [yaca.systems](https://yaca.systems/) today!
|
||||||
|
|
||||||
|
# Setup Steps
|
||||||
|
|
||||||
|
Before you start, make sure you have OneSync enabled and your server artifacts are up to date.
|
||||||
|
|
||||||
|
1. Download and install the latest [release](https://github.com/yaca-systems/fivem-yaca-typescript/releases) of this
|
||||||
|
resource.
|
||||||
|
2. Add `start yaca-voice` into your `server.cfg`.
|
||||||
|
3. Open `config/server.json5` and adjust the variables to your needs.
|
||||||
|
4. Open `config/shared.json5` and adjust the variables to your needs.
|
||||||
|
|
||||||
|
# Exports
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary style="font-size: x-large">Client</summary>
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
#### `getVoiceRange(): int`
|
||||||
|
|
||||||
|
Get the current voice range of the player as `int`.
|
||||||
|
|
||||||
|
#### `getVoiceRanges(): int[]`
|
||||||
|
|
||||||
|
Get all voice ranges as `int[]`.
|
||||||
|
|
||||||
|
#### `changeVoiceRange(increase: boolean): void`
|
||||||
|
|
||||||
|
Change the voice range of the player to the next range.
|
||||||
|
|
||||||
|
#### `setVoiceRange(range: number): void`
|
||||||
|
|
||||||
|
Set the voice range of the player.
|
||||||
|
|
||||||
|
#### `setVoiceRangeChangeAllowedState(state: boolean): void`
|
||||||
|
|
||||||
|
Enable or disable the possibility to change the voice range.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|------------------------------------------------|
|
||||||
|
| state | `boolean` | `true` to allow the voice range change, `false` to disable |
|
||||||
|
|
||||||
|
#### `getVoiceRangeChangeAllowedState(): boolean`
|
||||||
|
|
||||||
|
Get the voice range change allowed state of the player as `boolean`.
|
||||||
|
|
||||||
|
#### `setMaxVoiceRange(range: number): void`
|
||||||
|
|
||||||
|
Set the maximum allowed voice range of the player in meters to limit the voice range temporarily.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|------------------------------------------------|
|
||||||
|
| range | `number` | `-1` to disable the limit, or a number in meters to set the limit |
|
||||||
|
|
||||||
|
#### `getMaxVoiceRange(): number`
|
||||||
|
|
||||||
|
Get the maximum allowed voice range of the player in meters.
|
||||||
|
|
||||||
|
#### `getMicrophoneMuteState(): boolean`
|
||||||
|
|
||||||
|
Get the microphone mute state of the player as `boolean`.
|
||||||
|
|
||||||
|
#### `getMicrophoneDisabledState(): boolean`
|
||||||
|
|
||||||
|
Get the microphone disabled state of the player as `boolean`.
|
||||||
|
|
||||||
|
#### `getSoundMuteState(): boolean`
|
||||||
|
|
||||||
|
Get the sound mute state of the player as `boolean`.
|
||||||
|
|
||||||
|
#### `getSoundDisabledState(): boolean`
|
||||||
|
|
||||||
|
Get the sound disabled state of the player as `boolean`.
|
||||||
|
|
||||||
|
#### `getPluginState(): string`
|
||||||
|
|
||||||
|
Get the current plugin state as `string`.
|
||||||
|
|
||||||
|
The state can be one of the following:
|
||||||
|
|
||||||
|
- `"NOT_CONNECTED"`: The plugin is not connected
|
||||||
|
- `"CONNECTED`: The plugin is connected
|
||||||
|
- `"OUTDATED_VERSION"`: The plugin is not the version set in the dashboard
|
||||||
|
- `"WRONG_TS_SERVER"`: The user is connected to the wrong Teamspeak server
|
||||||
|
- `"IN_INGAME_CHANNEL"`: The user is in the ingame channel
|
||||||
|
- `"IN_EXCLUDED_CHANNEL"`: The user is in an excluded channel
|
||||||
|
|
||||||
|
#### `getGlobalErrorLevel(): number`
|
||||||
|
|
||||||
|
Get the global error level as `number`.
|
||||||
|
|
||||||
|
#### `setSpectatingPlayer(playerId: number | false)`
|
||||||
|
|
||||||
|
Set the player to spectate.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-------------------|-------------------|
|
||||||
|
| playerId | `number \| false` | the player to set |
|
||||||
|
|
||||||
|
#### `getSpectatingPlayer(): number`
|
||||||
|
|
||||||
|
Get the player the user is spectating as `number`.
|
||||||
|
|
||||||
|
#### `setVoiceRangeMarkerColor(red: number, green: number, blue: number, alpha: number)`
|
||||||
|
|
||||||
|
Set the voice range marker color.
|
||||||
|
|
||||||
|
#### `getVoiceRangeMarkerColor(): [number, number, number, number]`
|
||||||
|
|
||||||
|
Get the voice range marker color as `[red, green, blue, alpha]`.
|
||||||
|
|
||||||
|
#### `resetVoiceRangeMarkerColor()`
|
||||||
|
|
||||||
|
Reset the voice range marker color to the default color defined in the config.
|
||||||
|
|
||||||
|
### Radio
|
||||||
|
|
||||||
|
#### `enableRadio(state: boolean)`
|
||||||
|
|
||||||
|
Enables or disables the radio system.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|------------------------------------------------|
|
||||||
|
| state | `boolean` | `true` to enable the radio, `false` to disable |
|
||||||
|
|
||||||
|
#### `isRadioEnabled(): boolean`
|
||||||
|
|
||||||
|
Returns whether the radio system is enabled as `boolean`.
|
||||||
|
|
||||||
|
#### `changeRadioFrequency(frequency: string)`
|
||||||
|
|
||||||
|
Changes the radio frequency of the active channel.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|--------------------------------------------|
|
||||||
|
| frequency | `string` | The frequency to set the active channel to |
|
||||||
|
|
||||||
|
#### `changeRadioFrequencyRaw(channel: number, frequency: string)`
|
||||||
|
|
||||||
|
Changes the radio frequency.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|---------------------------------------------------------------------------------------|
|
||||||
|
| channel? | `number` | the channel number. Defaults to the current active channel when no channel is passed. |
|
||||||
|
| frequency | `string` | the frequency to set the channel to |
|
||||||
|
|
||||||
|
#### `getRadioFrequency(channel: number): string`
|
||||||
|
|
||||||
|
Returns the frequency of a radio channel as `string`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|---------------------------------------------------------------------------------------|
|
||||||
|
| channel? | `number` | the channel number. Defaults to the current active channel when no channel is passed. |
|
||||||
|
|
||||||
|
#### `muteRadioChannel(state?: boolean)`
|
||||||
|
|
||||||
|
Mutes the current active radio channel.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|-----------------------------------------------------------------------------|
|
||||||
|
| state? | `boolean` | `true` to mute the channel, `false` to unmute. Defaults to switch if not defined |
|
||||||
|
|
||||||
|
#### `muteRadioChannelRaw(channel: number, state?: boolean)`
|
||||||
|
|
||||||
|
Mutes a radio channel.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|----------------------------------------------------------------------------------------|
|
||||||
|
| channel? | `number` | the channel to mute. Defaults to the current active channel when no channel is passed. |
|
||||||
|
| state? | `boolean` | `true` to mute the channel, `false` to unmute. Defaults to switch if not defined |
|
||||||
|
|
||||||
|
#### `isRadioChannelMuted(channel: number): boolean`
|
||||||
|
|
||||||
|
Returns whether a radio channel is muted as `boolean`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|--------------------|
|
||||||
|
| channel | `number` | the channel number |
|
||||||
|
|
||||||
|
#### `setActiveRadioChannel(channel: number): bool`
|
||||||
|
|
||||||
|
Changes the active radio channel. Returns whether the operation was successful as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-----------------------|
|
||||||
|
| channel | `number` | the new radio channel |
|
||||||
|
|
||||||
|
#### `getActiveRadioChannel(): number`
|
||||||
|
|
||||||
|
Returns the active radio channel as `number`.
|
||||||
|
|
||||||
|
#### `setSecondaryRadioChannel(channel: number): bool`
|
||||||
|
|
||||||
|
Changes the secondary radio channel. Returns whether the operation was successful as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-----------------------|
|
||||||
|
| channel | `number` | the new radio channel |
|
||||||
|
|
||||||
|
#### `getSecondaryRadioChannel(): number`
|
||||||
|
|
||||||
|
Returns the secondary radio channel as `number`.
|
||||||
|
|
||||||
|
#### `changeRadioChannelVolume(higher: boolean): bool`
|
||||||
|
|
||||||
|
Changes the volume of the active radio channel. Returns whether the operation was successful as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------------------|
|
||||||
|
| higher | `boolean` | whether to increase the volume |
|
||||||
|
|
||||||
|
#### `changeRadioChannelVolumeRaw(channel: number, volume: number): bool`
|
||||||
|
|
||||||
|
Changes the volume of a radio channel. Returns whether the operation was successful as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|--------------------|
|
||||||
|
| channel | `number` | the channel number |
|
||||||
|
| volume | `number` | the volume to set |
|
||||||
|
|
||||||
|
#### `getRadioChannelVolume(channel: number): number`
|
||||||
|
|
||||||
|
Returns the volume of a radio channel as `number`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|--------------------|
|
||||||
|
| channel | `number` | the channel number |
|
||||||
|
|
||||||
|
#### `changeRadioChannelStereo(): bool`
|
||||||
|
|
||||||
|
Changes the stereo mode of the active radio channel. Returns whether the operation was successful as `bool`.
|
||||||
|
|
||||||
|
#### `changeRadioChannelStereoRaw(channel: number, stereo: string): bool`
|
||||||
|
|
||||||
|
Changes the stereo mode of a radio channel. Returns whether the operation was successful as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|---------------------------------------------------------------|
|
||||||
|
| channel | `number` | the channel number |
|
||||||
|
| stereo | `string` | the stereo mode (`"MONO_LEFT"`, `"MONO_RIGHT"` or `"STEREO"`) |
|
||||||
|
|
||||||
|
#### `getRadioChannelStereo(channel: number): string`
|
||||||
|
|
||||||
|
Returns the stereo mode of a radio channel as `string`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|--------------------|
|
||||||
|
| channel | `number` | the channel number |
|
||||||
|
|
||||||
|
#### `radioTalkingStart(state: boolean, channel: number)`
|
||||||
|
|
||||||
|
Starts or stops talking on the radio.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|------------------------------------------|
|
||||||
|
| state | `boolean` | `true` to start talking, `false` to stop |
|
||||||
|
| channel | `number` | the channel to talk on |
|
||||||
|
|
||||||
|
#### `setRadioMode(mode: string)`
|
||||||
|
|
||||||
|
Sets the radio mode.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------------------------------------------------------------------------|
|
||||||
|
| mode | `string` | the radio mode to set. Can be either `None`, `Direct` or `Tower` |
|
||||||
|
|
||||||
|
#### `getRadioMode(): string`
|
||||||
|
|
||||||
|
Returns the radio mode as `string`.
|
||||||
|
|
||||||
|
### Phone
|
||||||
|
|
||||||
|
#### `isInCall(): boolean`
|
||||||
|
|
||||||
|
Returns whether the player is in a phone call as a `boolean`.
|
||||||
|
|
||||||
|
### Megaphone
|
||||||
|
|
||||||
|
#### `getCanUseMegaphone(): boolean`
|
||||||
|
|
||||||
|
Returns whether the player can use the megaphone as a `boolean`.
|
||||||
|
|
||||||
|
#### `setCanUseMegaphone(state: boolean)`
|
||||||
|
|
||||||
|
Sets whether the player can use the megaphone.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|---------------------------------------------------------|
|
||||||
|
| state | `boolean` | `true` to allow using of megaphone, `false` to disallow |
|
||||||
|
|
||||||
|
### `useMegaphone(state: boolean)`
|
||||||
|
|
||||||
|
Starts or stops using the megaphone.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|----------------------------------------|
|
||||||
|
| state | `boolean` | `true` to start using, `false` to stop |
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary style="font-size: x-large">Server</summary>
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
#### `connectToVoice(source: number)`
|
||||||
|
Connects a player to the voice system.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
|
||||||
|
#### `getPlayerAliveStatus(source: number): bool`
|
||||||
|
|
||||||
|
Get the alive status of a player as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
|
||||||
|
#### `setPlayerAliveStatus(source: number, state: bool)`
|
||||||
|
|
||||||
|
Set the alive status of a player.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|---------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| state | `boolean` | the new alive state |
|
||||||
|
|
||||||
|
#### `getPlayerVoiceRange(source: number): number`
|
||||||
|
|
||||||
|
Get the voice range of a player as `number`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
|
||||||
|
#### `setPlayerVoiceRange(source: number, range: number)`
|
||||||
|
|
||||||
|
Set the voice range of a player.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|---------------------------------------------------------------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| range | `number` | The new voice range. Defaults to the default voice range if not provided. |
|
||||||
|
|
||||||
|
### Radio
|
||||||
|
|
||||||
|
#### `getPlayersInRadioFrequency(frequency: string): int[]`
|
||||||
|
|
||||||
|
Returns all players in a radio frequency as `int[]`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|----------------------|
|
||||||
|
| frequency | `string` | the frequency to get |
|
||||||
|
|
||||||
|
#### `setPlayerRadioChannel(source: number, channel: number, frequency: string)`
|
||||||
|
|
||||||
|
Sets the radio channel of a player.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|----------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| channel | `number` | the channel to set |
|
||||||
|
| frequency | `string` | the frequency to set |
|
||||||
|
|
||||||
|
#### `getPlayerHasLongRange(source: number): bool`
|
||||||
|
|
||||||
|
Returns whether a player has long range enabled as `bool`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
|
||||||
|
#### `setPlayerHasLongRange(source: number, state: bool)`
|
||||||
|
|
||||||
|
Sets the long range state of a player.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|----------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| state | `boolean` | the long range state |
|
||||||
|
|
||||||
|
### Phone
|
||||||
|
|
||||||
|
#### `callPlayer(source: number, target: number, state: bool)`
|
||||||
|
|
||||||
|
Creates a phone call between two players.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| target | `number` | the target player source |
|
||||||
|
| state | `boolean` | the state of the call |
|
||||||
|
|
||||||
|
#### `callPlayerOldEffect(source: number, target: number, state: bool)`
|
||||||
|
|
||||||
|
Creates a phone call between two players with the old effect.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| target | `number` | the target player source |
|
||||||
|
| state | `boolean` | the state of the call |
|
||||||
|
|
||||||
|
#### `muteOnPhone(source: number, state: bool)`
|
||||||
|
|
||||||
|
Mutes the player when using the phone.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|-------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| state | `boolean` | the mute state |
|
||||||
|
|
||||||
|
#### `enablePhoneSpeaker(source: number, state: bool)`
|
||||||
|
|
||||||
|
Enable or disable the phone speaker for a player.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|-------------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
| state | `boolean` | the phone speaker state |
|
||||||
|
|
||||||
|
#### `isPlayerInCall(source: number): [bool, number[]]`
|
||||||
|
|
||||||
|
Returns whether a player is in a phone call as `[bool, number[]]`.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-------------------|
|
||||||
|
| source | `number` | the player source |
|
||||||
|
|
||||||
|
#### `setGlobalErrorLevel(level: number)`
|
||||||
|
|
||||||
|
Sets the global error level.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-----------------|
|
||||||
|
| level | `number` | the error level |
|
||||||
|
|
||||||
|
#### `getGlobalErrorLevel(): number`
|
||||||
|
|
||||||
|
Returns the global error level as `number`.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
# Events
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary style="font-size: x-large">Client</summary>
|
||||||
|
|
||||||
|
### yaca:external:pluginInitialized
|
||||||
|
|
||||||
|
The event is triggered when the plugin is initialized.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-------|----------------------------------------------|
|
||||||
|
| clientId | `int` | the client id of the local user in teamspeak |
|
||||||
|
|
||||||
|
### yaca:external:pluginStateChanged
|
||||||
|
|
||||||
|
The event is triggered when the plugin state changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|----------------------------------------------|
|
||||||
|
| state | `string` | the current plugin state, as explained below |
|
||||||
|
|
||||||
|
The state can be one of the following:
|
||||||
|
|
||||||
|
- `"NOT_CONNECTED"`: The plugin is not connected
|
||||||
|
- `"CONNECTED`: The plugin is connected
|
||||||
|
- `"OUTDATED_VERSION"`: The plugin is not the version set in the dashboard
|
||||||
|
- `"WRONG_TS_SERVER"`: The user is connected to the wrong Teamspeak server
|
||||||
|
- `"IN_INGAME_CHANNEL"`: The user is in the ingame channel
|
||||||
|
- `"IN_EXCLUDED_CHANNEL"`: The user is in an excluded channel
|
||||||
|
|
||||||
|
### yaca:external:voiceRangeUpdate
|
||||||
|
|
||||||
|
This event is triggered when the voice range of a player is updated.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|------------|-------|---------------------------|
|
||||||
|
| range | `int` | the newly set voice range |
|
||||||
|
| rangeIndex | `int` | the index of the range |
|
||||||
|
|
||||||
|
### yaca:external:muteStateChanged
|
||||||
|
|
||||||
|
DEPRECATED: Use `yaca:external:microphoneMuteStateChanged` instead.
|
||||||
|
The event is triggered when the mute state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------|
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
### yaca:external:microphoneMuteStateChanged
|
||||||
|
|
||||||
|
The event is triggered when the microphone mute state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------|
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
### yaca:external:microphoneDisabledStateChanged
|
||||||
|
|
||||||
|
The event is triggered when the microphone disabled state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------|
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
### yaca:external:soundMuteStateChanged
|
||||||
|
|
||||||
|
The event is triggered when the sound mute state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------|
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
### yaca:external:soundDisabledStateChanged
|
||||||
|
|
||||||
|
The event is triggered when the sound disabled state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------|
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
### yaca:external:isTalking
|
||||||
|
|
||||||
|
The event is triggered when a player starts or stops talking.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|-----------------------|
|
||||||
|
| state | `boolean` | the new talking state |
|
||||||
|
|
||||||
|
### yaca:external:megaphoneState
|
||||||
|
|
||||||
|
The event is triggered when the megaphone state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|-------------------------|
|
||||||
|
| state | `boolean` | the new megaphone state |
|
||||||
|
|
||||||
|
### yaca:external:setRadioMuteState
|
||||||
|
|
||||||
|
The event is triggered when the radio mute state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|---------------------------------------------|
|
||||||
|
| channel | `number` | the channel where the mute state is changed |
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
### yaca:external:isRadioEnabled
|
||||||
|
|
||||||
|
The event is triggered when the radio state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|----------------------------------------------------------------------|
|
||||||
|
| state | `boolean` | `true` when the radio is enabled, `false` when the radio is disabled |
|
||||||
|
|
||||||
|
### yaca:external:changedActiveRadioChannel
|
||||||
|
|
||||||
|
The event is triggered when the active radio channel of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|------------------------------|
|
||||||
|
| channel | `number` | the new active radio channel |
|
||||||
|
|
||||||
|
### yaca:external:changedSecondaryRadioChannel
|
||||||
|
|
||||||
|
The event is triggered when the secondary radio channel of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|---------------------------------------------------|
|
||||||
|
| channel | `number` | the new active radio channel, or `-1` if disabled |
|
||||||
|
|
||||||
|
### yaca:external:setRadioVolume
|
||||||
|
|
||||||
|
The event is triggered when the radio volume of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-----------------------|
|
||||||
|
| channel | `number` | the channel to change |
|
||||||
|
| volume | `number` | the new volume to set |
|
||||||
|
|
||||||
|
### yaca:external:setRadioChannelStereo
|
||||||
|
|
||||||
|
The event is triggered when the stereo mode of a radio channel changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-----------------------------------------------------------------------------------------------|
|
||||||
|
| channel | `number` | the channel to change |
|
||||||
|
| stereo | `string` | `"MONO_LEFT"` for the left ear, `"MONO_RIGHT"` for the right ear and `"STEREO"` for both ears |
|
||||||
|
|
||||||
|
### yaca:external:setRadioFrequency
|
||||||
|
|
||||||
|
The event is triggered when the radio frequency of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|----------------------|
|
||||||
|
| channel | `number` | the channel to set |
|
||||||
|
| frequency | `string` | the frequency to set |
|
||||||
|
|
||||||
|
### yaca:external:isRadioTalking
|
||||||
|
|
||||||
|
The event is triggered when a player starts or stops talking on the radio.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|--------------------------------------------|
|
||||||
|
| state | `boolean` | the new talking state |
|
||||||
|
| channel | `number` | the channel where the player is talking at |
|
||||||
|
|
||||||
|
### yaca:external:isRadioReceiving
|
||||||
|
|
||||||
|
The event is triggered when a player starts or stops receiving on the radio.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|------------------------------------------------|
|
||||||
|
| state | `boolean` | the new receiver state |
|
||||||
|
| channel | `number` | the channel from which the player is receiving |
|
||||||
|
|
||||||
|
### yaca:external:notification
|
||||||
|
|
||||||
|
The event is triggered when a notification should be shown.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|--------------------------------------------------------------|
|
||||||
|
| message | `string` | the message to show |
|
||||||
|
| type | `string` | the type of the message (`"inform"`, `"error"`, `"success"`) |
|
||||||
|
|
||||||
|
Example for custom notification:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
AddEventHandler('yaca:external:notification', function (message, type)
|
||||||
|
-- Call your Notifications System here.
|
||||||
|
end)
|
||||||
|
```
|
||||||
|
|
||||||
|
### yaca:external:channelChanged
|
||||||
|
|
||||||
|
The event is triggered when the player changes the channel to the ingame or excluded channel.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-------------|----------|------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| channelType | `string` | `INGAME_CHANNEL` when moving into the ingame channel and `EXCLUDED_CHANNEL` when moving into a excluded channel. |
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary style="font-size: x-large">Server</summary>
|
||||||
|
|
||||||
|
### yaca:external:changeMegaphoneState
|
||||||
|
|
||||||
|
The event is triggered when the megaphone state of a player changes.
|
||||||
|
|
||||||
|
| Parametr | Type | Description |
|
||||||
|
|----------|-----------|-------------------------|
|
||||||
|
| source | `int` | the player source |
|
||||||
|
| state | `boolean` | the new megaphone state |
|
||||||
|
|
||||||
|
### yaca:external:phoneCall
|
||||||
|
|
||||||
|
The event is triggered when a phone call is started or ended.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------------------|---------------------------------------------------------------------------------|
|
||||||
|
| source | `int` | the player source |
|
||||||
|
| target | `int` | the target player source |
|
||||||
|
| state | `boolean` | the new phone call state |
|
||||||
|
| filter | `YacaFilterEnum` | the used filter for the phone call, can be either `PHONE` or `PHONE_HISTORICAL` |
|
||||||
|
|
||||||
|
### yaca:external:phoneSpeaker
|
||||||
|
|
||||||
|
The event is triggered when the phone speaker state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|-----------------------------|
|
||||||
|
| source | `int` | the player source |
|
||||||
|
| state | `boolean` | the new phone speaker state |
|
||||||
|
|
||||||
|
### yaca:external:changedRadioFrequency
|
||||||
|
|
||||||
|
The event is triggered when the radio frequency of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|----------|-----------------------------------------|
|
||||||
|
| source | `int` | the player source |
|
||||||
|
| channel | `int` | the channel where the frequency was set |
|
||||||
|
| frequency | `string` | the frequency to set |
|
||||||
|
|
||||||
|
### yaca:external:changedRadioMuteState
|
||||||
|
|
||||||
|
The event is triggered when the radio mute state of a player changes.
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|-----------|----------------------------------------------|
|
||||||
|
| source | `int` | the player source |
|
||||||
|
| channel | `int` | the channel where the mute state was changed |
|
||||||
|
| state | `boolean` | the new mute state |
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
# Developers
|
||||||
|
|
||||||
|
If you want to contribute to this project, feel free to do so. We are happy about every contribution. If you have any
|
||||||
|
questions, feel free to ask in our [Discord](http://discord.yaca.systems/).
|
||||||
|
|
||||||
|
## Building the resource
|
||||||
|
|
||||||
|
To build the resource, you need to have [Node.js](https://nodejs.org/) installed. After that, you can run the following
|
||||||
|
commands to build the resource:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm install
|
||||||
|
pnpm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
The built resource will be located in the `resource` folder, which you can then use in your FiveM server.
|
17
resources/[voice]/yaca-voice/config/server.json5
Normal file
17
resources/[voice]/yaca-voice/config/server.json5
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"uniqueServerId": "FAqZTlphJBka2Y0gZr/KrZyXzQY=", // The unique Server Identifier of the Teamspeak-Server
|
||||||
|
"ingameChannelId": 5, // The ID of the Ingame Channel
|
||||||
|
"ingameChannelPassword": "SvqvZYGhX43CrIkt", // The Password used to join the Ingame Channel
|
||||||
|
"defaultChannelId": 9, // The ID of the Channel where a players should be moved to when leaving Ingame
|
||||||
|
"useWhisper": false, // If you want to use the Whisper functions of TeamSpeak, if set to false it mutes and unmutes the players
|
||||||
|
"excludeChannels": [], // The channels that should be able to join while being Ingame without instantly being moved back into the Ingame channel
|
||||||
|
|
||||||
|
/* The pattern that is used to generate the username.
|
||||||
|
*
|
||||||
|
* Following placeholders will be replaced:
|
||||||
|
* - {serverid} with the Ingame-ID of the player
|
||||||
|
* - {playername} with the steam/fivem name of the player
|
||||||
|
* - {guid} with a string containing random letters and digits.
|
||||||
|
*/
|
||||||
|
"userNamePattern": "{serverid}"
|
||||||
|
}
|
174
resources/[voice]/yaca-voice/config/shared.json5
Normal file
174
resources/[voice]/yaca-voice/config/shared.json5
Normal file
|
@ -0,0 +1,174 @@
|
||||||
|
{
|
||||||
|
// Enable the version check to get notified about new versions.
|
||||||
|
"versionCheck": true,
|
||||||
|
// Enable manual or automatic connecting to the voice channel when joining the server.
|
||||||
|
"autoConnectOnJoin": true,
|
||||||
|
// The build type of the plugin. 0 = release, 1 = develop (develop allows using all yaca plugin version)
|
||||||
|
"buildType": 0,
|
||||||
|
// The locale that should be used.
|
||||||
|
"locale": "de",
|
||||||
|
// The time before the teamspeak client is being unmuted after joining the ingame channel.
|
||||||
|
"unmuteDelay": 400,
|
||||||
|
// The range in which you can hear the phone speaker when active.
|
||||||
|
"maxPhoneSpeakerRange": 5,
|
||||||
|
/* Choose if players near other players that are in a call, should be heard by the players on the opposite side of the call.
|
||||||
|
*
|
||||||
|
* Following options are available:
|
||||||
|
* - false: Disable the feature completely
|
||||||
|
* - true: Enable the feature always
|
||||||
|
* - "PHONE_SPEAKER": Enable the feature only when the player on the phone has the phone speaker enabled.
|
||||||
|
*/
|
||||||
|
"phoneHearPlayersNearby": false,
|
||||||
|
// Choose which notifications should be enabled.
|
||||||
|
"notifications": {
|
||||||
|
// Enable notifications from ox_lib
|
||||||
|
"oxLib": false,
|
||||||
|
// Enable notifications from okokNotify
|
||||||
|
"okoknotify": false,
|
||||||
|
// Enable notifications from GTA (FiveM only)
|
||||||
|
"gta": true,
|
||||||
|
// Enable notifications from Rdr 2 (RedM only)
|
||||||
|
"redm": false,
|
||||||
|
// Enable the option to implement a custom notification
|
||||||
|
"own": false
|
||||||
|
},
|
||||||
|
// Set the default key binds for the plugin, which can be then changed by the player.
|
||||||
|
"keyBinds": {
|
||||||
|
// The key to increase the voice range
|
||||||
|
"increaseVoiceRange": "ADD",
|
||||||
|
// The key to decrease the voice range
|
||||||
|
"decreaseVoiceRange": "SUBTRACT",
|
||||||
|
// The key to transmit on the primary radio
|
||||||
|
"primaryRadioTransmit": "N",
|
||||||
|
// The key to transmit on the secondary radio
|
||||||
|
"secondaryRadioTransmit": "CAPITAL",
|
||||||
|
// The key to use the megaphone
|
||||||
|
"megaphone": "B",
|
||||||
|
// The key to hold additional to change voice range via mousewheel by 1 meter, false to disable that feature
|
||||||
|
"voiceRangeWithMouseWheel": "LCONTROL"
|
||||||
|
},
|
||||||
|
"radioSettings": {
|
||||||
|
// Customize radio animation
|
||||||
|
"animation": {
|
||||||
|
"dictionary": "random@arrests",
|
||||||
|
"name": "generic_radio_chatter",
|
||||||
|
"flag": 49
|
||||||
|
},
|
||||||
|
"propWhileTalking": {
|
||||||
|
// The prop that should be shown while talking on the radio.
|
||||||
|
"prop": false,
|
||||||
|
// The bone that the prop should be attached to.
|
||||||
|
"boneId": 28422,
|
||||||
|
// The position of the prop.
|
||||||
|
"position": [
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0
|
||||||
|
],
|
||||||
|
// The rotation of the prop.
|
||||||
|
"rotation": [
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// The maximum amount of radio channels that can be used.
|
||||||
|
"channelCount": 9,
|
||||||
|
/* Choose the mode of the radio system.
|
||||||
|
*
|
||||||
|
* Following options are available:
|
||||||
|
* - "Tower": The radio system is based on towers, which means that the range is limited by the distance to the next tower.
|
||||||
|
* - "Direct": The radio system is based on the distance between the players.
|
||||||
|
* - "None": The radio always works no matter the distance.
|
||||||
|
*/
|
||||||
|
"mode": "Tower",
|
||||||
|
// The maximum distance between two players or to the tower to be able to hear each other.
|
||||||
|
"maxDistance": 5000
|
||||||
|
},
|
||||||
|
"voiceRange": {
|
||||||
|
// The default index which should be used for the voice range when a player joins the server.
|
||||||
|
"defaultIndex": 1,
|
||||||
|
// The ranges that should be available for the players.
|
||||||
|
"ranges": [
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
8,
|
||||||
|
15,
|
||||||
|
20,
|
||||||
|
25,
|
||||||
|
30,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
// Choose if a notification should be sent when the voice range is changed.
|
||||||
|
"sendNotification": false,
|
||||||
|
"markerColor": {
|
||||||
|
// Choose if the marker should be enabled.
|
||||||
|
"enabled": true,
|
||||||
|
// The color of the marker, r = red, g = green, b = blue, a = alpha
|
||||||
|
"r": 0,
|
||||||
|
"g": 255,
|
||||||
|
"b": 0,
|
||||||
|
"a": 50,
|
||||||
|
// The duration the marker should be shown.
|
||||||
|
"duration": 1000,
|
||||||
|
"type": 1,
|
||||||
|
"rotate": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"megaphone": {
|
||||||
|
// The range of the megaphone.
|
||||||
|
"range": 30,
|
||||||
|
// Choose if the plugin should automatically detect if the player should be able to use the megaphone in the vehicle. (FiveM only)
|
||||||
|
"automaticVehicleDetection": true,
|
||||||
|
// The allowed vehicle classes for the megaphone. (FiveM only)
|
||||||
|
"allowedVehicleClasses": [
|
||||||
|
18,
|
||||||
|
19
|
||||||
|
],
|
||||||
|
// The allowed vehicle models for the megaphone. (FiveM only)
|
||||||
|
"allowedVehicleModels": [
|
||||||
|
"polmav"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// Choose if the saltyChatBridge should be enabled.
|
||||||
|
"saltyChatBridge": false,
|
||||||
|
"mufflingSettings": {
|
||||||
|
// If set to -1, the player voice range is used, all values >= 0 sets the muffling range before it gets completely cut off
|
||||||
|
"mufflingRange": -1,
|
||||||
|
"vehicleMuffling": {
|
||||||
|
// If set to true, the vehicle muffling feature is enabled. (FiveM only)
|
||||||
|
"enabled": true,
|
||||||
|
// Whitelist of vehicles that should be not be affected by the vehicle muffling. (FiveM only)
|
||||||
|
"vehicleWhitelist": [
|
||||||
|
"gauntlet6",
|
||||||
|
"draugur",
|
||||||
|
"bodhi2",
|
||||||
|
"vagrant",
|
||||||
|
"outlaw",
|
||||||
|
"trophytruck",
|
||||||
|
"ratel",
|
||||||
|
"drifttampa",
|
||||||
|
"sm722",
|
||||||
|
"tornado4",
|
||||||
|
"swinger",
|
||||||
|
"locust",
|
||||||
|
"hotring"
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// The intensities of the muffling. (0 = no muffling, 10 = full muffling)
|
||||||
|
"intensities": {
|
||||||
|
// The intensity when the players are in different rooms.
|
||||||
|
"differentRoom": 10,
|
||||||
|
// The intensity when both cars are closed. (FiveM only)
|
||||||
|
"bothCarsClosed": 10,
|
||||||
|
// The intensity when one car is closed. (FiveM only)
|
||||||
|
"oneCarClosed": 6,
|
||||||
|
// The intensity of muffling of the megaphone of a player in a different car. (FiveM only)
|
||||||
|
"megaPhoneInCar": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Cooldown in milliseconds which the player has to wait to use the radio again, defaults to false which disables the feature.
|
||||||
|
"radioAntiSpamCooldown": false,
|
||||||
|
// When set to true the plugin syncs the talk state via the plugin, instead of the default way via statebags. This imitates the way how saltychat syncs the talk state, but has some drawbacks.
|
||||||
|
"useLocalLipSync": false
|
||||||
|
}
|
519
resources/[voice]/yaca-voice/config/towers.json5
Normal file
519
resources/[voice]/yaca-voice/config/towers.json5
Normal file
|
@ -0,0 +1,519 @@
|
||||||
|
{
|
||||||
|
"towerPositions": [
|
||||||
|
[
|
||||||
|
2572,
|
||||||
|
5397,
|
||||||
|
56
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2663,
|
||||||
|
4972,
|
||||||
|
56
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2892,
|
||||||
|
3911,
|
||||||
|
56
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2720,
|
||||||
|
3304,
|
||||||
|
64
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2388,
|
||||||
|
2949,
|
||||||
|
64
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1830,
|
||||||
|
2368,
|
||||||
|
64
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1650,
|
||||||
|
1316,
|
||||||
|
102
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1363,
|
||||||
|
680,
|
||||||
|
102
|
||||||
|
],
|
||||||
|
[
|
||||||
|
918,
|
||||||
|
230,
|
||||||
|
92
|
||||||
|
],
|
||||||
|
[
|
||||||
|
567,
|
||||||
|
303,
|
||||||
|
58
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-47,
|
||||||
|
-666,
|
||||||
|
74
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-585,
|
||||||
|
-902,
|
||||||
|
53
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2572,
|
||||||
|
5397,
|
||||||
|
56
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2338,
|
||||||
|
5940,
|
||||||
|
77
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1916,
|
||||||
|
6244,
|
||||||
|
65
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1591,
|
||||||
|
6371,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
[
|
||||||
|
953,
|
||||||
|
6504,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
[
|
||||||
|
76,
|
||||||
|
6606,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
[
|
||||||
|
408,
|
||||||
|
6587,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-338,
|
||||||
|
-579,
|
||||||
|
48
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-293,
|
||||||
|
-632,
|
||||||
|
47
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-269,
|
||||||
|
-962,
|
||||||
|
143
|
||||||
|
],
|
||||||
|
[
|
||||||
|
98,
|
||||||
|
-870,
|
||||||
|
136
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-214,
|
||||||
|
-744,
|
||||||
|
219
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-166,
|
||||||
|
-590,
|
||||||
|
199
|
||||||
|
],
|
||||||
|
[
|
||||||
|
124,
|
||||||
|
-654,
|
||||||
|
261
|
||||||
|
],
|
||||||
|
[
|
||||||
|
149,
|
||||||
|
-769,
|
||||||
|
261
|
||||||
|
],
|
||||||
|
[
|
||||||
|
580,
|
||||||
|
89,
|
||||||
|
117
|
||||||
|
],
|
||||||
|
[
|
||||||
|
423,
|
||||||
|
15,
|
||||||
|
151
|
||||||
|
],
|
||||||
|
[
|
||||||
|
424,
|
||||||
|
18,
|
||||||
|
151
|
||||||
|
],
|
||||||
|
[
|
||||||
|
551,
|
||||||
|
-28,
|
||||||
|
93
|
||||||
|
],
|
||||||
|
[
|
||||||
|
305,
|
||||||
|
-284,
|
||||||
|
68
|
||||||
|
],
|
||||||
|
[
|
||||||
|
299,
|
||||||
|
-313,
|
||||||
|
68
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1240,
|
||||||
|
-1090,
|
||||||
|
44
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-418,
|
||||||
|
-2804,
|
||||||
|
14
|
||||||
|
],
|
||||||
|
[
|
||||||
|
802,
|
||||||
|
-2996,
|
||||||
|
27
|
||||||
|
],
|
||||||
|
[
|
||||||
|
253,
|
||||||
|
-3145,
|
||||||
|
39
|
||||||
|
],
|
||||||
|
[
|
||||||
|
207,
|
||||||
|
-3145,
|
||||||
|
39
|
||||||
|
],
|
||||||
|
[
|
||||||
|
207,
|
||||||
|
-3307,
|
||||||
|
39
|
||||||
|
],
|
||||||
|
[
|
||||||
|
247,
|
||||||
|
-3307,
|
||||||
|
39
|
||||||
|
],
|
||||||
|
[
|
||||||
|
484,
|
||||||
|
-2178,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
[
|
||||||
|
548,
|
||||||
|
-2219,
|
||||||
|
67
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-701,
|
||||||
|
58,
|
||||||
|
68
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-696,
|
||||||
|
208,
|
||||||
|
139
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-769,
|
||||||
|
255,
|
||||||
|
134
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-150,
|
||||||
|
-150,
|
||||||
|
96
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-202,
|
||||||
|
-327,
|
||||||
|
65
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1913,
|
||||||
|
-3031,
|
||||||
|
22
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1918,
|
||||||
|
-3028,
|
||||||
|
22
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1039,
|
||||||
|
-2385,
|
||||||
|
27
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1042,
|
||||||
|
-2390,
|
||||||
|
27
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1583,
|
||||||
|
-3216,
|
||||||
|
28
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1590,
|
||||||
|
-3212,
|
||||||
|
28
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1308,
|
||||||
|
-2626,
|
||||||
|
36
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1311,
|
||||||
|
-2624,
|
||||||
|
36
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-984,
|
||||||
|
-2778,
|
||||||
|
48
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-991,
|
||||||
|
-2774,
|
||||||
|
48
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-556,
|
||||||
|
-119,
|
||||||
|
50
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-619,
|
||||||
|
-106,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1167,
|
||||||
|
-575,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1152,
|
||||||
|
-443,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1156,
|
||||||
|
-498,
|
||||||
|
49
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1290,
|
||||||
|
-445,
|
||||||
|
106
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-928,
|
||||||
|
-383,
|
||||||
|
135
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-902,
|
||||||
|
-443,
|
||||||
|
170
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-770,
|
||||||
|
-786,
|
||||||
|
83
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-824,
|
||||||
|
-719,
|
||||||
|
120
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-598,
|
||||||
|
-917,
|
||||||
|
35
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-678,
|
||||||
|
-717,
|
||||||
|
54
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-669,
|
||||||
|
-804,
|
||||||
|
31
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1463,
|
||||||
|
-526,
|
||||||
|
83
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1525,
|
||||||
|
-596,
|
||||||
|
66
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1375,
|
||||||
|
-465,
|
||||||
|
83
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-1711,
|
||||||
|
478,
|
||||||
|
127
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-2311,
|
||||||
|
335,
|
||||||
|
187
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-2214,
|
||||||
|
342,
|
||||||
|
198
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-2234,
|
||||||
|
187,
|
||||||
|
193
|
||||||
|
],
|
||||||
|
[
|
||||||
|
202,
|
||||||
|
1204,
|
||||||
|
230
|
||||||
|
],
|
||||||
|
[
|
||||||
|
217,
|
||||||
|
1140,
|
||||||
|
230
|
||||||
|
],
|
||||||
|
[
|
||||||
|
668,
|
||||||
|
590,
|
||||||
|
136
|
||||||
|
],
|
||||||
|
[
|
||||||
|
722,
|
||||||
|
562,
|
||||||
|
134
|
||||||
|
],
|
||||||
|
[
|
||||||
|
838,
|
||||||
|
510,
|
||||||
|
138
|
||||||
|
],
|
||||||
|
[
|
||||||
|
773,
|
||||||
|
575,
|
||||||
|
138
|
||||||
|
],
|
||||||
|
[
|
||||||
|
735,
|
||||||
|
231,
|
||||||
|
145
|
||||||
|
],
|
||||||
|
[
|
||||||
|
450,
|
||||||
|
5566,
|
||||||
|
795
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-449,
|
||||||
|
6019,
|
||||||
|
35
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-142,
|
||||||
|
6286,
|
||||||
|
39
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-368,
|
||||||
|
6105,
|
||||||
|
38
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2792,
|
||||||
|
5996,
|
||||||
|
355
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2796,
|
||||||
|
5992,
|
||||||
|
354
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3460,
|
||||||
|
3653,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3459,
|
||||||
|
3659,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3615,
|
||||||
|
3642,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3614,
|
||||||
|
3636,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-2180,
|
||||||
|
3252,
|
||||||
|
54
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-2124,
|
||||||
|
3219,
|
||||||
|
54
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-2050,
|
||||||
|
3178,
|
||||||
|
54
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1858,
|
||||||
|
3694,
|
||||||
|
37
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1695,
|
||||||
|
3614,
|
||||||
|
37
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1692,
|
||||||
|
2532,
|
||||||
|
60
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1692,
|
||||||
|
2647,
|
||||||
|
60
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1824,
|
||||||
|
2574,
|
||||||
|
60
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1407,
|
||||||
|
2117,
|
||||||
|
104
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
28
resources/[voice]/yaca-voice/dist/client.js
vendored
Normal file
28
resources/[voice]/yaca-voice/dist/client.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9040
resources/[voice]/yaca-voice/dist/server.js
vendored
Normal file
9040
resources/[voice]/yaca-voice/dist/server.js
vendored
Normal file
File diff suppressed because one or more lines are too long
30
resources/[voice]/yaca-voice/fxmanifest.lua
Normal file
30
resources/[voice]/yaca-voice/fxmanifest.lua
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
fx_version 'cerulean'
|
||||||
|
games { 'gta5', 'rdr3' }
|
||||||
|
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
|
||||||
|
|
||||||
|
name 'yaca-voice'
|
||||||
|
author 'MineMalox & LuftigerLuca'
|
||||||
|
version '3.0.5'
|
||||||
|
repository 'https://github.com/yaca-systems/fivem-yaca-typescript'
|
||||||
|
description 'YACA Voice Integration for FiveM & RedM'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
'/server:7290',
|
||||||
|
'/onesync',
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_page 'web/index.html'
|
||||||
|
|
||||||
|
files {
|
||||||
|
'web/index.html',
|
||||||
|
'web/script.js',
|
||||||
|
'config/shared.json5',
|
||||||
|
'config/towers.json5',
|
||||||
|
'locales/*.json',
|
||||||
|
}
|
||||||
|
|
||||||
|
client_script 'dist/client.js'
|
||||||
|
server_script 'dist/server.js'
|
||||||
|
|
||||||
|
provide 'saltychat'
|
||||||
|
|
33
resources/[voice]/yaca-voice/locales/de.json
Normal file
33
resources/[voice]/yaca-voice/locales/de.json
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"connect_error": "Fehler beim Verbinden zum Teamspeak-Server, bitte verbinde dich erneut!",
|
||||||
|
"plugin_not_initialized": "Das Voice-Plugin wurde noch nicht initialisiert!",
|
||||||
|
|
||||||
|
"outdated_plugin": "Dein Voice-Plugin ist veraltet! Bitte aktualisiere auf die Version %s!",
|
||||||
|
"wrong_ts_server": "Du bist auf dem falschen Teamspeak-Server!",
|
||||||
|
"move_error": "Fehler beim Verschieben auf den Teamspeak-Server!",
|
||||||
|
"max_players_reached": "Ihre Lizenz hat die maximale Spieleranzahl erreicht. Bitte erweitern Sie Ihre Lizenz.",
|
||||||
|
"license_server_timed_out": "Die Verbindung zum Lizenzserver wurde beim Überprüfen der Lizenz unterbrochen. Bitte warte einen Moment.",
|
||||||
|
"unknown_error": "Unbekannter Fehlercode: %s",
|
||||||
|
|
||||||
|
"changed_stereo_mode": "Kanal %s ist jetzt auf %s zu hören.",
|
||||||
|
"left_ear": "dem linken Ohr",
|
||||||
|
"right_ear": "dem rechten Ohr",
|
||||||
|
"both_ears": "beiden Ohren",
|
||||||
|
"secondary_radio_channel_disabled": "Der sekundäre Funkkanal wurde deaktiviert.",
|
||||||
|
"secondary_radio_channel_enabled": "Kanal %s ist nun der Sekundäre Funkkanal.",
|
||||||
|
|
||||||
|
"use_megaphone": "Megaphon benutzen",
|
||||||
|
"use_radio": "Im primären Funkkanal senden",
|
||||||
|
"use_secondary_radio": "Im sekundären Funkkanal senden",
|
||||||
|
|
||||||
|
"use_salty_primary_radio": "Primäres Funkgerät benutzen",
|
||||||
|
"use_salty_secondary_radio": "Sekundäres Funkgerät benutzen",
|
||||||
|
|
||||||
|
"change_voice_range_increase": "Sprachreichweite erhöhen",
|
||||||
|
"change_voice_range_decrease": "Sprachreichweite verringern",
|
||||||
|
"voice_range_changed": "Sprachreichweite auf %s Meter geändert.",
|
||||||
|
"change_voice_range_via_mousewheel": "Sprachreichweite je 1 Meter ändern",
|
||||||
|
|
||||||
|
"radio_not_activated": "Das Funkgerät ist nicht aktiviert!",
|
||||||
|
"radio_channel_invalid": "Ungültiger Funkkanal!"
|
||||||
|
}
|
33
resources/[voice]/yaca-voice/locales/en.json
Normal file
33
resources/[voice]/yaca-voice/locales/en.json
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"connect_error": "Error while connecting to voice server, please reconnect!",
|
||||||
|
"plugin_not_initialized": "Plugin not initialized!",
|
||||||
|
|
||||||
|
"outdated_plugin": "Your plugin is outdated, please update to version %s!",
|
||||||
|
"wrong_ts_server": "You are connected to the wrong teamspeak server!",
|
||||||
|
"move_error": "Error while moving to the channel!",
|
||||||
|
"max_players_reached": "Your license reached the maximum player count. Please upgrade your license",
|
||||||
|
"license_server_timed_out": "The connection to the license server timed out, while verifying the license. Please wait a moment.",
|
||||||
|
"unknown_error": "Unknown error code: %s",
|
||||||
|
|
||||||
|
"changed_stereo_mode": "Channel %s is now only heard in %s.",
|
||||||
|
"left_ear": "the left ear",
|
||||||
|
"right_ear": "the right ear",
|
||||||
|
"both_ears": "both ears",
|
||||||
|
"secondary_radio_channel_disabled": "The secondary radio channel has been disabled.",
|
||||||
|
"secondary_radio_channel_enabled": "Channel %s is now the secondary radio channel.",
|
||||||
|
|
||||||
|
"use_megaphone": "Use megaphone",
|
||||||
|
"use_radio": "Use radio",
|
||||||
|
"use_secondary_radio": "Use secondary radio",
|
||||||
|
|
||||||
|
"use_salty_primary_radio": "Use primary radio",
|
||||||
|
"use_salty_secondary_radio": "Use secondary radio",
|
||||||
|
|
||||||
|
"change_voice_range_increase": "Increase voice range",
|
||||||
|
"change_voice_range_decrease": "Decrease voice range",
|
||||||
|
"voice_range_changed": "Voice range changed to %s meters.",
|
||||||
|
"change_voice_range_via_mousewheel": "Change voice range by 1 meter",
|
||||||
|
|
||||||
|
"radio_not_activated": "Your radio is not activated!",
|
||||||
|
"radio_channel_invalid": "The radio channel is invalid!"
|
||||||
|
}
|
13
resources/[voice]/yaca-voice/web/index.html
Normal file
13
resources/[voice]/yaca-voice/web/index.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>YACA WebSocket</title>
|
||||||
|
|
||||||
|
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
|
||||||
|
<script src="script.js" type="text/javascript"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body style="display: none;"></body>
|
||||||
|
|
||||||
|
</html>
|
85
resources/[voice]/yaca-voice/web/script.js
Normal file
85
resources/[voice]/yaca-voice/web/script.js
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
let webSocket = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect to the YaCA voice plugin
|
||||||
|
*/
|
||||||
|
function connect() {
|
||||||
|
console.log('[YaCA-Websocket] Trying to Connect to YaCA WebSocket...')
|
||||||
|
|
||||||
|
try {
|
||||||
|
webSocket = new window.WebSocket('ws://127.0.0.1:30125/')
|
||||||
|
} catch {
|
||||||
|
connect()
|
||||||
|
}
|
||||||
|
|
||||||
|
webSocket.onmessage = (event) => {
|
||||||
|
if (!event) return
|
||||||
|
sendNuiData('YACA_OnMessage', event.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
webSocket.onopen = (event) => {
|
||||||
|
if (!event) return
|
||||||
|
sendNuiData('YACA_OnConnected')
|
||||||
|
}
|
||||||
|
|
||||||
|
webSocket.onclose = (event) => {
|
||||||
|
if (!event) return
|
||||||
|
|
||||||
|
sendNuiData('YACA_OnDisconnected', {
|
||||||
|
code: event.code,
|
||||||
|
reason: event.reason,
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
connect()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a command to the YaCA voice plugin
|
||||||
|
*
|
||||||
|
* @param command - The command to send as a object
|
||||||
|
*/
|
||||||
|
function runCommand(command) {
|
||||||
|
if (!webSocket || webSocket.readyState !== WebSocket.OPEN) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
webSocket.send(JSON.stringify(command))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a NUI message to the client
|
||||||
|
*
|
||||||
|
* @param event - The name of the callback
|
||||||
|
* @param data - The data to send
|
||||||
|
*/
|
||||||
|
function sendNuiData(event, data = {}) {
|
||||||
|
// skipcq: JS-0125
|
||||||
|
fetch(`https://${GetParentResourceName()}/${event}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
},
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
}).catch((error) => console.error('[YaCA-Websocket] Error sending NUI Message:', error))
|
||||||
|
}
|
||||||
|
|
||||||
|
$(() => {
|
||||||
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
sendNuiData('YACA_OnNuiReady')
|
||||||
|
})
|
||||||
|
|
||||||
|
window.addEventListener('message', (event) => {
|
||||||
|
if (event.data.action === 'connect') {
|
||||||
|
connect()
|
||||||
|
} else if (event.data.action === 'command') {
|
||||||
|
runCommand(event.data.data)
|
||||||
|
} else if (event.data.action === 'close') {
|
||||||
|
if (webSocket) webSocket.close()
|
||||||
|
} else {
|
||||||
|
console.error('[YaCA-Websocket] Unknown message:', event.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue