Admin, logging and compatibility

Admin commands, the Manage tab, debugging, logging and other key scripts.

In-development version. These docs cover the testing build of VehicleKeys. The official release is still documented on the GitBook linked in its README.

Part of Configuration. Open /setupkeys to change these.

Other key scripts

General > Other key scripts: pick the script you are replacing and press Answer for it. Calls meant for it are then answered by this resource, so other scripts that ask for keys keep working without edits. Save, stop the old script, and restart this one. Keys held inside the old script are not copied.

fxmanifest.lua also has provide lines so exports['qbx_vehiclekeys']:GiveKeys(...) resolves here. qbx_vehiclekeys and kora_vehiclekeys are active. To replace a different script, uncomment its line, run refresh, and restart this resource (a full server restart is safest). Never provide a name whose original resource is still running.

Admin commands

/car and /dv are off by default. Turn them on under General > Admin & debugging (Advanced). Names are read when the resource starts. A name another resource owns is skipped with a console warning, so give ours a different name. Details: Commands.

Manage tab

Manage in the rail holds the live admin tools:

SectionWhat it does
VehiclesNearby vehicles by plate or model, with a teleport button
PlayersSee what a player holds, give or take keys
Vehicle locksAdd and edit lock profiles (item keys only)
Key creatorMake a key for any plate. With virtual keys it grants a key without an item
ParkingCreate the parking areas that self-park uses (item keys only)
SecuritySee and change a plate's alarm tier, immobiliser, GPS and police flag, or reset a keypad PIN

Debug mode

General > Admin & debugging > Debug messages (Advanced). It is off by default and applies right away, no restart. Keep it off on a live server.

With it on, the server console and F8 print plain one-line messages with names, ids and numbers, in the form [MrNewbVehicleKeys:settings] Sam (id 7) opened the setup panel. The word after the colon names the area, such as keys, locks, engine, locksmith, theft, admin or settings. The /whatsloaded, /debugkeys and /debuglistkeys commands only exist when debug was on at resource start.

Logging

Key events (grants, shares, locksmith work, admin actions) go to the console in debug mode, fire the MrNewbVehicleKeys:Log event, and post to a Discord webhook when this convar is set in server.cfg:

set mrnewbvehiclekeys_webhook "https://discord.com/api/webhooks/..."

Each log row carries who, to whom, which plate and where. Messages are queued to stay inside Discord's rate limit.

Compatibility

This resource provides for these key systems: qb-vehiclekeys, qbx_vehiclekeys, qs-vehiclekeys, wasabi_carlock, Renewed-Vehiclekeys, mk_vehiclekeys, jg-vehiclekeys, kora_vehiclekeys and tgiann-hotwire. The Other key scripts page chooses which foreign events and legacy exports answer. Garage entries switch on when that garage resource is running. provide lines in fxmanifest.lua let exports['qbx_vehiclekeys']:GiveKeys(...) resolve here. provide 'qbx_vehiclekeys' and provide 'kora_vehiclekeys' are active in the shipped manifest.

The legacy exports that answer when a system is switched on:

SystemServer exportsClient exports
qb-vehiclekeysGiveKeys, RemoveKeys, HasKeyssame
qbx_vehiclekeysGiveKeys, RemoveKeys, HasKeys, SetLockStateGiveKeys, RemoveKeys, HasKeys
qs-vehiclekeysGiveServerKeys, RemoveServerKeys, GetServerKeyGiveKeys, RemoveKeys, GetKey, GiveKeysAuto, RemoveKeysAuto, GetKeyAuto
Renewed-VehiclekeyshasKey, addKey, removeKeysame
wasabi_carlockHasKey, GiveKey, RemoveKey, GetAllKeysHasKey, GiveKey, RemoveKey, ToggleLock
mk_vehiclekeysAddKey, RemoveKey, HasKey, ChangeOwner, UpdatePlate, UsingKeyfobsAddKey, HasKey, RemoveKey, ToggleLocks, UnlockVehicle, UsingKeyfobs
tgiann-hotwireGiveKeyPlate, KeyInIgnition, SetKeyInIgnition, CheckKeyInIgnitionWhenSpawn, SetNonRemoveableIgnitionthose, plus GiveKeyVehicle, HaveKeyPlate, HaveKeyVehicle, ChangeLockStatus, ChangeEngineStateButton
kora_vehiclekeysgiveKeys, removeKeys, hasKeysnone
jg-vehiclekeysThe documented server API: giveKeys, removeKeys, hasKeys, getKeys, giveKeysToEntity, removeKeysFromEntity, hasKeysForEntity, isPlayerNearVehicle, unlockVehicle, setLockState, canParkVehicle, canCollectVehicle, vehicleParked, vehicleOwnershipChanged, vehiclePlateChanged, getVehicleSecurity, getVehicleTrackingLocation, getVehicleGhostInstallations, changeVehiclePin. Callers get the same result tables backnone

This resource's own GiveKeys, RemoveKeys and HasKeys server exports also accept the jg-vehiclekeys call shape, a plate string in place of the network id.

On this page