DirkScripts
Docs
Client
#lib.vehicle.addKeys
Give the player keys to a vehicle.
lualib.vehicle.addKeys(veh, plate)
| Parameter | Type | Required | Description |
|---|---|---|---|
| veh | number | yes | Vehicle entity handle |
| plate | string | yes | Vehicle plate string |
#lib.vehicle.removeKeys
Remove the player's keys for a vehicle.
lualib.vehicle.removeKeys(veh, plate)
| Parameter | Type | Required | Description |
|---|---|---|---|
| veh | number | yes | Vehicle entity handle |
| plate | string | yes | Vehicle plate string |
#lib.vehicle.setFuel
Set a vehicle's fuel level.
lualib.vehicle.setFuel(veh, val, _type)
| Parameter | Type | Required | Description |
|---|---|---|---|
| veh | number | yes | Vehicle entity handle |
| val | number | yes | Fuel level |
| _type | any | no | Fuel type (resource-specific) |
#lib.vehicle.getFuel
Get a vehicle's current fuel level.
lualocal fuel = lib.vehicle.getFuel(veh)
#lib.vehicle.getClass
Get a vehicle's class ID and human-readable class name.
lualocal classId, className = lib.vehicle.getClass(veh) -- e.g. 7, "Super"
#Vehicle Classes
| ID | Class |
|---|---|
| 0 | Compacts |
| 1 | Sedans |
| 2 | SUVs |
| 3 | Coupes |
| 4 | Muscle |
| 5 | Sports Classics |
| 6 | Sports |
| 7 | Super |
| 8 | Motorcycles |
| 9 | Off-road |
| 10 | Industrial |
| 11 | Utility |
| 12 | Vans |
| 13 | Cycles |
| 14 | Boats |
| 15 | Helicopters |
| 16 | Planes |
| 17 | Service |
| 18 | Emergency |
| 19 | Military |
| 20 | Commercial |
| 21 | Trains |
