Petrol Can system

This step is not completely mandatory, but we will teach you how to apply metadata to the weapon_petrolcan of assets like LegacyFuel or similar so that they break when you finish filling a certain amount of gasoline in a car.


Integration as an example in LegacyFuel

The integration is very simple, we will search on the client side for the following code:

SetPedAmmo(ped, 883325847, math.floor(GetAmmoInPedWeapon(ped, 883325847) - fuelToAdd * 100))

This event will point us to the point where we should add our custom event, which will be just below it, make sure not to replace the previous event, simply use it as a guide to place the inventory event.

TriggerEvent('inventory:client:LegacyFuel', math.floor(GetAmmoInPedWeapon(ped, 883325847) - fuelToAdd * 100))

File with the integration applied

Once we know the modification that was applied, you can simply make use of the file already modified by our support, which will simply download and use without problems. This file is LegacyFuel for esx, if you want to use it in qbcore, you will have to apply some changes to it for qbcore or modify the version of your framework yourself.

Last updated