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
-
Open the listing in the tablet
Go to Market → click the vehicle you want to test. -
Click "Test drive"
IfConfig.TestDrive.Enabled = falseor the auction has ended, the button is hidden. -
Pay the fee (if any)
Config.TestDrive.priceis deducted from the player's bank. -
Drive
The player is teleported into a fresh copy of the vehicle atConfig.TestDrive.coords. The timer starts:- Default
Config.TestDrive.secondslimit=20seconds. - Press
Config.TestDrive.cancelKey(default X, code73) to end early.
- Default
-
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 |
Related pages
- Exchange Zones — A player can own an entire zone and run it like a small business: set listing fees, take commission on every sale, cap how many listings can run concurrently.
- Auctions — Time-boxed bidding with a clear winner and a buy-out finalization step.
- Overview — What players can actually do with Koja-Carmarket, from their POV.
- Parking Slots — Before a player can list a car, they need at least one parking slot in the zone they want to list in.
- Listings — The simplest flow: a player lists a vehicle from their garage at a fixed price; another player walks up to the market zone, opens the tablet, and buys it.
- Features — back to the section overview