Install the equipment from a workshop script, check it from a garage, read what a car is playing or stop all music from another resource. Every export is server-side. Vehicles are identified by plate; plates are trimmed and upper-cased before comparing. With persist.unowned = 'memory', the equipment of a car without an owner is only found by its plate while that car exists.
Server exports
IsRadioInstalled
exports.cuxial_chipeo:IsRadioInstalled(plate) --> booleanif exports.cuxial_chipeo:IsRadioInstalled(plate) then
print('This car has a sound system')
endtrue only if the car has an installed head unit (with the item or with InstallRadio). The stock radio does not count.
InstallRadio
Installs the head unit without item, progress bar or distance check.
exports.cuxial_chipeo:InstallRadio(plate, installedBy) --> boolean| Parameter | Type | Description |
|---|---|---|
plate | string | Plate of the vehicle. |
installedBy | string? | Character identifier of the installer. They can then remove it and mount pieces. |
Returns false if the plate is empty or already has a head unit. On a car without an owner with persist.unowned = 'memory', the car must exist in the world.
UninstallRadio
exports.cuxial_chipeo:UninstallRadio(plate) --> boolean ok, string? errorStops its music and removes the head unit. Fails with err_not_installed, or with err_mounts_present while the car still has pieces mounted.
GetSession
exports.cuxial_chipeo:GetSession(plate) --> table?A copy of what the car is playing, or nil. Useful fields: playing, title, url, volume, bass, distance, damaged, heat, pressure, queue, group, bucket and tier ('radio' = stock radio, 'chipeo' = sound system).
local s = exports.cuxial_chipeo:GetSession(plate)
if s and s.playing then
print(('%s is playing %s'):format(plate, s.title or s.url))
endGetMounts
exports.cuxial_chipeo:GetMounts(plate) --> table[]Copy of the pieces mounted on the car (empty if none). Each entry: uid, c (piece id from data/components.lua), b (bone), o and r (offset and rotation), open.
SetDamaged
exports.cuxial_chipeo:SetDamaged(plate, damaged) --> booleanFries (true) or repairs (false) the equipment. Returns false if the car has no head unit.
-- Repair the sound system together with the car
exports.cuxial_chipeo:SetDamaged(plate, false)MigratePlate
exports.cuxial_chipeo:MigratePlate(old, new, veh) --> boolean moved| Parameter | Type | Description |
|---|---|---|
old | string | Previous plate. |
new | string | New plate. |
veh | number? | Entity of the car, already with the new plate. If you pass it, its pieces are shown again at once. |
Moves the head unit, pieces, USB, damage and Special project from old to new, in the database and in memory, and stops the music that was playing under the old plate. Returns false if the plates are empty or equal, if old has no equipment, or if new already has its own (which is kept).
-- After changing the plate from your script
SetVehicleNumberPlateText(veh, newPlate)
exports.cuxial_chipeo:MigratePlate(oldPlate, newPlate, veh)PurgePlate
exports.cuxial_chipeo:PurgePlate(plate) --> booleanFor a deleted vehicle: stops its music and removes head unit, pieces, USB, damage and Special project from the database. Also returns true if there was nothing to delete, and false if the database fails.
VehicleSpawned
exports.cuxial_chipeo:VehicleSpawned(veh, plate)Tells Cuxial Chipeo that a garage has just spawned a player's car with its final plate: it is treated as an owned car and its pieces are published without waiting to detect it.
SetEmergency / IsEmergency
exports.cuxial_chipeo:SetEmergency(on) --> integer stopped
exports.cuxial_chipeo:IsEmergency() --> booleanSame as /chipeoemergencia: stops and blocks all music (true) or lifts it (false). Returns the number of sessions stopped.
SetPlayerBucket / GetPlayerBucket
exports.cuxial_chipeo:SetPlayerBucket(source, bucket) --> boolean
exports.cuxial_chipeo:GetPlayerBucket(source) --> integerMoves a player to a routing bucket and updates what they hear at once. The resource also detects bucket changes on its own every buckets.pollMs; call this export from your own bucket scripts to skip that wait.
Garage integration
Cuxial Chipeo listens to these server events from Cuxial Garages. With that resource nothing has to be done; with another garage script, call the exports above at the same moments.
| Event | Parameters | What it does |
|---|---|---|
cuxial_garages:server:VehicleSpawned | veh, vehicleId, plate | Same as VehicleSpawned. |
cuxial_garages:server:PlateChanged | veh, old, new | Same as MigratePlate. |
cuxial_garages:server:VehicleDeleted | vehicleId, plate | Same as PurgePlate. |
cuxial_garages:server:VehicleTransferred | vehicleId, plate, citizenid | The equipment stays on the car; whoever installed the head unit loses their rights over it and the new owner is in charge. |
-- When a car is taken out of the garage
exports.cuxial_chipeo:VehicleSpawned(veh, plate)
-- When a car is deleted for good
exports.cuxial_chipeo:PurgePlate(plate)Creator hook
fixed.creators.export lets another resource decide who can create fixed installations:
creators = {
permission = false,
jobs = {},
export = { resource = 'my_clubs', name = 'CanBuildSound' },
},exports('CanBuildSound', function(source)
return IsClubOwner(source) -- your own check, returns boolean
end)State bags (read only)
| Bag | On | Content |
|---|---|---|
chipeo | Vehicle | Current session (same shape as GetSession). |
chipeoHeat | Vehicle | { heat, max, pressure }. |
chipeoPower | Vehicle | Battery and voltage state of the electrical system. |
chipeoEmergency | GlobalState | true while the emergency is active. |
Read them, do not write them: the server owns these values and overwrites them.
Item exports
The items call client exports with the same name (cuxial_chipeo.chipeo_radio, cuxial_chipeo.usb_8, cuxial_chipeo.chipeo_medusa_l, cuxial_chipeo.chipeo_sub12…). Every piece and electrical part has one: it puts the part in the player's hands. They exist for ox_inventory and are not meant to be called from other resources.
