C++ and Lua

I found out that C++ is also used in GMod (most likely the general stuff like the main menu and everything), however I also know there is a way for me to incorporate it into my code. I just do not know how.

Can someone give me all the ways I can use C++ in my code? I feel as though the constraints for what I can do will be released once I know how.

You’d make a binary module and

require it in your script.

Also a quick note, I’d suggest using more up to date headers https://github.com/Facepunch/gmod-module-base/tree/development or even https://github.com/danielga/garrysmod_common

If the wiki is out of date, will you please update it?

(I tried to write that in a way that doesn’t sound demanding or condescending at all, it didn’t work. I really meant to ask you nicely and only gently nudge you to edit the wiki)

What would be the point of using a module? I’m sure it would allow you to do more than base lua, or maybe not. Honestly I have no idea. :v:

You would use it either to do a function more efficiently in C than Lua (hashing, random, big-data management), or do something that’s not possible with exposed Lua functions (socketing, SQL).

Thank you guys :smiley: I’ll look into this.