Impound Job Items

•3 min read

View Impound Job Script in the WXMAPS store

Items

The script uses two ox_inventory items. One is usable (its client.export opens the cone placer). The other is taken and returned by the script itself. Both item names are set in config.lua.

Item reference

ItemConfig keyUsableRole
traffic_coneConfig.Cones.itemYes (export)Opens the cone placer. One item is taken per cone put down and given back when it is picked up.
wheel_chockConfig.Chocks.itemNoChocks a wheel of a car on the flatbed deck. One item is taken per wheel through the target on that wheel, and given back when the chock is picked up.

The cone is its own item, traffic_cone, and not the cone item the Driving School Job uses. The two scripts can run side by side without fighting over one item.

ox_inventory

Add these to ox_inventory/data/items.lua. Labels and weights are examples, so tune them to taste. The cone must carry consume = 0 and the client.export, or using it does nothing:

['traffic_cone'] = { label = 'Traffic Cone', weight = 1000, stack = true, close = true,
    consume = 0, client = { export = 'vs-impoundjob.cone', image = 'cone.png' } },
['wheel_chock'] = { label = 'Wheel Chock', weight = 2000, stack = true },

consume = 0 is required on the cone. The script removes one cone per cone placed. If ox_inventory also consumes the item on use, the player loses a cone for opening the placer.

Item images

Give each item an image in ox_inventory/web/images/ so it does not render as a blank box. The boss terminal's Stock page draws its pictures from the same folder (Config.Stock.image). It shows the cone as cone.png, because Config.Stock lists it with icon = 'cone'. Either:

  • keep image = 'cone.png' on the item as above, or
  • remove the icon field from that Config.Stock row and add a traffic_cone.png.

Who can place cones

By default, a player can put cones down if they are:

  • staff at any lot that has a framework job;
  • a Public Job driver on a shift;
  • an admin.

Set Config.Cones.anyone = true to let every player place them. Everybody sees every cone.

ControlIn the cone placer
Left clickPut a cone down
Right clickStop placing (or cancel a row being laid)
RSwitch between single cones and a row (a row needs at least 2 cones carried)
Mouse wheelTurn the cone 15° (45° holding Shift). In row mode, sets how many cones the row has (2 to 20, up to what you carry)
EscStop placing. Getting in a vehicle or dying also stops it

To pick a cone back up, aim at it and choose Pick up the cone. The player who placed it can always pick it up. Once they have left the server, anyone can.

Wheel chocks

Chocks are only used on the flatbed3 deck. Each wheel of a car standing on the deck gets a Place wheel chock target, which takes one wheel_chock from your inventory. Every wheel must be chocked before the car can be secured. Pick up wheel chock gives it back. If the resource restarts, any chocks still placed are returned to whoever placed them. The full loading sequence is on the Towing page.

Stocking a yard

At a player-run lot both items are stock. The boss buys them on the boss terminal's Stock page, paid from the lot account, and they are delivered straight into the lot's store room for staff to take. The defaults are $25 a cone and $60 a chock (Config.Stock). See Running a yard.