Exports

isFinanced()

  • You can use this export client/server side to verify if a vehicle is financed. Use it to check if a player can sell the vehicle to another player, if returns true then cancel the sell because the player still owes it, here's an example client side:

-- exports['av_dealership]:isFinanced(plates)
-- This export requires you to send the vehicle plates otherwise it will just return false
local vehicle = GetVehiclePedIsIn(PlayerPedId(),false)
if vehicle and vehicle ~= 0 then
    local plates = GetVehicleNumberPlateText(vehicle)
    local res = exports['av_dealership']:isFinanced(plates)
    if res then
        print("oops!, this vehicle owes money to the dealership!")
    else
        -- do something, the vehicle doesn't owe anything
    end
end

Hide Hud

  • Not really an export but you can use this events to hide/show your hud when entering the catalogue in a dealership.

-- hide_hud_event
-- This event is triggered when you enter the catalogue
-- Register it as event in your hud resource (client side)
RegisterNetEvent("hide_hud_event", function()
    -- Add your code to hide the hud
end)

-- display_hud_event
-- This event is triggered when you leave the catalogue
-- Register it as event in your hud resource (client side)
RegisterNetEvent("display_hud_event", function()
    -- Add your code to show the hud
end)

Last updated