[Release] FRFuel [v1.7.0]

where do i insert this code? Should i make a new script or just place it in a already made script?

Go discuss it in PM, please

Hi, is it possible to change the position of the hud, like if I want it left lower corner or something?: https://gyazo.com/77274d6e628fbc4549f4db3d2812498a

Nope, you only can disable it.

I’ve looked through the config files and can’t find any way to change the position of the fuel bar, and searching the forum gives no results, any help?

needs to be about 10 pixels higher

Is it possible to disable jerrycan? Because i got paid script running for fuel but for jerrycan you don’t have to pay.

Should be in the config file

Omg yeah silly me, Thanks for info. <.< should look closer thought i enable it as well long time ago.

for it to not cover the cardinal N indicator it needs to be 8 pixels higher

How would I go about making it to where the player has to exit the vehicle at the pump to pump gas?

Hello, i have been using this for ages now but recently all of my members are complaining that there are 2 fuel level but i only have one i am trying to debug this more but i thought i would post this for some more people to debug. going to try reinstalling it and see if that will work

hello i have tried adding a custom percentage level but it shows 64 and random numbers any idea on how to fix this?

code:

function ShowInfo(text)
	SetNotificationTextEntry("STRING")
	AddTextComponentString(text)
	DrawNotification(true, false)
end

function PrintText(text)
	SetTextEntry("STRING")
end

local maxclients = GetConvarInt('sv_maxclients', 32)
local discord = GetConvar('discord', "test")
local website = GetConvar('website', "test")
local vehicle = GetVehiclePedIsIn(player, false)
local fuelLevel = exports.frfuel:getCurrentFuelLevel()

local playerSource = 0
local timer = 30
Citizen.CreateThread(function(SetData)
    while true do
	local ID = GetPlayerServerId(PlayerId())
	local name = GetPlayerName(PlayerId())
		players = {}
	for i = 0, 255 do -- make it compatible with OneSync
		if NetworkIsPlayerActive( i ) then
			table.insert( players, i )
		end
	end
	Citizen.Wait(0)
DrawTxt(0.30, 0.85, 0.6,1.0,0.60,"~w~Your ID: ~r~".. ID .."~w~", 255,255,255,255)
DrawTxt(0.30, 0.89, 0.6,1.0,0.55,"~w~Your Name: ~r~".. name .."~w~", 255,255,255,255)
DrawTxt(0.30, 0.92, 0.6,1.0,0.55,"~w~Players Online: ~b~"..#players.."~r~/"..maxclients.."", 255,255,255,255)
DrawTxt(0.30, 0.95, 0.6,1.0,0.55,"~w~Fuel Level: ~b~"..fuelLevel, 255,255,255,255)
	end
end)


function DrawTxt(x,y ,width,height,scale, text, r,g,b,a)
    SetTextFont(4)
    SetTextProportional(0)
    SetTextScale(scale, scale)
    SetTextColour(r, g, b, a)
    SetTextDropShadow(0, 0, 0, 0,255)
    SetTextEdge(2, 0, 0, 0, 255)
    SetTextOutline()
    SetTextEntry("STRING")
    AddTextComponentString(text)
    DrawText(x - width/2, y - height/2 + 0.005)
end

--[[
local infodelay = 1000 * 60 * 1
Citizen.CreateThread(function()
    while true do
	Citizen.Wait(infodelay)
	ShowInfo("~g~Don't forget to signup on the CAD/MDT:"..cadlink)
	end
end)--]]

function ShowInfo(text)
	SetNotificationTextEntry("STRING")
	AddTextComponentString(text)
	DrawNotification(true, false)
end

ok i’ve got the fuel part working but it only shows up to 64 with exports.frfuel:getCurrentFuelLevel() any idea on how to get it to 100%?

the drawtext:
DrawTxt(0.30, 0.95, 0.6,1.0,0.55,"Fuel: "..("%.2d"):format(math.ceil(flevel)), 255,255,255,255)

var:
flevel = exports.frfuel:getCurrentFuelLevel()

local fuelLevel = exports.frfuel:getCurrentFuelLevel()
local fuelRounded = math.ceil(fuelLevel)
local fuelPercent = math.ceil((fuelLevel / 65) * 100)

ah yes thank you!

and you don’t mind if i use that in my custom script i am making and releasing?

(I am achieving credits from everyone i get code from)

Of course, that’s fine.

Hey. How do I move the “Fuel Bar” below the map? Is that possible as shown in this picture.

image

1 Like

does this not work anymore? doesnt work for me