Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local radios = {
- {name="Radio Off", value = 0},
- {name="Playback FM", value = 1},
- {name="K-Rose", value = 2},
- {name="K-DST", value = 3},
- {name="Bounce FM", value = 4},
- {name="SF-UR", value = 5},
- {name="Radio Lost Santos", value = 6},
- {name="Radio X", value = 7},
- {name="CSR 103.9", value = 8},
- {name="K-Jah West", value = 9},
- {name="Master Sounds 98.3", value = 10},
- {name="WCTR", value = 11},
- {name="User Track Player", value = 12},
- {url = "http://trace.dnbradio.com/dnbradio.mp3",name = "DnB Radio"},
- {url = "http://listen.181fm.com:8070",name = "181FM"},
- {url = "http://edmzone.eu/play.pls",name = "EDM:Zone"},
- {url = "http://y0b.net/rnr.m3u",name = "RnR"},
- {url = "http://y0b.net/radiosa.m3u",name = "Radio:SA"},
- {url = "http://y0b.net/msx.m3u",name = "MsX"},
- {url = "http://198.100.145.185:8900/stream",name = "Untitled"},
- {url = "http://death.fm/modules/Listen/MP3-hi.asx",name = "Death Fm"}
- }
- local counter = 0
- local currentSound = false
- setRadioChannel(0)
- addEventHandler( "onClientKey", root, function(button,press)
- if button == "mouse_wheel_up" or button == "mouse_wheel_down" then
- if isPedInVehicle(localPlayer) then
- changeRadioStation(button)
- end
- end
- end)
- function changeRadioStation(action)
- if action == "mouse_wheel_up" then
- counter = counter + 1
- if counter > #radios then
- counter = 0
- end
- else
- counter = counter - 1
- if counter < 0 then
- counter = #radios
- end
- end
- setRadioStation()
- end
- function setRadioStation()
- if isElement(currentSound) then stopSound(currentSound) end
- if counter <= 12 then
- outputChatBox(counter)
- setRadioChannel(radios[counter].value)
- end
- if counter >= 13 then
- currentSound = playSound(radios[counter].url, true)
- end
- end
- addEventHandler("onClientPlayerRadioSwitch", localPlayer, function()
- if counter >= 13 then cancelEvent() end
- end)
- addEventHandler("onClientPlayerVehicleEnter", localPlayer, function()
- setRadioStation()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement