Phone app

MrNewbVehicleKeysPhone: a Keys app for LB Phone.

In-development version. These docs cover the testing build of VehicleKeys. The official release is still documented on the GitBook linked in its README.
The MrNewb Vehicle Keys phone app: the key list, a vehicle with lock, start engine and unlock buttons, and the save-to-phone screens

MrNewbVehicleKeysPhone adds a Keys app to LB Phone. Players see the keys they hold and use their vehicle from the phone. It only calls MrNewbVehicleKeys exports and callbacks and does not change that resource.

Requirements

  • lb-phone, ox_lib, Newb_Bridge and MrNewbVehicleKeys, with the server artifact and OneSync
  • MrNewbVehicleKeys at keys API level 3 or newer (the GetApiVersion export). On start the phone app prints a console line when the level is too old, when lb-phone or MrNewbVehicleKeys is not running, or when its web build is missing
  • Item-based keys, only for the Scan and Eject actions

Install

Start it after ox_lib, lb-phone and MrNewbVehicleKeys:

ensure ox_lib
ensure lb-phone
ensure MrNewbVehicleKeys
ensure MrNewbVehicleKeysPhone

Restarting MrNewbVehicleKeys stops this resource too, so start it again afterwards. The app registers itself in LB Phone. There is nothing to set up in game.

What it does

ActionHow
Lock / unlockSame path as the in-world fob: animation, lights, lock sound and notification. Tries once more if the first request is refused. Works from range through the server when the car is not nearby
Trunk, hood, alarm, dance, self-park, summon, auto-pilotMatching MrNewbVehicleKeys exports. Trunk and hood only show when the car has one, and show whether it is open. Which other buttons show depends on the key type. Smart keys show their fob modules, basic keys get lock, unlock and trunk
Toggle engineStarts or stops based on the engine's real state. Hidden when ignition (insert) mode is on
LocateMarks the vehicle on the map
Scan / ejectScans a key onto the phone or takes it off

The app keeps its lock and engine state up to date while it is open. A short walkthrough shows the first time a character opens it.

Remote engine toggles share a 2 second cooldown, so a second tap inside that window is refused.

Settings

configs/config.lua is the only setting file. It holds the names of the two resources it talks to (only change them if you renamed the folders), how close a car must be to count as nearby in the app (60 m), whether keys can be scanned onto the phone, and the app's own name and description in LB Phone.

On this page