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.

I am trying to add a customcheck to my gmod server

Discussion in 'DarkRP Modding Questions & Help' started by Mincin, Jul 4, 2019.

  1. Mincin

    Mincin New Member

    Hello I use ulx for my admin and group system and I am using darkrpmodification to add jobs and when I try to add some it works fine but when I try adding a custom check I get an error in console saying

    [ERROR] Lua is unable to understand file "darkrp_customthings/jobs.lua" because its author made a mistake around like number 30.
    The Best help I can give you is this:
    There is an opening '(' bracket at line 17, but this bracket is never closed or not closed in time. It was expected to be closed before the 'PlayerSpawn' at line 30


    This is my code

    TEAM_CTPVT = DarkRP.createJob("CT Trooper", {
    color = Color(255, 255, 255, 255),
    model = {"models/ct_cptm/cgi ctp2.mdl"},
    description = [[Clone Trooper Private]],
    weapons = {"tfa_swch_dc15a", "tfa_swch_dc15s", "salute_swep"},
    command = "clonetrooper",
    max = 50,
    salary = 250,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = false,
    category = "CloneTroopers"
    PlayerSpawn = function(ply)
    ply:SetMaxHealth(150)
    ply:SetHealth(150)
    ply:SetArmor(0)
    end,
    customCheck = function(ply) return
    table.HasValue({"superadmin", "admin", "clonetrooper"}, ply:GetNWString("usergroup"))
    end,
    CustomCheckFailMsg = "You are not whitelisted for this job",
    })
     
  2. # VALERY

    # VALERY Member

  3. Mincin

    Mincin New Member

    I am confused what do I need to do
    --- Double Post Merged, Jul 4, 2019 ---
    Because when I add the health and armor it works fine but when I add custom check I get error
     
  4. FireWolf

    FireWolf Member

  5. # VALERY

    # VALERY Member

    You forget "," at the line 13.

    Like now your category is category = "CloneTroopers"Playerspawn = function (ply)...
     

Share This Page