ULX

Author Topic: DarkRP custom job  (Read 7420 times)

0 Members and 1 Guest are viewing this topic.

Offline Digital Spit

  • Jr. Member
  • **
  • Posts: 79
  • Karma: 1
DarkRP custom job
« on: February 23, 2012, 11:25:05 AM »
Code: [Select]
TEAM_Ex = AddExtraTeam("example", Color(0, 255, 0, 255), "models/player/mossman.mdl", [[Derp...]]
, {}, "derp", 1, 55, 0, false, false, false) function(ply) return ply:GetUserGroup() == "donator" or ply:IsAdmin() end)

I guess what I'm asking for is just approval over it, as in is this the correct way to put the hook to allow certain jobs to be donator only.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: DarkRP custom job
« Reply #1 on: February 23, 2012, 06:36:16 PM »
I think you have a ")" that should be a ",".

Code: [Select]
AddExtraTeam("example", Color(0, 255, 0, 255), "models/player/mossman.mdl", [[Derp...]], {}, "derp", 1, 55, 0, false, false, false, function(ply) return ply:GetUserGroup() == "donator" or ply:IsAdmin() end)
I don't know anything about DarkRP (Assuming this is what this is), so I may be wrong.
« Last Edit: February 23, 2012, 06:40:01 PM by Aaron113 »

Offline Digital Spit

  • Jr. Member
  • **
  • Posts: 79
  • Karma: 1
Re: DarkRP custom job
« Reply #2 on: February 23, 2012, 09:51:01 PM »
Code: [Select]
TEAM_VIPJOB = AddExtraTeam("SWAT CHIEF", -- Name
Color(238, 99, 99, 255), -- Team color
"models/player/mossman.mdl", -- Player model
[[The SWAT are under your command.
Use force when needed. You can either setup a base for you and your team within the police department
 or occupy an empty building around the town.]],  -- Job description
{"lockpick", "unarrest_stick","med_kit"}, -- Weapons
"swatchief", -- Command to become the job
1, -- Maximum amount of said job
75, -- Salary
0, -- Admin status
0, -- Has to vote
true, -- Has a license
nil, -- Needs to be job X in order to get this job
function(ply) return ply:GetUserGroup() == "vip" end -- The extra check function. Enter nil or nothing to not have an extra check
)

That's what I ended up using, I found a sample on the DarkRP site, the last line with "GetUserGroup" was something that had to be changed to specify a ULX group but you were right

Offline bsharpie

  • Newbie
  • *
  • Posts: 15
  • Karma: -4
Re: DarkRP custom job
« Reply #3 on: May 30, 2013, 09:02:12 PM »
ok so i have been searching everywhere for help on this and cant find it i even tried everything i even went on your website and did all of the things there and it still did not work but i am trying to add in a custom job that my donators can use and i have two donator ranks VIP and VIPGOLD and i want all the jobs for VIP to be able to be used as VIPGOLD and when i use this coding it does not work

jobfunction(ply) return ply:GetUserGroup() == "VIP" or "VIPGOLD" ply:IsAdmin()  end

jobfunction(ply) return ply:GetUserGroup() == "VIP" or ply:GetUserGroup() == "VIPGOLD"  ply:IsAdmin()  end

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given