1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Chat commands

Discussion in 'DarkRP Modding Questions & Help' started by Hans Pretzel, Jan 11, 2014.

  1. Hans Pretzel

    Hans Pretzel New Member

    Hi everyone,

    I have been struggling with this for a while without any luck, so I decided to ask for help here.
    What do I have to do in order to remove or disable a chat command, such as /pd /sleep /pm and so on?
    It's darkRP 2.5.0 with the modification tool installed.
    Thanks in advance.
     
  2. Suspeccct

    Suspeccct Member

    I know that you can disable sleep in disabled_defaults.lua in the darkrp_config folder.
     
  3. nzkfc

    nzkfc Member

    Yep, Suspecct is right, inside the garrysmod/addons/darkrpmodification/lua/darkrp_config/disabled_defaults.lua file look for:

    Code (Text):

    DarkRP.disabledDefaults["modules"] = {
        ["afk"]              = false,
        ["chatsounds"]       = false,
        ["events"]           = false,
        ["fpp"]              = false,
        ["f1menu"]           = false,
        ["f4menu"]           = false,
        ["hitmenu"]          = false,
        ["hud"]              = false,
        ["hungermod"]        = false,
        ["playerscale"]      = false,
        ["sleep"]            = false,
        ["voterestrictions"] = false,
        ["fadmin"]           = false,
    }
    Make them true to disable.

    For /pm , why do you want to disable that?

    There are /<job> commands inside the jobs.lua file also located in garrysmod/addons/darkrpmodification/* the line is:

    Code (Text):

    TEAM_CHIEF = DarkRP.createJob("Police Chief", {
            color = Color(255, 255, 255, 255),
            model = {
                    "models/player/agent_47.mdl"
                    },
            description = [[As the Police Chief your job is to protect
            the citizens of the city by ensuring your officers are
            effectivly doing their jobs. All activity such as hostage
            situations or kidnappings must be run through you.
           
            You report directly to the Mayor.]],
            weapons = {"sim_fas_colt1911", "sim_fas_mp5"},
            command = "chief", // What command is used to get this job in game e.g. /police (Don't enter a / though as this is prefixed)
            max = 1, // Number of jobs allowed in server
            salary = 60,
            admin = 0, // Is this an admin class? All = 0 | Admins = 1 | Super Admins = 2
            vote = true, //Do players need to create a vote to get this job? true for yes, false for no.
            hasLicense = true, //Does this job get a gun license for free? true for yes, false for no. It's useful to give the cops gun licenses.
            modelScale = 1.0, //How big are the players that have this job?
            maxpocket = 20,
            candemote = true, //Can people who have this job be demoted?
    })
    Just remove that line from the job code and you won't be able to use /<job> to get the job, only by F4 menu. HOWEVER not sure if there is a file that contains these commands that's not within the core files of the game, which you should not modify.
     
  4. Hans Pretzel

    Hans Pretzel New Member

    Thanks, I really appreciate your help.
     
  5. nzkfc

    nzkfc Member

    No probs!
     
  6. TypicalRookie

    TypicalRookie Active Member

    You can use
    Code (Text):

    DarkRP.removeChatCommand("command")
     
    to remove any command
     
    Suspeccct likes this.
  7. nzkfc

    nzkfc Member

    Noted! that's quite helpful, is it in the LUA by default at all?
     
  8. vindictive

    vindictive Member

    where do you add DarkRP.removeChatCommand("command")?
     

Share This Page