General > Developers Corner
DarkRP custom job
Digital Spit:
--- Code: ---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)
--- End code ---
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.
Aaron113:
I think you have a ")" that should be a ",".
--- Code: ---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)
--- End code ---
I don't know anything about DarkRP (Assuming this is what this is), so I may be wrong.
Digital Spit:
--- Code: ---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
)
--- End code ---
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
bsharpie:
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
[0] Board index
Go to full version