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.

God Mode to staff on duty/cant arrest my staff while on duty

Discussion in 'DarkRP Modding Questions & Help' started by Peep, Sep 22, 2018.

  1. Peep

    Peep New Member

    hello stranger I need some help with a CustomCheck code so I want to be able to make it so when my staff on duty their job spawns them with god mode

    also, need a bit of help where my staff on duty job cant be arrested because I don't want my staff to be able to be sent to jail while their in an admin sit or like just flying around helping my players
     
  2. Paco

    Paco Member

    Well as last time I said in settings.lua you can find thing about arresting,so police can't arrest people that' don't have /wanted,that doesn't affect only staff on duty but still I advise you to do that..Try and find in settings.lua this line and set it as true

    -- needwantedforarrest - Enable/disable Cops can only arrest wanted people.
    GM.Config.needwantedforarrest = true

    @about god mod I don't know I left that for the end on my server so yea :)
     
    Last edited: Sep 23, 2018
  3. Code (Text):
    function admingodmode( victim )
        if victim:Team() == TEAM_ADMIN then
            return false
        end
    end
    hook.Add( "admingodmode", "ofaeirsj", admingodmode)
     
  4. Peep

    Peep New Member

    i added that code in and changed it to TEAM_STAFF but im getting errors

    There is an opening '{' bracket at line 36, but this bracket is never closed or not closed in time. It was expected to be closed before the 'function' at line 50.

    Hints:
    - Did you forget a comma?
    - All open brackets ({, (, [) must have a matching closing bracket. Are you sure it's there?
    - Brackets must be opened and closed in the right order. This will work: ({}), but this won't: ({)}.
     
  5. Pab14567

    Pab14567 Well-Known Member

    Is the error in your jobs file or in the script? The script is error free.
     
  6. Peep

    Peep New Member

    have no errors until I added it to a certain job
     
  7. Pab14567

    Pab14567 Well-Known Member

    you dont add it to the job. You add that code to a file in darkrp modules like this : callthiswhateveryouwant.lua
     
  8. Peep

    Peep New Member

    i gotta disbale babygod?
     
  9. Pab14567

    Pab14567 Well-Known Member

  10. Peep

    Peep New Member

    hm some reason its giving me errors when i add to my staff on duty but i remove it dont get errors
     
  11. Pab14567

    Pab14567 Well-Known Member

    where are you adding it ? what file? how are you adding it ?
     
  12. darkrpmodules_foldername_filename.lua
     
  13. Peep

    Peep New Member

    adding it to the Job in customJobs
     
  14. Pab14567

    Pab14567 Well-Known Member

     
  15. Peep

    Peep New Member

    i went to /garrysmod/addons/darkrpmodification/lua/darkrp_modules made a file called Staff God.lua posted the code changed TEAM_ADMIN to TEAM_STAFF cos that the staff on duty team name saved it restarted server jumped on went staff on duty but still able to take fall dmg and they arent goded
     
  16. Mate make a folder in the darkrp_modules called "staffgod" and inside place a file called "sv_staffgod.lua" , then restart your server and it should work.
     
  17. Peep

    Peep New Member

    still not working i went to /garrysmod/addons/darkrpmodification/lua/darkrp_modules/staffgod then made sv_staffgod.lua pasted the code change it to team_staff but still no luck
     
    Last edited: Oct 7, 2018
  18. Staff On Duty Godmode
    Code (Text):

    hook.Add( "PlayerShouldTakeDamage", "StaffGodmode", function(staff)
    if team.GetName(staff:Team()) == "Staff On Duty" then
    return false
    end end)
     
    Staff On Duty Anti-Arrest
    Code (Text):

    hook.Add("canArrest", "StaffAntiArrest", function( arrester, arrestedz )
    if team.GetName(arrestedz:Team()) == "Staff On Duty" then
    DarkRP.notify(arrester,1,4,"Nononono don't do that. That's bad")
    return false
    end
    end)
     
    .
     
    Last edited: Oct 12, 2018
  19. Paco

    Paco Member

    Worked for me,just add it to autorun/server
     

Share This Page