thers / frfuel Goto Github PK
View Code? Open in Web Editor NEWBasic fuel system for FiveM
Home Page: https://forum.fivem.net/t/release-frfuel-v1-1-0/5467
License: MIT License
Basic fuel system for FiveM
Home Page: https://forum.fivem.net/t/release-frfuel-v1-1-0/5467
License: MIT License
Hi,
Now the refueling is the same for every vehicle, could you look in to charging stations for electric vehicles?
I would be awesome and more realistic.
I've noticed that this mod does not respect fuel leaks... Fuel starts leaking from (at least a car) vehicle when the tank's health is below 700.
Hey there, I look at your script which is amazing and I ask myself how can I reduce the number of gas station on the map because it's make too much blips and I want something more clean ! @thers
Hello mate,
When using AddEventHandler("frfuel:addedFuel") , it works in a vehicle but it doesnt work with manual refuel (with petrol can).
Can you confirm and if it's possible, fix it ?
Thanks a lot for your work !
when i trying to do
local fuelLevel = exports.frfuel:getCurrentFuelLevel()
exports.frfuel:addFuel(42.5)
exports.frfuel:setFuel(65)
i get an error no such export
Hey @ridersx,
First, thanks for sharing your code! I didn't realize we could even use C# until you posted the to teh forums.
I'm having issues using a DLL I've built locally. The GTA V client, when connecting to the server fires off a not calling parent constructor .ctor()
error (Sorry for not having the exact error message, I'm on another machine at the moment).
Would it be possible for you to elaborate a bit more in the README with info on how you've setup VS to work? Where did you get the nativeui.net.dll
dll?
Thanks again for this. <3
--mark
Frfuel gives a resource time warning on clients since the FiveM client update.
Comet5 Fuel consumption is insanely high! The Comet2 is more reasonable but for some reason the Comet5 appears to consume 1% per Tick even when idling and it acts like it has a 1 liter tank.
I would imagine that even with the calculations the tank size of the two vehicles would be similar. The Comet5 actually appears to be a less powerful vehicle than the Comet2 which makes this more confusing.
Since the last FiveM update, FRFfuel needs to be restarted when connected to run, the error is :
fx::TestScriptHost::InvokeNative: execution failed: Error executing native 0x5a039bb0bca604b6 at address 0x1409ccfd2.
Failed to instantiate instance of script FRFuel.FRFuel: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.
When tank fuel is empty, the vehicles can be driven, fuel tank management has no impact on speed when it becomes low, and no imapct on driveable aspect when it get empty.
The engine sputtering at low fuel levels is way to excessive in my opinion, since it literally locks the wheels and can make the vehicle drive backwards... I'd like an option in the config to simply disable this feature.
Hello,
How can I translate the mod, I do not understand much of C #, I opened the project in visual studio but I can not compile!
Modified code:
` public static PointF GetSafezoneBounds()
{
float t = Function.Call(Hash.GET_SAFE_ZONE_SIZE);
return new PointF(
(int) Math.Round((1280 - (1280 * t)) / 2),
(int) Math.Round((720 - (720 * t)) / 2)
);
}
/// <summary>
/// Change instructions for engine cut off
/// </summary>
public void InstructTurnOffEngine()
{
buttons.CallFunction("CLEAR_ALL");
buttons.CallFunction("TOGGLE_MOUSE_BUTTONS", 0);
buttons.CallFunction("CREATE_CONTAINER");
buttons.CallFunction("SET_DATA_SLOT", 0, Function.Call<string>((Hash) 0x0499D7B09FC9B407, 2, (int) Control.VehicleHorn, 0), "Desligar motor");
buttons.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1);
}
/// <summary>
/// Change instructions for refueling and engine spin up
/// </summary>
public void InstructRefuelOrTurnOnEngine()
{
buttons.CallFunction("CLEAR_ALL");
buttons.CallFunction("TOGGLE_MOUSE_BUTTONS", 0);
buttons.CallFunction("CREATE_CONTAINER");
buttons.CallFunction("SET_DATA_SLOT", 0, Function.Call<string>((Hash) 0x0499D7B09FC9B407, 2, (int) Control.Jump, 0), "Reabastecer");
buttons.CallFunction("SET_DATA_SLOT", 1, Function.Call<string>((Hash) 0x0499D7B09FC9B407, 2, (int) Control.VehicleHorn, 0), "Ligar motor");
buttons.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1);
}`
Sometimes it happens that when i go to refuel vehicle to gas stations and other players are inside my vehicle while i refuel it.. when i get back into vehicle, fuel is reset to the players state and not the refueled state..
it's like that it doesn't refuel when other players are inside vehicle during refuel
I apologize if this is not the place for feature requests.
I would like to see a couple additional events that would allow access from other custom scripts. I am writing a roadside assistance script and we use frfuel. I would like to have an AI Ped drive out to the player and fill their vehicle with fuel if they ran out. Please let me know if you need some additional information.
frfuel:currentfuel -> (amount: float) - Checks current fuel level.
frfuel:addfuel -> (amount: float) - Allows adding fuel.
Hello, there seems to be a file missing "frfuel.net.dll".
As stated in the __resource.lua below:
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' files { "config.ini", "Newtonsoft.Json.dll", "GasStations.json" } client_script "frfuel.net.dll"
I am unable to find "frfuel.net.dll".
Which causes an error upon trying to join the server.
As in, now they all are hard-coded into source code. JSON was chosen as we have gas stations and they have refuel locations in it, so kinda nested structure and we can't support it nicely with our current ini-like config thing.
P.S.: This is just to make it clear we're working on it as we dicussed it with @TomGrobbe privately later.
I have many error on compiling with Visual Studio Pro 2015:
Erreur CS1043 { ou ; attendu FRFuel.cs 51 Actif
Erreur CS1513 } attendue FRFuel.cs 51 Actif
Erreur CS0161 'FRFuel.LastVehicle.get'ย : les chemins de code ne retournent pas tous une valeur FRFuel.cs 51 Actif
Line 51 : protected Vehicle LastVehicle { get => lastVehicle; set => lastVehicle = value; }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.