I have installed jsfour-licenseplate and added the item into the shop and all, and it works fine, but when i press f2 (inventory) i cant drag it, i use esx_inventoryhud which uses drag and i have added license plate into the inventoryhud config but still i can get it to drag. Normally you drag f e bread or water into use and it works fine, but not with the license plate, someone please help!
From the top of my head, being able to use food is handled through basicneeds. What you can do is look through a mod that already has usable items (bandage? medkit? repair kit?) and use the code from there for your own purpose.
For example, here in extraitems you get extra items for your shop and some code that makes it usable. The client-side code determines what is actually done when used, and the server-side code removes the item from your inventory when used. Hopefully this is enough info to help you on your way.
Just fill item name with the name from the db, Then put the event or function in the trigger code area and boom.
ESX.RegisterUsableItem('itemName', function(playerId)
local xPlayer = ESX.GetPlayerFromId(playerId)
xPlayer.removeInventoryItem('itemName', 1)
-- trigger the code you want here
end)