Skip to content
KS-Permanent-Vehicle

KS-Permanent-Vehicle

Installation

  1. Unzip the delivered archive into your resources/ folder, under the name ks-permanent-vehicle.
  2. Import the provided install.sql file into your database.
  3. Add ensure ks-permanent-vehicle to your server.cfg, after oxmysql and qb-core.
  4. Restart your server.

Configuration

Config.PermanentVehicles = {
  {
    model = "police3",
    coords = vec4(441.9, -981.2, 30.7, 90.0),
    respawnAfter = 300, -- secondes après destruction
    locked = true,
    accessJob = "police",
  },
}

accessJob restricts unlocking to the given job — leave it as nil for a vehicle accessible to everyone.

Forcing an immediate respawn

Useful in an admin command to reset a vehicle to its original position without waiting for the configured delay:

exports['ks-permanent-vehicle']:ForceRespawn(vehicleIndex)

vehicleIndex matches the vehicle entry’s position in Config.PermanentVehicles, starting at 1.

Common issues

The vehicle doesn’t respawn after being destroyed. Check that respawnAfter is set (a nil value disables automatic respawn) and that no other script deletes the entity before the delay expires.

Two permanent vehicles appear in the same spot after a restart. This usually means the resource is ensured twice, or the script restarted without cleaning up its entities first — check that it’s only loaded once in server.cfg.

Something not covered here? Join our Discord.