For the complete documentation index, see llms.txt. This page is also available as Markdown.

Test Drives

Let a buyer try the vehicle before they commit. The car spawns at a fixed safe location, runs for a configurable time, and disappears at the end — teleporting the player back to where they started.

How a player starts one

1

Open the listing in the tablet

Go to Market → click the vehicle you want to test.

2

Click "Test drive"

If Config.TestDrive.Enabled = false or the auction has ended, the button is hidden.

3

Pay the fee (if any)

Config.TestDrive.price is deducted from the player's bank.

4

Drive

The player is teleported into a fresh copy of the vehicle at Config.TestDrive.coords. The timer starts:

  • Default Config.TestDrive.secondslimit = 20 seconds.

  • Press Config.TestDrive.cancelKey (default X, code 73) to end early.

5

Auto-return

When the timer hits zero (or the player cancels), the test vehicle is deleted and the player is teleported back to their original position.

Per-zone configuration

Override the global test-drive settings for a specific zone by adding testDrive to the zone:

shared/config.lua
{
    id = "zone3",
    -- ... other zone fields ...
    testDrive = {
        coords = vec3(1180, 2640, 37.8),
        heading = 90.0,
        secondslimit = 60,
        price = 1000,
        cancelKey = 73,
    },
},

Edge cases

Situation
Behavior

Player disconnects mid-test

Vehicle entity is auto-cleaned by FiveM; player is teleported back on reconnect (best effort)

Resource is restarted mid-test

abortMarketTestDriveOnStop kicks in: vehicle deleted, player teleported back

Player tries to start a second test

test_drive_busy notification, ignored

Auction listing, auction ended

test_drive_auction_ended notification, ignored

Vehicle has no resolvable model

test_drive_no_model notification, no spawn

Last updated