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.To test it, give yourself one as an admin:
- RSG
- VORP
Open Then copy
resources/[framework]/rsg-core/shared/items.lua and paste this line inside the list of items: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./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.To test it:
- RSG
- VORP
Open Then copy
resources/[framework]/rsg-core/shared/items.lua and paste this line inside the list of items: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./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 To test it:
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.- RSG
- VORP
Open Only if you set Then copy the pictures from
resources/[framework]/rsg-core/shared/items.lua and paste this line inside the list of items:Config.JerryCan.Metadata = false, paste these two lines instead: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./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 inconfig/config.lua (prices, garages, keys…) needs a restart to show up.
Updating
Replace the folders with the new version. Yourconfig/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.
