Garry's Mod Wiki

Editing The Garry's Mod Wiki

Rules

In order to maintain consistency on the wiki, we have developed a number of simple rules. While we appreciate that these can't always be followed to the letter it makes us happy when you try.

This wiki is for Garry's Mod players as well as Garry's Mod developers.

While we encourage you to list and document addons and gamemodes, it should be done in a fair way. This isn't a place to create advertisements - but it is a place to hoard knowledge about the Garry's Mod ecosystem.

Page Content

  • It's Lua, not LUA, LUa, lua or LuA.

  • It's SENT, not SEnt.

  • It's SWEP, not SWep.

  • It's TOOL, not STOOL.

  • If you don't know how to name an argument or describe it, don't put UNKNOWN or anything like that, just leave it blank.

  • Put proper descriptions for arguments and return values, not just their names with one word.

  • Argument names must start with a lower case letter.

    • Position is bad, pos is good.
  • Do not put type indentifier as first letter.

    • iNum is bad, num is good.

Writing Examples

Try to make the examples be ready for use by other people, they shouldn't produce errors if people copy it into a Lua file or use lua_run. For example, with gamemode hooks, use hook.Add instead of GM:HookName.

Examples shouldn't rely on addons being installed. If output of an example is not available, don't put N/A, just leave the field empty.

To keep the coding style consistent throughout:

  • Do not put any semicolons (;).
  • Keep underscores to minimum.
  • Use Entity( 1 ) for player.
  • Use Vector( 0, 0, 0 ) and Angle( 0, 0, 0 ) for arguments, not just something like vPos.
  • Use Player1 in place of a player's nickname in example output. Additional players can be Player2, Player3, and so on.
  • Use STEAM_0:1:12345678 in place of player's SteamID in example output.
  • Avoid useless globals.
  • Use --, not //.
  • Space out function arguments

Page Links


Special Pages


Wikis

?

Render Time: 27ms

Session 0
DB GetPage 2
Generate Html 3
SaveChanges 8
Render Body 0
Render Sidebar 11