We offer a selection of exports to enhance your resource functionality, with ongoing expansion plans to accommodate even more features based on your valuable input. Feel free to share your suggestions with us.
General Exports
SERVER-SIDED
When called, returns a 17 character string VIN. Ensures it doesn't exist already in database.
local vin = exports['realisticVehicleSystem']:vinCreator()
SERVER-SIDED
When called, returns a plate. Ensures it doesn't exist already in database.
local vin = exports['realisticVehicleSystem']:plateCreator()
CLIENT-SIDED
When called, returns the full list of properties the vehicles has.
local mods = exports['realisticVehicleSystem']:GetVehicleProperties(vehicle)
SHARED-SIDED
When called, returns the full vehicle list that has been loaded from the database.
local carList = exports['realisticVehicleSystem']:getVehicleList()
SHARED-SIDED
When called, returns the specific vehicle from the vehicle list. Requires the plate of the vehicle.
local vehicleInfo = exports['realisticVehicleSystem']:getVehicleListDataWithPlate(plate)
When called, stores the vehicle in garage, requires garage ID and plate.
Example:
local isPlayerInsideGaragePoly, polyType, garageID = exports['realisticVehicleSystem']:IsPlayerInsidePoly()
if(isPlayerInsideGaragePoly and polyType == "garage-public")then
exports['realisticVehicleSystem']:StoreVehicleInGarage(garageID, PLATE)
end
CLIENT-SIDED
When called, opens the garage UI form. Requires garage ID.
Example:
local isPlayerInsideGaragePoly, polyType, garageID = exports['realisticVehicleSystem']:IsPlayerInsidePoly()
if(isPlayerInsideGaragePoly and polyType == "garage-public")then
exports['realisticVehicleSystem']:SetupGarageForm(garageID)
end
Impound Related Exports
SHARED-SIDED
When called, returns a boolean value (true/false) if the vehicle is impounded.
Example:
local isImpounded = exports['realisticVehicleSystem']:IsVehicleImpounded(plate)
CLIENT-SIDED
When called, opens the impound UI form. Requires impound ID.
Example:
local isPlayerInsideImpoundPoly, polyType, impoundID = exports['realisticVehicleSystem']:IsPlayerInsidePoly()
if(isPlayerInsideImpoundPoly and polyType == "impound-retrieve")then
exports['realisticVehicleSystem']:SetupImpoundForm(impoundID)
end
CLIENT-SIDED
When called, opens the impound lock UI form. Requires impound lock ID.
Example:
local isPlayerInsideImpoundPoly, polyType, impoundID = exports['realisticVehicleSystem']:IsPlayerInsidePoly()
if(isPlayerInsideImpoundPoly and polyType == "impound-unlock")then
exports['realisticVehicleSystem']:SetupImpoundLockForm(impoundID)
end
Insurance Related Exports
CLIENT-SIDED
When called, opens the insurance UI form. Requires insurance ID.
Example:
local isPlayerInsideInsurancePoly, polyType, insuranceID = exports['realisticVehicleSystem']:IsPlayerInsidePoly()
if(isPlayerInsideInsurancePoly and polyType == "insurance")then
exports['realisticVehicleSystem']:SetupInsuranceLockForm(insuranceID)
end
Security Integration Exports
CLIENT-SIDED
When called, returns the Security.EventPrefix variable. Requires the resource calling it.
local eventPrefix = exports['realisticVehicleSystem']:GetEventPrefix(GetCurrentResourceName())
Read More Here:
CLIENT-SIDED
When called, returns the event code for the specified server event within TCVS. Requires the resource calling it and the server event name. Look at the following example:
ID of the polyzone, differentiates depending on what is the PolyZone type.
Example:
local isPlayerInsideGaragePoly, polyType, garageID = exports['realisticVehicleSystem']:IsPlayerInsidePoly()
if(isPlayerInsideGaragePoly and polyType == "garage-public")then
exports['realisticVehicleSystem']:StoreVehicleInGarage(garageID, PLATE)
end
SHARED-SIDED
When called, requires a plate, and returns an array of the vehicle specified vehicle. For better understanding rather than me explaining with words here's the code.
Example:
local vehState = exports['realisticVehicleSystem']:GetLocation(plate)
if(vehState ~= nil)then
if(vehState.state == "exploded")then
print("vehicle has been exploded, last known location: " .. json.encode(vehState.position))
elseif(vehState.state == "outside")then
print("vehicle is currently outside, location: " .. json.encode(vehState.position))
end
end