Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions client/exporthandler.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local function exportHandler(exportName, func)
AddEventHandler(('__cfx_export_LegacyFuel_%s'):format(exportName), function(setCB)
setCB(func)
end)
end

exportHandler('GetFuel', function(vehicle)
return GetFuel(vehicle)
end)

exportHandler('SetFuel', function(vehicle, fuel)
SetFuel(vehicle, fuel)
end)
5 changes: 4 additions & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ client_scripts {
'client/fuel_cl.lua',
'client/electric_cl.lua',
'client/station_cl.lua',
'client/utils.lua'
'client/utils.lua',
'client/exporthandler.lua',
}

server_scripts {
Expand Down Expand Up @@ -53,3 +54,5 @@ data_file 'DLC_ITYP_REQUEST' 'stream/[electric_nozzle]/electric_nozzle_typ.ytyp'
data_file 'DLC_ITYP_REQUEST' 'stream/[electric_charger]/electric_charger_typ.ytyp'

provide 'cdn-syphoning' -- This is used to override cdn-syphoning(https://github.com/CodineDev/cdn-syphoning) if you have it installed. If you don't have it installed, don't worry about this. If you do, we recommend removing it and using this instead.

provide 'LegacyFuel'