Skip to main content

What you need

  • A RedM server with RSG Core or VORP Core.
  • oxmysql (the database connection both frameworks already use).
  • At least one RCO vehicle to sell, for example the Wanderer bicycle.

Step by step

1

Copy the folders

Put the rco-vehicles folder and the folder of each vehicle (for example rco-wanderer) inside your server’s resources folder.
2

Add them to server.cfg

Start them after your database and your framework:
Start your vehicles first, then RCO Vehicles. (If they end up in another order it still works: the shop notices vehicles starting at any time. What matters is that every vehicle has its own line, because a vehicle that is not running doesn’t show up in the dealers.)
3

Add the repair kit item

The repair kit is an inventory item, so your framework has to know it. Do this once.
Open resources/[framework]/rsg-core/shared/items.lua and paste this line inside the list of items:
Then copy rco-vehicles/inventory/images/vehicle_repair_kit.png into rsg-inventory/html/images/ and restart the server.
If you change Config.Repair.Item, use the same name in the item line (RSG) or in the SQL (VORP), and give the picture that name too.
To test it, give yourself one as an admin: /giveitem [your id] vehicle_repair_kit 1 on RSG, /addItems [your id] vehicle_repair_kit 1 on VORP.
4

Add the chamois cloth item

The chamois cloth cleans a vehicle, so it is an inventory item too. Do this once.
Open resources/[framework]/rsg-core/shared/items.lua and paste this line inside the list of items:
Then copy rco-vehicles/inventory/images/vehicle_cloth.png into rsg-inventory/html/images/ and restart the server.
If you change Config.Clean.Item, use the same name in the item line (RSG) and give the picture that name too.
To test it: /giveitem [your id] vehicle_cloth 1 on RSG, /addItems [your id] vehicle_cloth 1 on VORP.
5

Add the jerry can item

The jerry can carries fuel to a vehicle that ran dry far from a pump. With Config.JerryCan.Metadata = true (the default) it is one item, jerrycan, that keeps its litres in the item’s metadata. With false it is two items, jerrycan_empty and jerrycan_full.
Open resources/[framework]/rsg-core/shared/items.lua and paste this line inside the list of items:
Only if you set Config.JerryCan.Metadata = false, paste these two lines instead:
Then copy the pictures from rco-vehicles/inventory/images/ (jerrycan.png, or jerrycan_empty.png and jerrycan_full.png) into rsg-inventory/html/images/ and restart the server. Keep unique = true on jerrycan: each can keeps its own litres.
If you change the item names in Config.JerryCan, use the same names in the item lines (RSG) and give the pictures those names too.
To test it: /giveitem [your id] jerrycan 1 on RSG, /addItems [your id] jerrycan 1 on VORP. A new can is empty: fill it at a pump first.
6

Start the server

The database table (rco_vehicles) is created by itself on the first start. You don’t need to import anything.
Only if your database user is not allowed to create tables: import sql/rco_vehicles.sql by hand once.
7

Test it

Go to the Saint Denis dealer, walk up to the clerk and press J. Buy a vehicle, ride it to a garage and press R to put it away. Then press J at the garage and take it out again.

Changing things later

Every change in config/config.lua (prices, garages, keys…) needs a restart to show up.
Close your game before restarting a vehicle resource, or restart the whole server. Restarting a resource that has 3D models while you are in the game can crash your game.

Updating

Replace the folders with the new version. Your config/config.lua is yours: keep a copy before replacing and put your values back if the new version brings a new config. Players’ vehicles are kept in the database and are not touched by an update. When a new version is out, the server console tells you when the server starts, for example [RCO Vehicles] Update available: v0.1.63 -> v0.1.64. It only reads our public version list: if it can’t reach it, RCO Vehicles starts normally.