r/SourceEngine • u/Maleficent_Risk_3159 • Oct 17 '26
HELP How do I fix this?
I was doing something again, but this time I decided to create a weapon_knife for my mod. I copied the weapon_crowbar code and structured it the exact same.
#error: weapon_knife.h must not be included in hl2mp. The windows compiler will use the wrong class elsewhere if it is.
I know I didn't do the copying wrong, but it feels like I did do something wrong. Thanks again!
1
Upvotes
3
u/doct0rN0 HE'S ALIVE! Oct 17 '26
You didn't copy the crowbar header file. You need to make new files for both files and include them into your file system and include them into Your game solution too make sure they're in the right spot. U need to include ur new weapon in weapon stubs as well rename and copy the model files too and have a physical copying of both files all around make sure all the names match entirely through the whole file capitalisation matters in some places as well so be extra weary of that too.
I also have a list of every source engine related tutorial I could ever find on Google in here is 2 tutorials for add a new weapon between them both you can figure it out for multi-player http://drn0.site.nfoservers.com/hub/drn0/to0lb0x/bookmarks.html
3
u/Pinsplash Oct 17 '26
did you add that file to the vpc?