Learning the Gmod API?

I’m playing Garry’s Mod for years now and I’ve always enjoyed it and I still am.
Besides playing Gmod, I like programming. I find seeing my code in action very entertaining. I know over 20 programming languages and it’s very easy for me to learn new ones. I know the LUA syntax well, but I don’t know the Gmod API.
When I search on Google or Bing, I usually get very few results on the Gmod API.
Is there any way of learning the API? Isn’t there anything like the MSDN library?
I’d really appreciate your help! I wish to start coding for Gmod because I have good ideas for addons and game modes.

There is no Gmod API

All the info you need should be here http://wiki.garrysmod.com/?title=Main_Page

Gmod Lua isn’t that famous nor useful to have its code found everywhere on the internet. Use the Gmod wiki and come here with questions incase you can’t get answer from the wiki.

lol 20 languages huh, mind sharing which ones you know?

Btw I think you’re bullshitting because if you knew 20 programming languages, you would easily be able to dive into glua

if you knew 20 programming languages i think you would be more then capable to find all the garrysmod lua documentation you need.

Gmod wiki + lua manual will do to learn glua

Those who says they know 5-20 languages but how do I …

Generally there young and foolish. People who write a quick vbs script or some calculator in VB. vb6 > vbnet! VIVA LA REVOLUTION!

Its easiest to learn by looking at others’ code for gmod. I would recommend finding stuff made by jetboom or other lua kings because their code is always very neat, concise, and efficient.

But usually it is very hard to understand if you don’t know what you’re doing. And I’m sure the OP doesn’t, he should look at darkRP, and cakescript. Well, that’s what I did as a starter( i was into roleplaying), but look at more commonly used scripts for whatever type of thing you’re trying to do, those are usually easier to understand

[editline]14th December 2011[/editline]

It’s funny because you can always tell when you’re talking to a kid. Always.

I think you can easily know over 20 languages if you are one of those people that don’t know what they want.

The other languages have decumented APIs… Thanks for the encouraging posts…

Well, we use a Lua derivative in garrysmod. For the most part, it is functionally the same as the standard 5.1.2 build ( I think that’s the one ), with some added features.

We also have bitwise operators ( &, |, >>, << )
We have the continue keyword, which functions as the opposite of break

There’s a wiki full of information at wiki.garrysmod.com, where a great deal of the articles are filled in and a good amount of those probably have useful examples. Its a wiki, though, so your mileage may vary.

If you want more examples but don’t want to look at each coder’s own code, you can look at all the Lua that ships with garrysmod at luabin.overvprojects.nl. It may be a third-party site, but all this info is available in the gcf, so you could extract it yourself if you wanted.

If these sources don’t help you, we have the requests forum, the What Do You Need Help With thread in the main section, and if you decide you really don’t like Lua and would rather someone else did it, there’s the requests section ( which admittedly is a last resort - there’s a lot of dead threads in there ), or the Hire A Coder thread.

If by the “API” you mean how to create a c++ module to use in-game, we have a forum full of released, open source modules, and a rather thorough example on the wiki: wiki.garrysmod.com/?title=GLuaModule.

I hope this helps.

Thank you so much for this information! :smiley:

I tried the Wiki, but the tutorials aren’t quite what I expected. They’re not really helpful.
Most languages/IDEs have things like this to help the developers. It’s the API, very well explained. (I don’t expect the quality of the MSDN everywhere, chill down xD)
The Wiki is missing tutorials about entities, for example. It took me a week to find out how to make a working entity.
There is also no explanation about the difference between . and : and I still don’t know it… I just know that function defined as DATATYPE:FUNCTIONNAME use :…
It took me a day of research to find out how to make a working model selection for a STOOL… I ended up using someone else’s code, which I hate doing…

I see I have no choice but looking at other people’s code, so I will do so.

If you know over twenty different spectacular languages then you would know that Lua, especially GLua following C style syntax which you should have no issue picking up on.
The wiki has plenty of information, hell on the very first page there’s an overview link which recommends you look there if you’re new in general ( http://wiki.garrysmod.com/?title=Lua_Overview if you’re wondering).

Do you have a clue what API means?

These are some pages you could start researching into, but there are way too many classes and other stuff to list here.

You could also look at

That contains all current GLua functions. Not totally sure, but there are most of them if you want an overview.

You never answered what these 20 languages are. I’m still curious lol

Gosh, thank you!

I don’t feel like it.

I think I speak for everyone when i say I think you’re bullshitting.
Anyone who knows 20 coding languages could easily pick up on a new one, because not alot really changes…

But for this part , I speak for myself:
I absolutely detest liars , and saying that you know 20 languages just to be taken for somebody intellectually superior on a forum where you only need 1 to get your question answered is disgraceful.

In all due respect , now you have your answer , don’t bother posting in this thread again , or anywhere for that matter , if you’re going to lie.

I find your reactions very funny and full of frustration.
Pretending I don’t know those languages… Still, other languages have well documented APIs, like in the example link.

I’ll do as you say and stop posting here, but because it’s turning into a flame war.

No. Define the word.