The GetFuel export allows you to retrieve the current fuel level of a specified vehicle. This is useful for monitoring fuel levels, implementing fuel consumption mechanics, or integrating fuel data into custom scripts.
How to Use
To obtain the fuel level of a vehicle, use the following code:
Example:
This export takes the following parameter:
vehicle
: The entity ID of the vehicle whose fuel level is to be retrieved.
The function returns the fuel level as a percentage (e.g., 50
for 50%). Use this export to integrate fuel data seamlessly into gameplay mechanics or debugging processes.
Last updated