Skip to main content
All exports below are client-side and are called on the resource name roadcarradio.
Renamed in 2.5.0. The old roadcarplay exports (blockCarPlay, unblockCarPlay) no longer exist. See the migration table if you are updating an existing integration.

Access Control

Use these when another script needs the screen out of the way — during a cutscene, in a jail cell, while a minigame is running.

isBlocked

Check whether the screen is currently blocked.
boolean
true if the screen is blocked, false otherwise

blockCarRadio

Prevent the screen from being opened. If it is already open, it stays open until the player closes it — this blocks opening, it does not force a close.

unblockCarRadio

Lift the block and allow the screen to be opened again.
A block set by your script is not cleared automatically. If your script errors out between blocking and unblocking, the player is left without a radio until the resource restarts — always unblock in the same code path that blocks, including your failure paths.

useRoadCarRadio

Whether the player may currently use the radio at all — takes the install status, the driver-only rule and the vehicle damage threshold into account.
boolean
true if the player can open the screen right now

Rear Camera

IsRearCameraActive

Whether the rear camera is on screen right now. Useful if your own script draws to the screen and should get out of the way.
boolean
true while the rear camera is rendering

ToggleRearCamera

Turn the rear camera on or off, exactly as the keybind does. Respects every rule the keybind respects — driver only, allowed vehicle types, and needCarRadioInstalled.
boolean
true if the camera is on after the call, false if it was refused or turned off
Returns false when the camera could not open — for example on a vehicle type that is not in Config.RearCamera.vehicleTypes, or when the player is not the driver. Check the return value instead of assuming it worked.

Server API

getCarsCarRadioIsInstalled

Server-side. Returns every licence plate that has a radio installed, straight from the in-memory cache — no database round trip.
table
Array of { plate = string } entries
Only meaningful with Config.NeedInstall = true. With the install system switched off, no vehicle is ever written to the table and the list stays empty — every vehicle has a radio in that mode.

Vehicle Controls

The Actions app checks every request on the server: the vehicle and seat come from the player’s ped, never from the message, and the rights come from Config.VehicleControl. The three files below are escrow_ignore, so you can adapt them to your server.

VehicleLock (server)

server/serverAPI/vehiclelock.lua decides how a lock request reaches your key script. The first script in VehicleLock.SYSTEMS that is started is used; scripts without an entry in SETTERS use the game’s own lock.
server/serverAPI/vehiclelock.lua
A setter that throws falls back to the game’s own lock and prints the error to the server console, so a renamed export never leaves the car unlockable. A setter set to 'client' is called on the requesting player’s client instead (see roadcarradio:client:vehicle:lock in client/clientAPI.lua).

CarRadioIsLocked (client)

client/clientAPI.lua. The lock state the Actions app shows. If your key script keeps its own state (a state bag, an export), read it here as well.
number
required
Vehicle entity handle
boolean
true if the vehicle is locked

CarRadioCanSwitchSeat (server)

server/serverAPI/vehicleseats.lua. Called before a player switches seats, after the built-in checks (seat free, only the front passenger slides to the wheel, nobody climbs from the back to the front, speed limit for the driver). Return false to refuse.
number
required
Server id of the player
number
required
Vehicle entity handle
number
required
Current seat, GTA numbering: -1 driver, 0 front passenger, 1 and up the rear
number
required
Requested seat
server/serverAPI/vehicleseats.lua
Changed in 2.6.0. lockDoors() no longer exists in client/clientAPI.lua. Move a key script you added there into VehicleLock above.

Commands

Commands and keybinds the resource registers

Custom Music API

Serve your own music library over HTTP