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.

Quasar Store has an exclusive fuel system called Fuel Stations, which you will find at an exclusive price in our official store. This asset integrates the entire system automatically and has completely impressive functions.

My fuel system is completely different than described

In this case, we recommend adapting the event as you see fit, since the event must be applied right after the system gives you a weapon_petrolcan, the event will simply integrate metadata to the item.

If your fuel system is different, contact the seller or supplier of said asset or choose to use Fuel Stations, an exclusive and incredible asset from Quasar Store, which automatically integrates this system and has unique features.


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))

It depends on the version of LegacyFuel you will have to add an event so that it gives you the item since some versions do not bring that natively, use our resource and it will be more functional and faster for you.


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