Bablo ResourcesDocs

Stock Runs

On a stock run, a member of staff drives a truck from the dealership to a depot, hooks up a trailer loaded with the vehicles the dealership ordered, and brings it back. The vehicles join the stock when the trailer is parked in the unloading bay.

A stock run needs the deliver permission and starts on the Incoming tab of the Management Panel. Stock runs exist only at player-owned car dealerships. Boat and aircraft dealerships never use them: their orders arrive by themselves.


What a dealership needs

RequirementWhere it is set
A player-owned dealership that sells carsDealership Creator
Stock deliveries set to Stock runDealership Creator
A Delivery trucks spawn point with room for a truck and trailerDealership Creator. The first point is used: the truck appears there and it is the unloading bay.
At least one depotConfig.Delivery.Depots, see Depots

While the spawn point or the depots are missing, orders arrive by themselves after a wait instead. See How orders arrive.


Starting a run

  1. Open the Incoming tab and click Collect stock. The button is greyed out while nothing waits at the depot.
  2. On the Load step, switch on the orders you want to bring back and set how many vehicles of each. The Trailer load bar shows how much space is used.
  3. Click Plan route. A depot is picked at random and the Route step shows the Depot, the number of Vehicles, the Estimated distance and the Estimated time.
  4. Click Collect stock. The panel closes and the run starts.

A planned route stays valid for five minutes. You can be on one stock run at a time, and you do not have to take a whole order: what you leave stays At the depot. Vehicles on one driver’s run cannot be collected by another driver.

Trailer space

The car trailer has 6 slots per trip.

SizeSlotsCategories by default
Small1Everything not listed below
Medium1.5suvs, offroad, vans
Large2industrial, commercial, utility, service, military

That is six small vehicles, four medium ones or three large ones, or a mix. The sizes come from Config.Delivery.Sizes, by category or by spawn name. A spawn name wins over its category. An order keeps the size it had when it was placed, and each order shows it as S, M or L.


The drive

A tracker titled Stock run shows the five steps, the distance to the next point and any warning. A GPS route leads you to each point.

StepWhat happens
Get in the truckThe truck appears in the dealership’s unloading bay when you are within 120 metres of it, and you get its keys. Sit in the driver’s seat.
Drive to the depotFollow the route to the depot. The trailer appears there, loaded with your vehicles, when you are within 120 metres.
Back up under the trailerReverse the truck under the front of the trailer. It hooks up by itself once the coupling is within 3.5 metres, you are driving slowly and the truck is roughly in line with the trailer.
Drive back to the dealershipFollow the route back to the unloading bay.
Park inside the unloading bayPark the truck and the trailer inside the outline, see Parking in the unloading bay.

The vehicles on the trailer are locked and cannot be driven or damaged. If the trailer comes loose on the way, the tracker says Trailer detached. Reverse under it to hook it up again.

NPC cars standing where the truck appears, where the trailer appears or inside the unloading bay are removed, so the rig always has room. A vehicle that a player has driven or sits in is never removed.


Parking in the unloading bay

When the rig comes within 90 metres of the unloading bay, an outline is drawn on the ground there. It is sized to fit your truck and trailer.

  • The arrows inside the outline point the way you drive in. They turn round to match the side you come from.
  • Drive in until every corner of the truck and the trailer is inside the outline. The rig may stick out by Config.StockRun.BayTolerance metres.
  • The outline turns green when the rig is inside, the trailer is hooked up and you sit in the driver’s seat.
  • Stop. After about a second and a half the delivery is confirmed with Stock delivered. 4 vehicles were added to the dealership. The truck and the trailer are removed.

If you stop next to the bay but not inside it, the tracker says Line the truck and the trailer up inside the outline. If the server cannot confirm the delivery, you get The delivery could not be confirmed. Pull forward and park again. After three failed tries the run is cancelled.

If the outline cannot be drawn, a round marker shows the bay instead, and stopping within Config.StockRun.BayRadius metres of it counts as parked.


What cancels a run

CauseWhat the driver sees
The driver types /cancelrun, the command in Config.StockRun.CancelCommandYou cancelled the stock run. The vehicles are back at the depot.
The driver is out of the driver’s seat for longer than Config.StockRun.LeaveSecondsFirst the warning Get back in the truck. The stock run is cancelled in 60 s., then You left the truck for too long. The stock run was cancelled.
The truck is destroyed or its engine diesThe truck was wrecked. The stock run was cancelled.
The trailer is destroyed or removedThe trailer was lost. The stock run was cancelled.
The run takes longer than Config.Delivery.MaxMinutesThe stock run took too long. The vehicles are back at the depot.
The driver diesThe stock run was cancelled.
The dealership is disabled or deletedThe dealership closed. The stock run was cancelled.
The truck or the trailer cannot be spawnedThe truck or the trailer could not be brought out. The stock run was cancelled.
The driver leaves the serverNothing. The run ends.

The countdown for leaving the truck only runs after you first sat in it. It starts each time you get out and resets when you are back behind the wheel.

A cancelled run costs nothing. The truck, the trailer and its load are removed, and the vehicles go back to At the depot so they can be collected again. The same happens to every running stock run when the script or the server restarts.


Depots

LUA
Config.Delivery = {
    Truck = 'packer',
    Trailer = 'tr2',
    MaxMinutes = 60,
    Sizes = { suvs = 'medium', offroad = 'medium', vans = 'medium', industrial = 'large', commercial = 'large', utility = 'large', service = 'large', military = 'large' },
    Depots = {
        { label = 'Port of Los Santos',    coords = vector4(141.12, -3204.31, 5.85, 267.5) },
        { label = 'Sandy Shores Airfield', coords = vector4(1742.83, 3266.83, 41.24, 102.64) },
    },
}
KeyDefaultMeaning
TruckpackerThe truck that waits at the dealership.
Trailertr2The car trailer that waits at the depot.
MaxMinutes60Minutes before a run is called off. Between 5 and 720.
SizesSee aboveTrailer space by category or spawn name: medium or large. Everything else is small.
DepotsTwo depotsWhere trailers wait. label is the name shown in the panel and on the map. coords is a vector4: position and heading.

Each run uses one depot. coords is the point the truck drives to. The trailer stands 12 metres behind that point and faces the heading, so keep the ground clear from the trailer to a little past the point. A vector3 works too and uses heading 0. See also Configuration.


Driver settings

LUA
Config.StockRun = { CancelCommand = 'cancelrun', BayRadius = 12.0, LeaveSeconds = 90, BayTolerance = 1.6 }
KeyDefaultMeaning
CancelCommandcancelrunThe command a driver types to give up, see Commands. The tracker lists it as Give up the run. Set it to false for no command.
BayRadius12.0Metres from the unloading bay that count as parked when the outline cannot be drawn. At least 4.
LeaveSeconds90Seconds the driver may be out of the truck. At least 10.
BayTolerance1.6Metres the rig may stick out of the outline. Between 0 and 5.

See also Configuration.