AI Core

ai-voice

Proximity voice with ranges, radio with several frequencies, and phone calls with a loudspeaker, on FiveM Legacy and Enhanced. Stands in for pma-voice.

ai-voice lets players talk to each other. Nearby players hear each other by distance, players on the same radio frequency hear each other anywhere while the radio key is held, and players in the same phone call hear each other anywhere. It runs on both FiveM Legacy (Mumble) and FiveM for GTA V Enhanced (server voice channels).

What it does in the game

  • Voice ranges. Players switch between the ranges you set (Whisper 1.5 m, Normal 3 m, Shouting 6 m by default) with the voice range key. The HUD shows the range.
  • Radio. A player can listen to several frequencies at once (3 by default) and talks on the active one while holding the radio key. A click plays when someone starts and stops talking (each player can turn it off).
  • Job frequencies. Frequency ranges can be locked to jobs or gangs (police on 1 to 10). A player who loses the job or goes off duty leaves those frequencies automatically.
  • Radio animation (off by default): the character holds the shoulder radio or a handheld radio while talking. Job frequencies can pick their own animation.
  • Phone calls. Players in the same call hear each other anywhere. Phone scripts put players into calls.
  • Loudspeaker. A phone script can turn a call's loudspeaker on: players next to the phone hear the call, and (by default) the call hears them too.
  • Sound effects. Radio and phone voices are filtered like a speaker or a phone.
  • Admin mute. /muteply mutes a player for some time. The mute survives a reconnect.
  • Player volumes. Each player can set their own radio and call volume; the panel sets where they start.

Installation

The AI Core txAdmin recipe installs it. By hand: put the folder in resources/[ai]/ and add ensure ai-voice to server.cfg after ensure ai-core. It needs ai-core. It has no database table.

  • Remove pma-voice, mumble-voip and TokoVOIP: ai-voice answers their names.
  • ai-voice sets voice_useNativeAudio and voice_useSendingRangeOnly itself.
  • On FiveM Enhanced, the radio and phone sound effects and scripts that use Mumble directly (tgiann-radio-v2, tgiann-phone, lb-phone's effects) need setr sv_mumble true in your cfg.
  • pma-voice convars you already have (voice_defaultVoiceMode, voice_enableRadios, voice_defaultRadioVolume and the others) are read once at the first start and copied into the panel for every setting still at its default. From then on the panel wins.
  • voice_defaultCycle and voice_defaultRadio set the keybinds' default keys.

Panel settings

Open the admin panel (F10) and pick Voice.

Settings tab

Voice system: FiveM Legacy talks through Mumble; FiveM for GTA V Enhanced through server voice channels.

SettingWhat it changesValuesDefault
Voice systemAutomatic picks the server voice channels when the server has them (Enhanced), else Mumble. A change applies when ai-voice starts again.Automatic / Server voice channels (Enhanced) / Mumble (Legacy)Automatic
In use nowRead only: the system ai-voice runs on now.

Voice ranges: how far a player is heard. Players switch between these ranges with the voice range key.

SettingWhat it changesValuesDefault
RangesThe list of ranges, each with a Name and a Distance (how far this range carries).1 to 6 ranges, 0.5 to 100 m eachWhisper 1.5 m, Normal 3 m, Shouting 6 m
Starting rangeThe position in the list a player starts with (1 = the first range).1 to 62
Players can change their rangeOff keeps everyone at the starting range (scripts can still change it).on / offon
Mumble reach factorFiveM Legacy only: players within the range times this number receive the voice (Mumble's audio fades out over a longer distance than the range). 3 is pma-voice's value.1 to 5 x3

Radio: players on the same frequency hear each other anywhere while the radio key is held.

SettingWhat it changesValuesDefault
Radio onTurns the radio on or off for everyone.on / offon
Radio volumeHow loud others sound on the radio, in percent. Players can change it for themselves.0 to 100 %30
Frequencies at onceHow many frequencies a player can listen to at the same time; they talk on one of them.1 to 103
Radio sound effectFilters the voice like a speaker. On FiveM Enhanced this needs setr sv_mumble true.on / offon
Effect taken over byRead only: a running script that brings its own effect (tgiann-radio, tgiann-radio-v2). ai-voice's effect stays off while it runs.
Radio clicksA click when someone starts and stops talking on the radio. Players can turn it off for themselves.on / offon
Send names to radio membersRadio scripts that list members get each member's character name.on / offoff

Radio animation: what the character does while talking on the radio.

SettingWhat it changesValuesDefault
Radio animation onOff: no animation on any frequency. Scripts can also turn it off for one player.on / offoff
AnimationUsed on every frequency without its own animation.Hand on the shoulder radio / Talking into the shoulder radio / Radio held in the hand / CustomHand on the shoulder radio
Animation dictionaryCustom only: the animation dictionary.textrandom@arrests
Animation nameCustom only: the animation clip.textgeneric_radio_enter
Animation flagCustom only: the TaskPlayAnim flag. 49 = upper body, loops, can walk; 50 = upper body, holds the last frame, can walk.0 to 102349
Radio animation in vehiclesPlays the animation while sitting in a vehicle too.on / offon

Phone calls: players in the same call hear each other anywhere.

SettingWhat it changesValuesDefault
Phone calls onTurns calls on or off.on / offon
Call volumeHow loud the other side sounds, in percent. Players can change it for themselves.0 to 100 %60
Phone sound effectFilters call voices like a phone. Switch it off when your phone script brings its own call effect (lb-phone with CallEffects is not detected).on / offon
Effect taken over byRead only: a running script with its own call effect (tgiann-phone).
Let players' games join callsOff (safe): only server scripts put players into calls, or a phone script that checks each join. On: any player could join any call; needed by phones that join calls from the player's game, such as lb-phone.on / offoff
Phone loudspeakerPhone scripts can turn a call's loudspeaker on: players standing next to the phone hear the other side.on / offon
Loudspeaker reachPlayers within this many metres of the phone hear the call.0.5 to 15 m3
Loudspeaker volumeHow loud the loudspeaker sounds, in percent.0 to 100 %60
The call hears the people aroundThe other side of the call also hears the players next to the phone.on / offon

The game has a small fixed number of sound effect slots and cannot remove one. Switching an effect off stops using it; players free its slot only by restarting the game.

Frequencies tab

Radio frequencies only some jobs can join, and their animation. Each record is a range of frequencies; press New frequency range to add one. Frequencies outside every range are open to everyone.

SettingWhat it changesValuesDefault for a new range
NameThe name in the list (for example "Police radio").1 to 48 characters
From frequencyThe first frequency, as the radio shows it (1, 1.5...).0.01 to 1,000,0001
To frequencyThe last frequency. Must not be lower than the first.0.01 to 1,000,00010
JobsOnly members of these jobs can join. Leave jobs and gangs empty for everyone.job namespolice
GangsMembers of these gangs can join too.gang namesempty
Only on dutyJob members must be on duty in that job.on / offon
AnimationThe radio animation on these frequencies: the default one, none, or a set.default / none / a setdefault

Commands

CommandArgumentsWhoWhat it does
/muteply<id> [seconds]adminsMutes a player's voice, or unmutes a muted player. seconds defaults to 900 (15 minutes), at most one year. The player is told.
/voicedebugnoneadminsPrints every player's range, frequencies and call to the server console.

Keybinds

Default keyWhat it doesName in GTA settings
F11Changes the voice rangeChange voice range
Left AltTalks on the active radio frequency while heldTalk on the radio

The defaults come from the convars voice_defaultCycle and voice_defaultRadio when you set them. Both show in the HUD's key hints ("Voice range", "Radio").

Works with other scripts

  • Stands in for pma-voice (provides pma-voice, mumble-voip, tokovoip, toko-voip, tokovoip_script): its exports, state bags and events, so radio, phone and HUD scripts written for pma-voice run unchanged.
  • tgiann-radio works. tgiann-radio-v2 and tgiann-phone run without their custom pma-voice files; ai-voice turns its own radio or phone effect off while they run.
  • lb-phone needs Let players' games join calls on, and ai-voice's phone effect off if you use lb-phone's own call effects.
  • ai-hud shows the range, talking and the radio.

Known limits

  • Player commands of pma-voice (/vol, /setvoiceintent) do not exist; players use their own keybinds and the radio script's settings.
  • On Enhanced, a script range from the player's own game (overrideProximityRange) is refused: server scripts set ranges there.
  • Restarting ai-voice keeps each player's range, active frequency and call, but not the extra frequencies they listened to or the loudspeakers.
  • A changed Voice system applies at the next start of ai-voice.

On this page