For Developers (exports/events)

1. Open the vehicle menu

This is an export to open the menu from any other script, for example you can use this to implement the vehicle menu into your policejob menu as an additional option.

exports['loki_tax']:openMenu(playerID)

This can be used client AND server sided. On client side the playerID does not have to be included, on server side it does.

2. Get Vehicle Price

With this export, you can get the price of a vehicle. This export is server sided. It returns the price as an integer, or nil if the price could not be found. You need to provide the hash of the vehicle model.

local model = "sultan"
local hash = GetHashKey(model) -- converts model name to hash
local price --[[ int ]] = exports['loki_tax']:getVehiclePrice(hash)

3. Title Vehicle

This export is used to get a title for the vehicle. In other terms, this inserts the vehicle into the registered_vehicles table for later registration. This has to be done FIRST before a vehicle can be registered. This is also needed to check a vehicle.

local plate = 'ABC 123'
exports['loki_tax']:titleVehicle(plate)

4. Register Vehicle

Used to set the vehicle status to registered. The vehicle has to be in the registered_vehicles table first. To achieve that, use 3. Title Vehicle.

local plate = 'ABC 123'
exports['loki_tax']:registerVehicle(plate)

5. Unregister Vehicle

The opposite of 4. Register Vehicle. This sets the vehicle status to be unregistered.

local plate = 'ABC 123'
exports['loki_tax']:unregisterVehicle(plate)

6. Check Vehicle

This export is used to get the registration data of a vehicle. Equivalent to a player using the menu action to check a vehicle.

local plate = 'ABC 123'
local exists, registered, owner, firstname, lastname = exports['loki_tax']:checkVehicle(plate)
--[[
exists         -- bool      true if vehicle exists in registered_vehicles (has title)
registered     -- bool      true if vehicle is registered
owner          -- string    owner identifier/citizenid
firstname      -- string    owners firstname
lastname       -- string    owners lastname
]]

7. Update Vehicle Owner

Export used to update the owner of a vehicle in the registered_vehicles table. The owner in there is relevant because it decides who pays the bill and whos name shows up when checking the vehicle.

local plate = 'ABC 123'
local identifier = 'XXX' -- usually citizenid on QB and license on ESX
exports['loki_tax']:updateVehicle(plate, identifier)

8. Important Note

Please only use these exports if you know what you are doing. While the actions for the player always feature foolproof checks with feedback, these exports do not. For example you should check yourself if the plate is valid before registering a vehicle with it. If you have any questions, please open a Ticket on our discord.

Last updated

Was this helpful?