Hello i have long time problems to make weapon like weapon_militaryrifle not used because they are undefined
The first idea I have is that you haven’t added this weapon to the appropriate configs.
Either in shared/weapons.lua for QBCore, or the items table of the database for ESX, etc.
I believe ESX has a weapons config file in es_extended too, which probably needs it added if it’s not.
However, if you have added this weapon to the appropriate configs or none of that is needed for some reason, then it is likely it’s because you are using an older game build on your server, before that weapon was added in a DLC. That particular weapon was introduced with the Cayo Perico Heist DLC, which is game build 2189 (AKA mpheist4). You must set your server to this build or later, to get access to the content.
More info on that here (sv_enforcegamebuild) → Server Commands - Cfx.re Docs
And alternative option to updating your game build, is streaming that weapon individually. But you should just update, in my opinion.
Hey sorry for late respond but my game build is the highest right now
2545
Then that error is because ESX isn’t configured to know what weapon_militaryrifle is.
Make sure your ESX is up to date, or at least, include any new weapons into your version of config.weapons.lua, that are missing.
Ok thank you