vehicleRadioStationChangeRequest
Asks your gamemode when anyone in a car changes the radio station. Allowed, the station becomes the car’s for every occupant.
Renamed in 0.28 from vehicleRadioChange; see renamed names.
Signature
Section titled “Signature”server.on("vehicleRadioStationChangeRequest", ({ player, fromStation, toStation }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerInVehicle |
The occupant asking; vehicleId is the car and seat theirs (0 the driver). |
fromStation |
RadioStation (see Stations) |
The car’s station now. |
toStation |
RadioStation |
The station they want. |
Returns
Section titled “Returns”false keeps the station; the player’s radio goes back to it. Anything else changes it for everyone in the car. See how decisions work.
Example
Section titled “Example”Only the driver picks the music.
import { server } from "nativemp";
server.on("vehicleRadioStationChangeRequest", ({ player }) => player.seat === 0);Stations
Section titled “Stations”emergency_aa, playback_fm, k_rose, k_dst, bounce_fm, sf_ur, radio_los_santos, radio_x, csr_103_9,
k_jah_west, master_sounds_98_3, wctr and off. The User Track Player is off in multiplayer.
Related
Section titled “Related”vehicleSirenChangeRequest: sirensvehicleHornStarted: horns