Using a Smart Vehicle

This guide will show you the simple process to use and setup a Smart Vehicle.

This guide will show you how to get setup using the vehicle. If you're at this point, you should have the resource installed already.

Controls

For a full list of controls, please see our documentation on the relevant vehicle. For the included British Ladder and Tiller Ladder truck, see the controls below:

British Ladder TruckTiller Ladder Truck

Spawning the vehicle in

Once in-game, you'll need to spawn the vehicle in, such as firetruk (for our default British firetruck).

You may want to set this up in a VehicleSpawner or even using vMenu.

Once spawned in, it will look empty. This is because our resource hasn't setup the vehicle yet.

If your vehicle involves a trailer (such as our Tiller Ladder Truck), you may need to spawn in two vehicles.

Setting up a vehicle

You must be inside the vehicle to use the /setupvehicle command.

A vehicle can be setup using /setupvehicle, this will install all the necessary moveable parts in the correct position. The player that sets up the vehicle is the only one that can control it, so it is important to remember this. However, any player can enter the cage.

Automatic Setups

Smart Vehicle supports automatic setups for models without multiple variants/setup types, meaning this can work for vehicles such as our British Ladder Truck and Tiller Ladder Truck.

Automatic Setup works by immediately setting the vehicle up as soon as you enter the drivers seat and is enabled by default. If you wish to disable automatic setup, just head to the config.lua file.

To use automatic setups on vehicles with a trailer, you'll need to be in the cab/front vehicle to use it.

Reset a vehicle

You must be inside the vehicle to use the /resetvehicle command.

The vehicle can be reset at any time using the /resetvehicle command, allowing you to set it up again (which may be with a different option - if the Smart Vehicle has multiple setups such as our Snow Loader pack).

Controlling a smart vehicle

Once a smart vehicle is setup, you can approach the vehicle and an on-screen prompt will appear, advising you which key to press in order to start controlling.

Some third party smart vehicles will have this disabled, meaning they can only be controlled from the driver seat - such as construction vehicles.

Some vehicles also have the ability to start controlling whilst inside or near the cage, such as our British Firetruck. You'll see the "Press X to control" message whilst you are near/in the cage for these models.

Controlling while driving

Smart Vehicle allows vehicle developers to configure whether you are able to control the vehicle whilst driving. If this is enabled for your vehicle, you will be able to press the control key whilst driving and then use the same keybinds as normal to make the vehicle parts move.

Please note that once you begin controlling a vehicle whilst driving you will be unable to leave the vehicle until you stop controlling (by pressing the same keybind again).

Multiple Ladders

Some vehicles have been setup to support multiple setups, meaning you can select which setup/ladder is setup on a certain vehicle. For example, you might have a base fire truck with two types of setups or ladders.

Using the /setupvehicle [type] command you can select a setup. The type argument must match the name of a Smart Vehicle vehicle file, which can be found towards the top:

    name = "FireTruck",

If your vehicle does not support multiple setups, just use /setupvehicle and it should work fine!

Our Snow Loader pack (free) supports multiple setups. See our guide on this here:

Snow Loader Pack

Entering the cage

This command was created to secure a player within the cage. It is also possible to walk up a ladder (with the right model and collisions), however once moved, this command will ensure the player does not fall out.

Once setup, any player can enter enter the cage of the vehicle (if permissions are setup, this will be restricted). This will only work if the vehicle has a cage.

/entercage - This command allows you to enter the cage of a nearby vehicle.

/exitcage - This command allows you to exit the cage of the vehicle.

Once inside the cage, you are not able to move about and you are attached to the vehicle in a fixed position. You can still use tools such as our hose and spray water down towards a fire.

After exiting the cage, you will be teleported back to the side of the vehicle and detached from it, allowing you to continue roleplay.

Moving the cage

Whilst one player is controlling the vehicle (the one that set it up), another player is able to enter the cage and can be moved about, allowing live communication of a fire from another angle.

Configuring the cage

By default, you can only use the /entercage command when at the base of a Smart Vehicle. This can be changed in the config.lua file:

cageCommand = {
    commandName = "entercage",
    exit = "exitcage",
    enterCageSuggestion = "Enter a cage",
    exitCageSuggestion = "Exit a cage",
    enterCageDistance = 20.0, -- This is the distance you can be from the vehicle to enter the cage.
    enterCageCheck = { -- Enable this so that instead of checking distance from vehicle, it checks distance from cage.
        enabled = false,
        distance = 5.0,
        spawnAtCageOnExit = true,
    },
}

The enterCageDistance is the default value, meaning you must be 20.0 metres within the vehicle in order to use the command. Some servers prefer this check to be done based on the distance from the cage. For this, enable the enterCageCheck and then set the distance.

The spawnAtCageOnExit is also enabled by default, meaning you spawn inside the cage when you use the /exitcage command.

Adding other vehicle files

Compatible Vehicles

All vehicles purchased from a third-party should come with a unique file, such as firetruk.lua with all data relating to the moveable parts and the keybinds chosen to move them.

As well as streaming the vehicle files (such as YTD, YTF) in a separate resource, you should add this vehicle data file (.lua) directly to the Smart Vehicles > vehicles folder.

Drag and drop the vehicle data file provided into the vehicles folder within the Smart Vehicles resource.

Vehicle Issues

If you've purchased a vehicle from a third party that is compatible with Smart Vehicle and you are experiencing issues with the movements of the vehicle, it is best that you reach out to the third party developer as they will be best to assist you.

Developers

If you're still looking for the part where you learn how to setup vehicles, you're in the right place. Just keep scrolling and we'll get there shortly.

Exports

Setup Vehicle (Client Sided)

exports["SmartVehicle"]:SetupSmartVehicle(vehicle, id)

This export allows you to setup a vehicle. The id argument is the setup id (if the vehicle has multiple). This can be left blank otherwise.

Reset Vehicle (Client Sided)

exports["SmartVehicle"]:ResetSmartVehicle(vehicle)

This export allows you to reset a vehicle.

IsPedControllingVehicle (Client Sided)

exports["SmartVehicle"]:IsPedControllingVehicle()

This export allows you to find out if the current ped is controlling a Smart Vehicle, returning true or false.

IsPedInCage (Client Sided)

exports["SmartVehicle"]:IsPedInCage()

This export allows you to find out if the current ped is in a Smart Vehicle cage, returning true or false.

Last updated

Was this helpful?