OnClientPlayerRadioSwitch

From Multi Theft Auto: Wiki
Revision as of 20:55, 1 April 2009 by Kodak (talk | contribs) (Changed the example to accomodate the new getRadioChannelName function.)
Jump to navigation Jump to search

This event is triggered whenever a players radio station is changed

Parameters

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

Station ID's:

  • 0: Radio Off
  • 1: Playback FM
  • 2: K-Rose
  • 3: K-DST
  • 4: Bounce FM
  • 5: SF-UR
  • 6: Radio Los Santos
  • 7: Radio X
  • 8: CSR 103.9
  • 9: K-Jah West
  • 10: Master Sounds 98.3
  • 11: WCTR
  • 12: User Track Player

Cancel effect

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

Example

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

Client player events


Client Audio functions