Server
AttachSongToEntity
Allows you to attach songs to entities.
exports["wais-speaker"]:AttachSongToEntity(netId, url, volume, loop, rate, maxDistance)netId:
numberThe NetworkId belonging to the entity to which the song will be attached.
url:
stringThis is the URL of the song to be used from YouTube. The song must be longer than 05:00 minutes. Example: https://www.youtube.com/watch?v=nmnjL26OBcY
volume?:
floatThe volume level of the song.
Min:
0.0Max:
1.0Default:
0.50
loop?:
booleanShould the song be played again and again?
Default:
false
rate?:
floatThe playback speed of the song.
Default:
1.0
maxDistance?:
floatThe distance value at which users will interact to hear the song.
Default:
Config.InteractionDistances.speakers (10.0)
Return:
success:
booleanmessage:
string
DestroySpeaker
It allows you to completely delete the song
netId:
numberNetworkId belonging to the entity to which the song will be deleted
Return:
success:
booleanmessage:
string
GetSpeaker
It allows you to access the speaker and its methods.
netId:
numberThe NetworkId of the speaker you want to access.
Return:
destroy()Deletes the song completely.
pause()It stops the song.
resume()Continues the song.
setVolume(volume)Adjusts the volume of the song.
volume:
number
setDistance(distance)It changes the distance the song can be heard.
distance:
float
seek(duration)You can skip to any second in the song.
duration:
float
InstallCarplay
If the option to use CarPlay by installing it is active, it will allow you to install CarPlay in your vehicle.
plate:
stringThe license plate of the vehicle where CarPlay will be installed.
netId:
numberThe NetworkId of the vehicle where Carplay will be installed.
Return:
success:
booleanmessage:
stringinvalid_arguments, carplay_installed
RemoveCarplay
If the option to use CarPlay as an item is enabled, it will remove CarPlay from the vehicle.
plate:
stringThe license plate of the vehicle where CarPlay will be removed.
netId:
numberThe NetworkId of the vehicle where Carplay will be removed.
Return:
success:
booleanmessage:
stringinvalid_arguments, failed_to_remove_carplay, carplay_removed
Last updated