Skip to main content

Custom framework

If you use a custom framework, you can modify the lb-phone/client/custom/frameworks/standalone.lua and lb-phone/server/custom/frameworks/standalone.lua files to make it work with your framework. Most function names are self explanatory, but some need further explanation.

Server

GetPlayerVehicles

GetPlayerVehicles is a function used to get all vehicles that a player owns. It takes two argument, the first being the players source and the second being a callback function. You are supposed to callback an array of vehicle data. This is the vehicle data you need to send:

{
plate = "ABC 123", -- the vehicle plate
type = "car", -- the vehicle type
location = "out", -- the location of the vehicle, set to out if the vehicle is not in a garage. Otherwise we recommend setting it to the garage name, or impounded
statistics = { -- this is optional
engine = 50, -- the vehicle engine health, 0-100
body = 50, -- the vehicle body health, 0-100
fuel = 50, -- the vehicle fuel, 0-100
}
}

GetVehicle

GetVehicle is a function used to get more information for a specific vehicle by its plate. It takes three arguments: source, cb and plate. The data you callback is up to you, as it is only used from the client side CreateFrameworkVehicle function.

Client

CreateFrameworkVehicle

CreateFrameworkVehicle is a function used to create a vehicle on the client side. It takes two arguments: data and location. The data is the same as the data you send in the GetVehicle function. Location is a vector3 position where the vehicle should be spawned. You will need to implement this function yourself in lb-phone/client/custom/frameworks/standalone.lua, and you need to return the spawned vehicle.