CQC-Scripting / cc-fuel

CC-Fuel is a Modified version of LegacyFuel for QB-Core using QB-Target for Interactions.
https://discord.gg/XdQRbG7JzA
78 stars 25 forks source link

Get FUEL Level #6

Closed OfficialRDB closed 3 years ago

OfficialRDB commented 3 years ago

I switched from LegacyFuel to cc-fuel I used a bulk search / changed to replace all the LegacyFuel. As soon as a load in the server somewhere it is searching for a fuel level already in a loop.

Not even picked a character yet and the F8 console gets spamming that Capture1 .

eoinmcbennett commented 3 years ago

Hi thanks for this, ill take a look and get back to you ASAP

eoinmcbennett commented 3 years ago

I can't seem to reproduce the issue on my end. Can you give me the following information

  1. Did this happen on first login to the server or on subsequent logins If you logged out and back in what where you doing before you logged out?

  2. Have you updated your QB scripts recently? I'm running on quite recent versions and cant seem to reproduce it. If you haven't updated recently my best guess is a change done by QB that lays off that export a bit in one of the scripts.

I'll keep an eye out in the mean time

OfficialRDB commented 3 years ago

I can't seem to reproduce the issue on my end. Can you give me the following information

1. Did this happen on first login to the server or on subsequent logins
   If you logged out and back in what where you doing before you logged out?

2. Have you updated your QB scripts recently? I'm running on quite recent versions and cant seem to reproduce it.
   If you haven't updated recently my best guess is a change done by QB that lays off that export a bit in one of the scripts.

I'll keep an eye out in the mean time

I played and looked into it all day and it looks like the hud that I'm using is not build for cc-fuel. At least that what the author of the hud says.

https://github.com/loljoshie/lj-hud

eoinmcbennett commented 3 years ago

I can't seem to reproduce the issue on my end. Can you give me the following information

1. Did this happen on first login to the server or on subsequent logins
   If you logged out and back in what where you doing before you logged out?

2. Have you updated your QB scripts recently? I'm running on quite recent versions and cant seem to reproduce it.
   If you haven't updated recently my best guess is a change done by QB that lays off that export a bit in one of the scripts.

I'll keep an eye out in the mean time

I played and looked into it all day and it looks like the hud that I'm using is not build for cc-fuel. At least that what the author of the hud says.

https://github.com/loljoshie/lj-hud

I see the issue, I might have a fix for it ill implement it in tommorow

OfficialRDB commented 3 years ago

WOW that will be freaking awesome. Looking forward to it. Thank you.

Duderocktv commented 3 years ago

I am using the old QB-HUD (Before the change) and I have the same issue. Fuel just stays at 100 and never goes down!

eoinmcbennett commented 3 years ago

I am using the old QB-HUD (Before the change) and I have the same issue. Fuel just stays at 100 and never goes down!

Hi thanks for the report. Can you please move discussion of this issue over to the one I created for this.

eoinmcbennett commented 3 years ago

WOW that will be freaking awesome. Looking forward to it.

Thank you.

Ok so the issue I believe lies on line 238 on his client.lua He calls the export without first checking if a player is in a vehicle. So the get vehicle player is in function gives back crap when your in the character selection and the get fuel function tells you about it in f8.

You could add an if check before that line to make sure your ped is in a vehicle before you attempt to get a fuel level. This would honestly be a better fix than anything I can do over here

I'll try add something soon in the export that checks for bad entities being passed in, i'll let you know when it's done

OfficialRDB commented 3 years ago

Alright I'm gonna try and add a if check. I had my thoughts on that, like why is it in a loop calling the fuel while the player is not even in a car. That's not a good optimized option.

OfficialRDB commented 3 years ago

Even the check did not fix the issue.

eoinmcbennett commented 3 years ago

9 Should now fix this issue, clone the main branch to get the changes