Name’s Jason, I made this resource for my server as I couldn’t find any other cooking resources, so here you go. It detects nearby stove, toaster and microwave objects and allows you to cook different recipes if you have the right ingredients. You can add more recipes in the config file as well as more ingredients. The items come with their own icons ready for you to use them in your inventory resource.
I thought about it but due to me being new in FiveM Development, I’m still working my way in. If you have any ideas on how to do that I’d appreciate it!
Nice idea however i have seen something similar posted before which I think was for a cooker.
You should really start to use a target system be it esx/qb and grab the entity that way, be a great starting point and very useful to use if you are new to fivem.
Doesnt work for me… When i go to a stove and press “E”, Menu opens. If i dont have needed ingredients, and try to select a menu item, it says “missing ingredients” as pretended, BUT if i have all ingredients, and try to cook, nothing happens and the script stops to work.
No Error in Server or client Console.
Edit:
Got it!
You missed some lines for toaster and stove in server main.lua:
Change:
if not (xPlayer.getInventoryItem(Config.Items[v1.ingredient]).count >= v1["amount"]) then
enough = false
cb(false)
break
end
end
to:
if not (xPlayer.getInventoryItem(Config.Items[v1.ingredient]).count >= v1["amount"]) then
enough = false
cb(false)
break
else
enough = true
end
end