Skip to content

QB-Core firendly #113

@ClaudiuStelian

Description

@ClaudiuStelian

Can you update the code so it can be QB-Core friendly?

LegacyFuel\source\fuel_client.lua ->

if Config.UseESX then
	ESX = exports['es_extended']:getSharedObject()
end

LegacyFuel\source\fuel_server.lua ->

if Config.UseESX then
	local ESX = nil

	TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

	RegisterServerEvent('fuel:pay')
	AddEventHandler('fuel:pay', function(price)
		local xPlayer = ESX.GetPlayerFromId(source)
		local amount = ESX.Math.Round(price)

		if price > 0 then
			xPlayer.removeMoney(amount)
		end
	end)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions