- Documentation
- Audio
Category
Audio
All Lua functions and events in the Audio category, on the server and the client.
Client functions 9
getReturns the sound's balance between speakers (-1 to 1).Sound Pan getReturns the world point where a 3D sound plays.Sound Position3 D getElementPositionon the sound returns the same.isChecks whether the game's in-vehicle radio is on.Radio Enabled isChecks whether a sound loops.Sound Looped playPlays a built-in game interface sound by number (menu clicks, purchase, checkpoint and so on). Numbers 0-30 are gameplay sounds, 31-39 are menu sounds. The numbering is our own, because the Definitive Edition has a different set of sounds than the old San Andreas.Sound Front End setTurns the game's in-vehicle radio on or off. Off gives silence instead of GTA stations, for example for your own radio viaRadio Enabled playSound. From the server:setPlayerRadioEnabled.setSets whether a sound loops. The simplest way is to set it on creation:Sound Looped playSound(file, true).setSets the sound's balance between speakers:Sound Pan -1left,0centre,1right.setMoves a 3D sound to a new point in the world.Sound Position3 D setElementPositionon the sound does the same.