onClientPlayerRadioSwitch | Multi Theft Auto: Wiki Skip to content

onClientPlayerRadioSwitch

Client-side
Server-side
Shared

This event is triggered whenever the local player's radio station is changed

Parameters

int stationID
  • stationID: An integer representing the station the player switched to.

Source

element: The source of this event is the local player.

Canceling

If this event is canceled, the Radio station will not change.

Code Examples

client
label = guiCreateLabel ( 0.8, 0.9, 0.2, 0.1, "Radio off", true) --create a label to show the station
function stationDraw(station)
guiSetText ( label, getRadioChannelName(station)) --Show the station Name
end
addEventHandler("onClientPlayerRadioSwitch", getLocalPlayer(), stationDraw) -- add an event handler

See Also