Skip to Content
Resourcesqb-newsjob Reference

qb-newsjob

qb-newsjob equips the reporter job. It provides a newsroom, a liveried van, and three pieces of equipment: a camera, a handheld microphone, and a boom microphone. Using an item toggles the corresponding client-side view or prop.

It grants no money and holds no persistent state. Reporter income is expected to come from your own roleplay economy rather than from this resource.

The manifest at the commit linked above declares version 1.5.0.

Dependencies and start order

The manifest declares no dependencies and loads config.lua, @qb-core/shared/locale.lua, and locales as shared scripts, then client/main.lua, client/spawner.lua, client/camera.lua, and server/main.lua.

The implementation requires more than the manifest admits:

ResourceUsed forConsequence if missing
qb-coreCore object, commands, usable itemsResource does not load
qb-vehiclekeysexports['qb-vehiclekeys']:HasKeys(src, plate)Trunk stocking always refuses
qb-inventoryCreateInventory, AddItemTrunk stocking fails
qb-menuexports['qb-menu']:openMenu in the spawnerVehicle menu does not open
LegacyFuelexports['LegacyFuel']:SetFuel in the spawnerClient error on vehicle spawn

LegacyFuel is the one to watch. If you run qb-fuel or another fuel resource instead, edit client/spawner.lua before starting this resource.

Start order: qb-core, qb-inventory, qb-vehiclekeys, qb-menu, your fuel resource, then qb-newsjob.

Configuration

KeyDefaultMeaning
Config.UseableItemstruetrue registers the equipment as usable items. false registers /newscam, /newsmic, and /newsbmic chat commands instead
Config.Locationstablemain, inside, outside, and the vehicle spawn with its liveried rumpo
Config.VehicleItemsthree entriesItems placed into a spawned van’s trunk, keyed by inventory slot

Config.VehicleItems at this commit places newscam, newsmic, and newsbmic into slots 1, 2, and 3. All three must exist in your shared items list.

Item and command surface

Both modes carry the same job check. The handler resolves the player from source and requires PlayerData.job.name == 'reporter' before firing the client event.

Item or commandClient event triggered
newscamCam:ToggleCam
newsmicMic:ToggleMic
newsbmicMic:ToggleBMic

The Cam: and Mic: event names are not namespaced to this resource. Check for collisions before adding another camera or microphone script.

Trunk stocking

RegisterNetEvent('qb-newsjob:server:addVehicleItems', function(plate)

The one server event. It requires the caller to hold the reporter job and to hold keys for the supplied plate through exports['qb-vehiclekeys']:HasKeys(src, plate), then creates a trunk-<plate> inventory and fills it from Config.VehicleItems.

The key check is what stops a client from stocking an arbitrary plate, so it is load bearing. It also means the whole feature silently does nothing on a server that does not run qb-vehiclekeys.

Nothing prevents the same plate from being stocked repeatedly. Each call rewrites the configured slots, so a reporter can refill a van by re-triggering the flow rather than by finding new equipment.

Integration example

Reacting to a reporter going live from your own client resource:

-- client side AddEventHandler('Cam:ToggleCam', function() -- your own broadcast state, overlay, or voice channel switch end)

Troubleshooting

SymptomLikely cause
Items do nothingThe player’s job is not exactly reporter
Items are not usable in the inventoryConfig.UseableItems is false, so the commands are registered instead
Trunk is empty after spawning the vanqb-vehiclekeys is not started, or the player does not hold keys for that plate
Client error on van spawnLegacyFuel is not installed. Edit client/spawner.lua
Vehicle menu never opensqb-menu is not started
Item names missingnewscam, newsmic, or newsbmic is absent from your shared items

Proposed manual smoke test

Not yet executed. On staging:

  1. Confirm the three items exist in your shared items list.
  2. Take the reporter job, spawn the van, and confirm the trunk is stocked.
  3. Use each item and confirm the matching client toggle.
  4. Attempt the same without the job and confirm nothing happens.
  5. Set Config.UseableItems = false, restart, and confirm the three commands work instead.

Sources