Fixing job code for VIP!! Please help me


TEAM_MAFIA = AddExtraTeam("Mafia", Color(255, 255, 255, 255), {"models/player/Suits/male_02_closed_tie.mdl", "models/player/Suits/male_01_shirt_tie.mdl", "models/player/Suits/male_04_open_waistcoat.mdl", "models/player/Suits/male_07_open_tie.mdl"}, [[Sell Illegal items to the Public.]], {"lockpick", "m9k_val", "m9k_contender", "keypad_cracker"}, "mafia", 6, 65, 0, false, false, false, customCheck = function(ply) return CLIENT ortable.HasValue({'Bronze', 'Silver', 'Gold', 'Diamond'}, ply:GetNWString('usergroup') end,  CustomCheckFailMsg = 'This job is donator only!',)

Can someone help me This worked before I added the donator part can someone point out whats wrong or even give me a new version fixed in the same format as that one ? thanks :smiley:


return CLIENT ortable

There’s your error.

Thanks you :slight_smile:

[editline]3rd July 2014[/editline]


TEAM_MAFIA = AddExtraTeam("Mafia", Color(255, 255, 255, 255), {"models/player/Suits/male_02_closed_tie.mdl", "models/player/Suits/male_01_shirt_tie.mdl", "models/player/Suits/male_04_open_waistcoat.mdl", "models/player/Suits/male_07_open_tie.mdl"}, [[Sell Illegal items to the Public.]], {"lockpick", "m9k_val", "m9k_contender", "keypad_cracker"}, "mafia", 6, 65, 0, false, false, false, customCheck = function(ply)HasValue({'Bronze', 'Silver', 'Gold', 'Diamond'}, ply:GetNWString('usergroup') end,  CustomCheckFailMsg = 'This job is donator only!',)

Still doesnt work ?? :confused:

You’re using table.HasValue() wrong.

I dont understaind Could you maybe give me the job and fix it for me? Thanks :smiley:

“ortable” is nothing. “or table” is…

Don’t come here and ask people to fix your code for you


TEAM_MAFIA = AddExtraTeam("Mafia", Color(255, 255, 255, 255), {"models/player/Suits/male_02_closed_tie.mdl", "models/player/Suits/male_01_shirt_tie.mdl", "models/player/Suits/male_04_open_waistcoat.mdl", "models/player/Suits/male_07_open_tie.mdl"}, [[Sell Illegal items to the Public.]], {"lockpick", "m9k_val", "m9k_contender", "keypad_cracker"}, "mafia", 6, 65, 0, false, false, false, customCheck = function(ply) return CLIENT or table.HasValue({'Bronze', 'Silver', 'Gold', 'Diamond'}, ply:GetNWString('usergroup') end,  CustomCheckFailMsg = 'This job is donator only!',)

This doesnt work sadly :confused:




	customCheck = function(ply) return CLIENT or ply:GetUserGroup() == "bronze" or ply:GetUserGroup() == "silver" or ply:GetUserGroup() == "gold" or ply:GetUserGroup() == "diamond" or ply:IsAdmin() end,
	CustomCheckFailMsg = "Donate to use this job!"




Really not that big of a stump …

Instead of all those ifs and ors you could just show him how to use table.HasValue properly so he won’t have to make a thread for that in the future?

The wiki shows how to do it fine. Whether or not he pulls his head out of his ass and looks at it is up to him.


TEAM_MAFIA = AddExtraTeam("Mafia", Color(255, 255, 255, 255), {"models/player/Suits/male_02_closed_tie.mdl", "models/player/Suits/male_01_shirt_tie.mdl", "models/player/Suits/male_04_open_waistcoat.mdl", "models/player/Suits/male_07_open_tie.mdl"}, [[Sell Illegal items to the Public.]], {"lockpick", "m9k_val", "m9k_contender", "keypad_cracker"}, "mafia", 6, 65, 0, false, false, false, customCheck = function(ply) return CLIENT or ply:GetUserGroup() == "bronze" or ply:GetUserGroup() == "silver" or ply:GetUserGroup() == "gold" or ply:GetUserGroup() == "diamond" or ply:IsAdmin() end, CustomCheckFailMsg = "Donate to use this job!")

I appreciate everybodys help but none of these have worked :’(

Can you tell us the error instead of saying “it doesn’t work”

And then after this invest some time into learning Lua so you don’t have to beg on a forum for help



local VIPRanks = {
"bronze",
"silver",
"gold",
"diamond",
"admin",
"superadmin"
}

TEAM_MAFIA = DarkRP.createJob("Mafia", {
    color = Color(238, 99, 99, 255),
    model = {"models/player/Suits/male_02_closed_tie.mdl", 
    "models/player/Suits/male_01_shirt_tie.mdl", 
    "models/player/Suits/male_04_open_waistcoat.mdl", 
    "models/player/Suits/male_07_open_tie.mdl"}, 
    description = [[Sell Illegal items to the Public.]],  
    weapons = {"lockpick", "m9k_val", "m9k_contender", "keypad_cracker"}, 
    command = "mafia", 
    max = 6, 
    salary = 65,
    admin = 0, 
    vote = false, 
    hasLicense = false,
    customCheck = function(ply) return table.HasValue(VIPRanks, ply:GetUserGroup()) end,
    CustomCheckFailMsg = "This job is VIP only!"
})


For reference next time: http://wiki.darkrp.com/index.php/Donator_Job_configuration

The error is the jobs dont work when I add it all jobs dissapear and Lolcats I dont use that format for my jobs sadly :frowning:

Oh for gods sake.

Everyone’s commenting but no one actually giving you the answer.

First of all: You are using an outdated method. You are either using DarkRP 2.5 with the old 2.4.3 functions, which could be one of the reason it breaks. It’d error out at the place where you call the function AddExtraTeam as it doesn’t exist in DarkRP 2.5

If it’s not that, and you are indeed using the old DarkRP, your problem is the following:
You forgot a space between ‘or’ and ‘table’. You type ‘ortable’, and since ‘ortable’ doesn’t exist, it errors.
As soon as you would have fixed that error, there is another problem you’re facing. You forgot to close the table.HasValue() function. You pass the first parameter, which is a table consisting all your donator groups. That’s followed by a comma and the GetNWString(‘usergroup’) followed by ‘end’. End closes a statement (if, else, for, etc). You can’t close a statement while you did not close your function call.

So, I fixed your coded, added indentation and placed everything on a new line. I don’t know which value is what, but at least your problem is solved.


TEAM_MAFIA = AddExtraTeam(
	"Mafia", 
	Color(255, 255, 255, 255), 
	{
		"models/player/Suits/male_02_closed_tie.mdl", 
		"models/player/Suits/male_01_shirt_tie.mdl", 
		"models/player/Suits/male_04_open_waistcoat.mdl", 
		"models/player/Suits/male_07_open_tie.mdl"
	}, 
	[[Sell Illegal items to the Public.]], 
	{
		"lockpick", 
		"m9k_val", 
		"m9k_contender", 
		"keypad_cracker"
	}, 
	"mafia", 
	6, 
	65, 
	0, 
	false, 
	false, 
	false, 
	customCheck = function(ply) return CLIENT or table.HasValue({'Bronze', 'Silver', 'Gold', 'Diamond'}, ply:GetNWString('usergroup')) end,
											--  /\ you forgot a space here                                       you forgot a ) here /\
	CustomCheckFailMsg = 'This job is donator only!'
)

If this doesn’t solve your problem, read the wiki