Author Topic: Restricting Jobs to ULX Ranks  (Read 2541 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark Kane

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Restricting Jobs to ULX Ranks
« on: January 14, 2015, 01:05:13 AM »
Alrighty i tried a BUNCH of stuff to do it and nothing works, and ANY help would be useful at this point
This is my Vip swat code (it works)
Code: [Select]
TEAM_Swat = AddExtraTeam("Swat", Color(65, 21, 132, 255), "models/player/swat.mdl", [[The protector of every citizen that lives in the city. You have the power to arrest criminals and protect innocents. Hit a player with your arrest baton to put them in jail. Bash a player with a stunstick and they may learn to obey the law. The Battering Ram can break down the door of a criminal, with a warrant for their arrest. The Battering Ram can also unfreeze frozen props (if enabled).Type /wanted <name> to alert the public to the presence of a criminal. VIP JOB
]], {"m9k_deagle","arrest_stick","unarrest_stick","stunstick","door_ram","weaponchecker"}, "Swat", 5, 100, 0, false, true)


I want to make it VIP only but it doesn't seem to wanna work with the extra code to do that i put in it

I saw a few posts that i should use this format
Code: [Select]
TEAM_ = DarkRP.createJob("", {
    color = Color(0, 0, 0, 255),
    model = {"models/player/group01/male_01.mdl"},
   description = [[]],
    weapons = {"weapon_ak472"},
    command = "",
    max = 5,
    salary = 45,
    admin = 0,
    vote = false,
    hasLicense = false,
(yes its empty i just used it as a ref)
But this code doesn't work for me it eather disables all the Custom jobs or removes my all the jobs

Like i said any help is greatly appreciated

Thanks In advance

~Mark Kane
« Last Edit: January 14, 2015, 01:07:04 AM by Mark Kane »

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: Restricting Jobs to ULX Ranks
« Reply #1 on: January 14, 2015, 03:43:30 AM »
Hello,
as far as I am concerned DarkRP Jobs use a customCheck to check if the player may use/become this class.

Take a look at this:
Code: [Select]
customCheck = function(ply) return ply:GetNWString("usergroup") == "donator" or ply:IsAdmin() end, -- The extra check function. Enter nil or nothing to not have a restriction

Found by a simple google search: Here

Avoid

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Restricting Jobs to ULX Ranks
« Reply #2 on: January 14, 2015, 06:36:17 AM »
But this code doesn't work for me it eather disables all the Custom jobs or removes my all the jobs

Ensure every setting has a comma after it except the last one.

PRAISE TO COMMAS, THEY ARE THE MOST OVERLOOKED THING.
Once you get to know me, you'll find you'll have never met me at all.

Offline Mark Kane

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Restricting Jobs to ULX Ranks
« Reply #3 on: January 14, 2015, 04:04:23 PM »
Well thank you all i had a friend help me with it, First server im making to kinda get my feet wet with lua ect. 

But thank you for assisting we will make it trough this together