Controls & Behaviour
When the strip is available
The client checks every frame (every 250 ms while not in a vehicle) whether the player:
- is in a vehicle (
IsPedInAnyVehicle), - that has a radio (
DoesPlayerVehHaveRadio), - and sits in the driver's seat or the front passenger seat.
Only then are the controls handled. The strip is hidden in the pause menu.
Station list
Each time the player gets into a qualifying vehicle the list is rebuilt from GetNumUnlockedRadioStations and GetRadioStationName(i). Display names come from GetLabelText; a station without a label shows its internal name. A final entry with index 255 represents "off" and uses Config.OffLabel. The list is sent to the NUI only when its contents changed, so DLC stations and custom server stations appear automatically.
Each station looks for html/stations/station_<INTERNAL_NAME>.png. If the file does not exist the tile shows station__unknown.png.
Controls with Config.TakeOverControls = true
| Input | Effect |
|---|---|
Hold the radio wheel key (Q, control 85) | Shows the strip. The native wheel is suppressed with DisableControlAction every frame in a vehicle |
| Mouse wheel down (cursor scroll down, control 242) or → (control 175) while holding | Next station |
| Mouse wheel up (cursor scroll up, control 241) or ← (control 174) while holding | Previous station |
| Scroll past the last tile | Wraps to the first, and the other way round |
| Release the key | The strip stays for Config.ShowTime, then hides |
While the key is held, controls 81, 82, 14, 15, 16, 17, 241 and 242 (every mapping of the mouse wheel) are disabled so the game cannot switch stations or weapons on its own at the same time. The selection is tracked locally as a cursor that starts at the current station when the key is pressed; it does not wait for the game's station index, which lags behind while retuning.
Tuning uses three natives so the vehicle and the player agree:
- a station:
SetVehicleRadioEnabled(vehicle, true),SetVehRadioStation(vehicle, name),SetRadioToStationName(name); - off:
SetRadioToStationName('OFF')andSetVehRadioStation(vehicle, 'OFF').
The game maps the wheel to INPUT_VEH_NEXT_RADIO / INPUT_VEH_PREV_RADIO (81 / 82) only while the vehicle radio is on. After choosing OFF those inputs stop firing, so a resource that relied on them could never switch the radio back on. Reading INPUT_CURSOR_SCROLL_UP / DOWN (241 / 242) works in both states. For the same reason the resource never calls SetUserRadioControlEnabled(false); it calls SetUserRadioControlEnabled(true) once at start to repair the state left behind by scripts that did.
Controls with Config.TakeOverControls = false
Nothing is disabled. The game's own wheel and wheel-scroll switching stay active; the strip is shown while the key is held (read with IsControlPressed) and for Config.ShowTime after every station change detected through GetPlayerRadioStationIndex.
Layout
One unit is 1/1080 of the screen height.
| Element | Size |
|---|---|
| Tile | 90 u square, 3 u frame in #3b3f42, 85% opacity |
| Current tile | 116 u, 6 u frame, full opacity |
| Gap between tiles | 35 u |
| Viewport | Five tiles wide, edges faded with a gradient mask |
| Line under the strip | 260 × 1 u at 35% white |
| Name | Montserrat SemiBold 22 u, #c6cacd, uppercase, 0.08 em letter spacing |
The track slides with a 0.22 s ease so the chosen tile lands in the centre; tile size changes animate with the same timing. The offset is recomputed from the rendered gap size, so it stays exact at every resolution and on window resize.