F5 StudioF5 Studio
Skip to main content

Controls & Behaviour

When the strip is available

The client checks every frame (every 250 ms while not in a vehicle) whether the player:

  1. is in a vehicle (IsPedInAnyVehicle),
  2. that has a radio (DoesPlayerVehHaveRadio),
  3. 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

InputEffect
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 holdingNext station
Mouse wheel up (cursor scroll up, control 241) or ← (control 174) while holdingPrevious station
Scroll past the last tileWraps to the first, and the other way round
Release the keyThe 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') and SetVehRadioStation(vehicle, 'OFF').
Why the mouse wheel is read through the cursor controls

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.

ElementSize
Tile90 u square, 3 u frame in #3b3f42, 85% opacity
Current tile116 u, 6 u frame, full opacity
Gap between tiles35 u
ViewportFive tiles wide, edges faded with a gradient mask
Line under the strip260 × 1 u at 35% white
NameMontserrat 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.