Server-side exports
These functions should be used in the server script files.
Last updated
These functions should be used in the server script files.
Last updated
Play3DPos(source, uniqueId, position, distance, sound, volume, looped)
Can't be empty - *
Argument number | Argument name | Example value |
---|---|---|
This export function plays a sound at a specified position.
Play3DEntity(source, entityNetId, distance, sound, volume, looped)
Can't be empty - *
This export function plays a sound on a specified entity.
Play3D*
function variableEntity player data (Yellow) Player at a position data (White)
soundVar.modify(source, field, newValue, secondValue)
Can't be empty - *
This export function modifies the specified sound value.
soundVar.destroy(source)
Can't be empty - *
This export function destroys the sound element.
soundVar.replay(source)
Can't be empty - *
This export function replays the sound from the beginning.
getSound(uniqueId)
This export function gets the sound object.
getSoundData(uniqueId, field)
This export function gets a specified data field of the sound object.
Argument number | Argument name | Example value |
---|---|---|
Field | Description | Type |
---|---|---|
Argument number | Argument name | Example value |
---|---|---|
Field | Type | Example value | Example second value |
---|---|---|---|
Argument number | Argument name | Example value |
---|---|---|
Argument number | Argument name | Example value |
---|---|---|
1
source*
1
2
uniqueId*
"uniqueName"
3
position*
vector3(123.0, 123.0, 123.0)
4
distance
50.0
5
sound*
"fileName" OR "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
6
volume (0.0-1.0)
1.0
7
looped
false
1
source*
1
2
entityNetId*
NetworkGetNetworkIdFromEntity(PlayerPedId())
3
distance
50.0
4
sound*
"fileName" OR "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
5
volume (0.0-1.0)
1.0
6
looped
false
id
Sound unique id / name
string/number
entity
Entity ID
entity
url
The source/URL of the sound
string
volume
Sound volume (0.0-1.0)
number
distance
Max distance of the sound
number
position
Position of the sound player
vector3
loop
Looped or not
boolean
playedAt
Current timestamp of the video
number
destroyOnFinish
Will the sound element be destroyed on finish
boolean
1
source*
1
2
field*
"volume"
3
newValue*
1.0
4
secondValue
500 Fading time in miliseconds.
volume
number (0.0-1.0)
1.0
500 Fading time in miliseconds.
distance
number
50.0
None
position
vector3
vector3(123.0, 123.0, 123.0)
None
loop
boolean
true
None
timeStamp
number (seconds)
60
None
destroyOnFinish
boolean
true
None
1
source*
1
1
source*
1