Results 1 to 2 of 2

Thread: The Basics of Garry's Mod Servers

  1. #1
    Junior Member
    Join Date
    Dec 2011

    Post The Basics of Garry's Mod Servers

    Hi, everyone
    I really like this host and community, so I've decided to give the community all the knowledge I've gained of hosting servers.

    Xenon Servers comes readily equipped with FastDL (like a baus) for you to use. However, many people don't quite know what to do next.
    Many addons with custom models will already make it so that players download their files when they join. If it doesn't, or you want people to download completely custom files, simply go into /lua/autorun/server and create a file that has anything with a suffix of .lua i.e 'downloads.lua'
    Then, inside that file, type
    resource.AddFile( "path and name of file" )
    You can put that line in as many times as necessary.

    Installing facepunch/ creations
    There are many kinds of files that you can download from either site. I'll start with addons, the easiest. Once you have downloaded your zipped addon, go into your File Manager, click on the addons folder and click upload. Search for the downloaded addon and upload it.
    From there, once the page automatically refreshes, click on the drop-down menu to the right of your zip file and click Unzip. Your addon should be ready.
    Hint: You'll know if it's an addon if it's not a gamemode and has info.txt in the zip file

    Installing a gamemode is just as easy. If the gamemode contains one main folder, upload it to gamemodes/ . If it has multiple (i.e lua, models, gamemode) folders, create a folder in your gamemodes/ folder (of the server) and upload the zip file inside of the new folder.
    Your path should look a bit like this:
    gamemodes/awesomegame/{contents of the gamemode}

    Some files will not be either of those two, so simply follow the instructions that the creator gives.

    Default Settings
    Many servers, of course, do want a
    -custom server name
    -default gamemode
    -default map
    and similar.
    In order to obtain these, in the main server menu, click on Default Config Files, click Edit on the first one and the rest should be self-explanatory. Do not edit sv_downloadurl.
    In order to show a webpage when someone is loading the game, add a new line to that folder that says
    sv_loadingurl "url of shown page" -- be sure to include the "s

    In order to have a default map/gamemode, go back to the main server menu and click on Command Line Changer. Add a new command line, edit it (it should be self-explanatory) and select it. Then, restart the server.

    Updating your server to the latest Garry's Mod version
    This is the easiest of all things to do. Simply go to your server's main page and click Run Steam Update.

    Making yourself an admin
    In order to make yourself an admin, you need an admin mod. These can be found in the Game Mods button on your main page, the best one is called ULX.
    Once the sever installs ULX for you, start up your server and join it.
    Then, click Default Config Files and click on the first one again, then, on rcon_password type anything memorable.
    Go back to your main page and click Server Status and Administration. Type in your password where it says 'Password:' (saving it helps too) and in the 'Command:' box, type
    ulx adduser yourname superadmin
    For example, I would type
    ulx adduser pazda superadmin
    Click Execute and type !menu in your Garry's Mod server, you'll be all ready!

    SVN files
    I'm a bit iffy on this technique myself so I'll give you two ways.
    The first way is to go into your Default Config Files and click on the second one.
    Copy and paste the block that looks like this
    name = "Name"
    svnurl = ""
    internalfolder = "addons\Name"
    checkedbydefault = true
    auth = false
    username = ""
    password = ""
    type = svn
    and at the top change total mods to 2.
    Let's say we were installing the addon 'LEXENON', in the name =, inside the "s, type LEXENON
    The svnurl is given by the creator of the svn mod, so copy and paste that in. Replace spaces in the url with %20.
    Internalfolder is just the folder that you want the files in.
    The rest shouldn't be touched unless you know otherwise.
    My example for LEXENON would be:
    name = "LEXENON"
    svnurl = ""
    internalfolder = "addons\LEXENON"
    checkedbydefault = true
    auth = false
    username = ""
    password = ""
    type = svn
    It's that easy.

    If you don't want to go that route, follow the other svn tutorial in this forum and simply zip and upload it to your addons file.

    DarkRP Editing
    When editing DarkRP, there are two main files you should keep in mind - shared.lua and addentities.lua
    To add jobs, open up gamemodes\darkrp\gamemode\shared.lua
    Making a job is very, very easy. Here's the format:
    TEAM_SAMPLE = AddExtraTeam( "<NAME OF THE CLASS>", Color(<red>, <Green>, <blue>, 255), "<Player model>" , [[<the description(it can have enters)>]], { "<first extra weapon>","<second extra weapon>", etc...}, "<chat command to become it(WITHOUT THE /!)>", <maximum amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to become it>, true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)
    Here's an example of a custom job from my server:
    TEAM_HOBOE = AddExtraTeam("Hobo Elite", Color(80, 45, 0, 255), "models/player/charple01.mdl", [[The lowest member of society. All people see you laugh.
    You have no home.
    Beg for your food and money
    Sing for everyone who passes to get money
    Make your own wooden home somewhere in a corner or
    outside someone else's door
    You can pick up weapons and raid with them.
    Allowed to raid: Yes
    Gun pickup allowed: Yes]], {"weapon_bugbait", "gm_pickpocket"}, "hoboe", 2, 0, 0, false, true, TEAM_HOBO)
    Please do not steal the job.

    Now, you can learn how to make people be able to buy ENTITIES.
    This method does not teach you how to make your own entities like money printers! That's for lua coders.
    Save shared.lua and go to addentities.lua
    This format is fairly simple and you should be able to get it easily. Once you type in the line, it'll automatically come up with the variables you specified.

    Resetting Wallets

    This is a tricky little operation, and it can completely mess up your server so watch out.
    1. Download sv.db in your main directory
    2. rename it as svbackup.db and upload it to the main directory
    3. Download sv.db again
    4. Open it with RazorSQL. There is a free demo here
    a. Click 'Connect to a new database'
    b. Click add profile; select SQLite
    c. Profile name can be anything you want. Don't change SQLite Program. Change the database file to sv.db.
    d. Click connect
    5. Press plus buttons until you see darkrp_wallets; right click it and open it
    6. Press the little white icon with the green arrow and type:
    UPDATE darkrp_wallets
    SET amount = '0'
    7. Run that, save, and delete sv.db from your server files
    8. Upload your new edited sv.db!

    What is SVN?
    SVN is a method used by many developers. It automatically updates the files when the developer does, so you never go out of date!
    I want to make my own stuff. Where can I learn lua?
    Your best bet is the GMod Wiki.
    I have a question. Can you update this post with the answer?
    Yes, simply reply to this thread and I'll make a new section if I can.

    More information will be added here soon if I think of something to tell or if someone requests it in a reply. Thank you for reading!
    Last edited by Pazda; 2012-05-30 at 06:22. Reason: Make ALL the infos!
    Owner of [PE] Garry's Mod server community
    Website: (likely to change, might order Xenon's webhosting <3)

  2. #2
    Junior Member
    Join Date
    Sep 2012
    umm how to make it for only admins to spawn entites and vehicles in gmod darkrp server??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts