Closed Nanorithm closed 7 months ago
Thanks, feel free to send a PR to fix this. This script is outdated and some small things like so will prob not work correctly after so many QBCore changes.
I believe I was able to fix it, the only bug I'm running into is that I can't find a way to update the item durability when calling the ps-fuel:client:refuelCan
event since it's possible the player can have multiple cans in their inventory and the wrong one could get updated, but it updates properly in all other instances. So as it stands now, it will have the old durability until the gas can is used again but the durability is directly linked to the percentage that the can is filled.
I'll make a PR when I clean up my code some more haha
First of all, buying a jerry can gives me an item with 0 munitions in the metadata. When I'm refilling a jerrycan, it goes through the animation, and the metadata in the inventory does update to 4500, but when I go to use it on a car it is saying that it is empty. I tried debugging a bit myself and it seems that
GetAmmoInPedWeapon(ped, 883325847)
is returning 0 even though the can has 4500 munitions in metadata.I provided a video of the issue here in case that was unclear.
Also as shown in the video, when pulling out a jerry can, it swaps the player back to unarmed and I have to do it twice. This actually only works when I manually restart qb-smallresources otherwise it is an endless loop of just dropping the prop on the ground.
For reference: My
qb-weapons/client/main
snippet:My
qb-smallresources/client/ignore
snippet:My
qb-inventory/client/main
snippet:I am currently using the following related scripts:
I'm using v1.0.1 from the releases section.