[RELEASE] Advanced truck inventory for ESX (black money, weapons, items)

Did you use the right encoding in your db? (utf8mb4_bin)

thats it :stuck_out_tongue:

Yes all my tables have the right encoding, the issue is because when the script get the name of item he write it in utf8 i think but i don’t know how to force the script to export without this bug

HelpMe

Anyone know a fix for this?

and dthis was my answer:

wehicle is owned means taht when you buy at vehicleshop you set owned on 1 otherwise all cars spawn by jobs are 0
so that if you reboot the server all trucks that are not owned cars will be deleted. so it will save space in your db

so in your parameter you have to set owner = 1 or owner = 0

Hey, this is a great script and thank you for adding it, there has been a lot of issues with it but that just FiveM in general, there is one error that is bugging me and allows players to exploit the script. Many other servers just disable trunk inventories which i do not want to do!

The exploit in question that i would like help getting a solution for is that when using this script players can click “Enter” or “mouse left click” more then once to duplicate that item, if there is a trunk limit it can and will be exceeded. I can show this through screenshots on my server. i will duplicate the 3x bottles of water in my inventory and show afterwards that it works

SCR 1: https://gyazo.com/2d25510a5ffe41a52a847e664ecd0c2c
SCR 2: https://gyazo.com/46d574259434c71d67b8647e409ed63e
SCR3: https://gyazo.com/815e031525cdc01b14503052deb4c7a8

I know a few servers have fixed this and i was wondering if anyone could release a patch or help me fix it.

i wont “repair” my script because i took already lots of time to make it work. i was hoping someone would push the sollution but yea… everyone thinks for themselfs and not for others.

if i was you i would , when someone press enter close all menus and put a timeout on the request.

1 Like

I was thinking that, unsure how to do it but i’ll do some research. Hope someone pushes a solution to it^

that would be good yup… remember that you’re the creator… at least you should give the fixes needed to work well even if the others don’t contribute

What obligation does OP have to do that? It’s open source, submit a fix. I submitted a fix for the backspace issue that people were having. If I was still using this resource, I’d fix whatever other issues there were. Coding can be time consuming and under appreciated.

What obligation does OP have to do that? It’s open source, submit a fix. I submitted a fix for the backspace issue that people were having. If I was still using this resource, I’d fix whatever other issues there were. Coding can be time consuming and under appreciated.

true, and like i said, i dont use thiss ressource, so i won’t fix things if i don’t use it. So yea i am waiting for your fix @manups4e, or even a self made script :thinking:

Like the weashop with clip you re-released after I released mine?

you know i did release it faar before but i removed it because … yea people like i see are not greatfull and are thinking coding is easy.
and yea after you released it i did put mine again on public… it was just one click away…

XD ok then… i’ll try fix it myself :slight_smile:

it should be good changing line 291 removing the “tonumber” and leaving the data4.value… this way people cannot use tab to double items

change local quantity = tonumber(data4.value) into local quantity =data4.value

Just put ESX.UI.Menu.CloseAll() before any notification it work for me.

if not max then
              	local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1),true))
  				    	local closecar = GetClosestVehicle(x, y, z, 4.0, 0, 71)
					ESX.UI.Menu.CloseAll()
              --  VehicleMaxSpeed(closecar,totalweight,Config.VehicleLimit[GetVehicleClass(closecar)])
  				TriggerServerEvent('esx_truck_inventory:addInventoryItem', GetVehicleClass(closecar), GetDisplayNameFromVehicleModel(GetEntityModel(closecar)), GetVehicleNumberPlateText(vehFront), data3.current.value, quantity, data3.current.name, data3.current.type, ownedV)
				TriggerEvent("pNotify:SendNotification", {
              text = '<h3> Poids du coffre : <h3>'.. Kgweight .. ' Kg / '..MaxVh..' Kg',
              type = "success",
              queue = "alert",
              timeout = 10000,
              layout = "centerRight",
			  theme = "metroui"
            })
				--ESX.ShowNotification('Poids du coffre : ~g~'.. Kgweight .. ' Kg / '..MaxVh..' Kg')
				Citizen.Wait(500)
				--TriggerServerEvent("esx_truck_inventory:getInventory", GetVehicleNumberPlateText(vehFront))

i have just changed the notification with pnotify but this is the same every

ESX.ShowNotification('Poids du coffre : ~g~'.. Kgweight .. ' Kg / '..MaxVh..' Kg')

you put ESX.UI.Menu.CloseAll() before

Hope it can help you :wink:

yeah but no… not working for me… in this script an easy way to double things, is to use tab key while writing… if i type 2 and press tab then i accept… i get 4 in my car trunk… i got fixed removing tonumber in quantity values

I don’t know … It work for me when i put “1” in the field , I keep tab key pressed and validate but the menu close after one click. you can press multi time on the button “ok” ?

Did anyone fix the glitch where if 2 people take the same item out at the same time it duplicate it ?

I have tried alot now but cant figure it out. I have changed owner to both 1 and 0 but still get the error. Everything works. I get the menu. I put items in the car it just dosnt register to the database and it does not take from my inventory what i put in car. (Also noting gets put in the car)

When i try to put something in the car this is the error i get:

[ERROR] [MySQL] An error happens on MySQL for query "INSERT INTO truck_inventory (item,count,plate,name,itemt,owned) VALUES (@item,@qty,@plate,@name,@itemt,@owned) ON DUPLICATE KEY UPDATE count=count+ @qty {@plate=88ZJF832;@qty=1;@item=bread;@name=Br├╕d;@itemt=0}": Column 'owned' cannot be null