Integrations
This section is dedicated to integrations within the script. Here you’ll find connections, adapters, or bridge files that allow the system to interact seamlessly with other Quasar resources or third-party scripts. These integrations ensure better compatibility, data synchronization, and a smoother experience across your server’s ecosystem.
Car Keys
The car keys feature allows you to grant a player ownership of a vehicle's keys dynamically. This can be customized by replacing the default event with your own car key script. The configuration function is simple and can be adapted to different frameworks or scripts as needed.
How to Use
To use this feature, call the Config.Carkeys function, passing the player's source ID and the vehicle's plate number as arguments. Update the event name within the function to match the event used by your car key system.
Config.Carkeys = function(source, plate)
print("Sending Keys")
TriggerClientEvent('vehiclekeys:client:SetOwner', source, plate) -- THIS EVENT IS QBCORE CAR KEYS!, replace the event name to your carkeys event
endFuel System for Mission
The fuel system for missions ensures that vehicles used during missions consume fuel faster. This encourages players to use specific transport vehicles, such as the flatbed, for towing or transporting. The configuration supports integration with popular fuel systems like qs-fuelstations or LegacyFuel, and includes fallback mechanisms for custom setups.
How to Use
To activate this feature, enable the fuel system in the configuration and set the time for the fuel to empty. The script will handle fuel levels using supported fuel systems or your custom fuel.
Config.MissionFuel = true -- Mission vehicles lose fuel quickly to enforce transport vehicle usage
Config.TimeToEmpty = .40 -- Time (in minutes) to empty the fuel. 0.4 = 40 seconds, 1 = 1 minute
Config.SetVehicleFuel = function(vehicle, fuelLevel)
if GetResourceState('qs-fuelstations') == 'started' then
exports['qs-fuelstations']:SetFuel(vehicle, fuelLevel)
elseif GetResourceState('LegacyFuel') == 'started' then
exports["LegacyFuel"]:SetFuel(vehicle, fuelLevel)
else
ErrorPrint("Fuel System not found, please add qs-fuelstations or LegacyFuel to your resources or configure custom functions")
SetVehicleFuelLevel(vehicle, fuelLevel)
end
end
Config.GetVehicleFuel = function(vehicle)
local fuelLevel = 100
if GetResourceState('qs-fuelstations') == 'started' then
fuelLevel = exports['qs-fuelstations']:GetFuel(vehicle)
elseif GetResourceState('LegacyFuel') == 'started' then
fuelLevel = exports["LegacyFuel"]:GetFuel(vehicle)
else
fuelLevel = GetVehicleFuelLevel(vehicle)
end
return fuelLevel
end