Six seats: the driver, one passenger up front and four prisoners in the box, on two benches facing each other.Behind the van there is one prompt for the box. Each player who presses it gets the next free seat, from the cab towards the doors, and climbs in through the double rear doors. A seat that is taken is never offered.
The driver presses G to switch the siren on and G again to switch it off. It takes the horn’s key: the Enforcer has no horn. The rotor spins and the red lamp lights up, and everyone nearby hears it. The siren switches off when the driver gets out.In the Enforcer’s config/config.lua:
Your police job can put a player in the box: handcuffed, he can’t walk, so the Enforcer’s own animation takes him from behind the van to his seat. The exports run on the prisoner’s client. Your job decides on its server who may arrest whom (job, distance, handcuffs); the Enforcer trusts that check.
Export (client)
What it does
Returns
PutInBack(vehicle, held)
Puts this player in the next free prisoner seat. vehicle is the Enforcer’s entity or network id; leave it out to use the Enforcer whose rear is within 6 m. held (default true): he can’t get out on his own.
The seat (1 to 4), or false if the Enforcer is full, too far or overturned
TakeOutOfBack()
Releases this player; he gets out through the rear doors.
true if he was in a prisoner seat
IsHeldInBack()
Whether this player is held in the box.
true / false
-- officer's client: the Enforcer he choseTriggerServerEvent('myjob:server:putInEnforcer', targetId, NetworkGetNetworkIdFromEntity(enforcer))-- server (your police job): check the officer, the distance and the handcuffs, thenRegisterNetEvent('myjob:server:putInEnforcer', function(targetId, netId) TriggerClientEvent('myjob:client:putInEnforcer', targetId, netId)end)-- prisoner's clientRegisterNetEvent('myjob:client:putInEnforcer', function(netId) local seat = exports['rco-enforcer']:PutInBack(netId) -- without a network id: the Enforcer whose rear is within 6 m if not seat then -- no seat: the Enforcer is full or too far endend)RegisterNetEvent('myjob:client:takeOutOfEnforcer', function() exports['rco-enforcer']:TakeOutOfBack()end)
PutInBack stops the player’s current animation (the handcuff pose) so the climb-in plays. Put the handcuff pose back afterwards if your job uses one. The Enforcer’s lock doesn’t stop the export. A prisoner still leaves the box if he dies or the Enforcer is put away.
In the RCO Cars bundle every car lives in one resource: call exports['rco-cars']:PutInBack(...) instead.