Adding VIP only to jobs Need help Urgent PLSSS !


TEAM_THIEF = AddExtraTeam("Thief", Color(11, 216, 255, 255), {"models/player/Suits/robber_open.mdl", "models/player/Suits/robber_shirt.mdl", "models/player/Suits/robber_tie.mdl", "models/player/Suits/robber_tuckedtie.mdl"}, [[Thiefs can Mug,Raid and Kidnap. They can take part in WARS which are started by other criminal organisations ( must advert and get permission to join war). Thiefs must wait 15minutes before Stealing from the same player they have before.]], {"didy_aachb", "lockpick", "keypad_cracker" }, "thief", 6, 65, 0, false, false, false)

How to add VIP to this ? I need the layour like that I dont want the job code to look like


TEAM_DONATORJOB = DarkRP.createJob("Swat", { -- Name
    color = Color(238, 99, 99, 255), -- Team color
    model = "models/player/mossman.mdl", -- Player model
    description = [[As a cook, it is your responsibility to feed the other members of your city. 
                            You can spawn a microwave and sell the food you make: /Buymicrowave]],  -- Job description
    weapons = {}, -- Additional weapons
    command = "Swat", -- Command to become the job
    max = 2, -- Maximum amount of said job
    salary = 45, -- Salary
    admin = 0, -- Requires Admin? 1 for yes, 0 for no.
    vote = false, -- Do they need to vote? true for yes, false for no.
    hasLicense = false, -- Has a license
    customCheck = function(ply) return ply:GetNWString("usergroup") == "donator" end -- The extra check function. Enter nil or nothing to not have an extra check
})

I need it in the form That I put up first as Im trying to keep my file compact and Im use to working with that :smiley:

Even though I cannot understand your logic at all, here you go.


TEAM_THIEF = AddExtraTeam("Thief", Color(11, 216, 255, 255), {"models/player/Suits/robber_open.mdl", "models/player/Suits/robber_shirt.mdl", "models/player/Suits/robber_tie.mdl", "models/player/Suits/robber_tuckedtie.mdl"}, [[Thiefs can Mug,Raid and Kidnap. They can take part in WARS which are started by other criminal organisations ( must advert and get permission to join war). Thiefs must wait 15minutes before Stealing from the same player they have before.]], {"didy_aachb", "lockpick", "keypad_cracker" }, "thief", 6, 65, 0, false, false, function(ply) return ply:GetNWString("usergroup") == "donator" end)

Well sorry xD Thanks I hope this works :smiley:



    customCheck = function(ply) return CLIENT or
    table.HasValue({'vip', 'anotherdonatorrank?'}, ply:GetNWString('usergroup'))
    end,
    CustomCheckFailMsg = 'This job is donator only!',


Custom check with a fail message. I generally use this a lot. Heres an example:



    TEAM_EXAMPLE = DarkRP.createJob('Example Job', {
    color = Color(0, 0, 0, 255),
    model = 'models/player/group01/male_01.mdl',
    description = [[Example Job.]],
    weapons = {'weapon_ak472'},
    command = 'examplejob',
    max = 2,
    salary = 45,
    admin = 0,
    vote = false,
    hasLicense = false,
     customCheck = function(ply) return CLIENT or
    table.HasValue({'vip', 'anotherdonatorrank?'}, ply:GetNWString('usergroup'))
    end,
    CustomCheckFailMsg = 'This job is donator only!',
    })


Sorry so you want everything on one line? And it was an example. You could always modify it to your preference? Its there for future reference any way if users come across this topic looking for relevant questions. :rolleyes:

Ok thanks :smiley: Also could you try redo a Job for me with Multiple groups that can join it ? And its visible to everyone not just to them ?? Thanks :slight_smile:

[editline]2nd July 2014[/editline]

All on a single line also

What groups?

[editline]2nd July 2014[/editline]


 customCheck = function(ply) return CLIENT or
    table.HasValue({'vip', 'anotherdonatorrank?'}, ply:GetNWString('usergroup')) -- To add extra ranks, inside this part of code ({'vip', 'anotherdonatorrank?'} after 'anotherdonatorrank?' place a , and place the rank name inside two '' eg {'vip', 'anotherdonatorrank?', 'and another'}
    end,
    CustomCheckFailMsg = 'This job is donator only!', 

Its visible to all players anyway. Just put it all on one line. Not hard :slight_smile:

Ah ook thanks :smiley: