• Errors when making custom classes donator only!
    11 replies, posted
Whenever I put in the line of code [code]customCheck = function(ply) return CLIENT = or ply:GetNWString("usergroup") == "donator" or ply:GetNWString("usergroup") == "moderator" end, customCheckFailMsg = "This job is for Donators only!"[/code] It keeps saying [ERROR]addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:114 Heres my jobs.lua: [code]/*-------------------------------------------------------- Default teams. If you make a team above the citizen team, people will spawn with that team! --------------------------------------------------------*/ TEAM_SWATLEADER = AddExtraTeam("Swat Leader", { color = Color(0, 102, 0, 255), model = "models/player/swat.mdl", description = [[Your the Swat Leader, in charge of all Swat and Civil Protection.]], weapons = {"weapon_mad_ump", "weapon_mad_deagle", "weapon_mad_m3", "weapon_fists", "arrest_stick", "unarrest_stick", "weaponchecker", "stunstick", "door_ram"}, command = "leader", max = 1, salary = 250, admin = 0, vote = false, hasLicense = true }) TEAM_SWAT = AddExtraTeam("Swat", { color = Color(0, 153, 0, 255), model = "models/player/combine_soldier.mdl", description = [[Complete the raids that the CP cannot.]], weapons = {"weapon_mad_m4", "weapon_mad_deagle", "arrest_stick", "weapon_fists", "unarrest_stick", "door_ram", "stunstick", "weaponchecker", "weapon_mad_charge"}, command = "swat", max = 3, salary = 200, admin = 0, vote = false, hasLicense = true }) TEAM_SWATSNIPER = AddExtraTeam("Swat Sniper", { color = Color(102, 102, 0, 255), model = "models/player/gasmask.mdl", description = [[Complete the raids that the CP cannot.]], weapons = {"weapon_mad_scout", "weapon_mad_usp_match", "arrest_stick", "weapon_fists", "unarrest_stick", "door_ram", "stunstick", "weaponchecker"}, command = "sniper", max = 3, salary = 200, admin = 0, vote = false, hasLicense = true }) TEAM_SECRETSERVICE = AddExtraTeam("Secret Service", { color = Color(0, 0, 153, 255), model = "models/player/barney.mdl", description = [[Protect the Mayor with your life!]], weapons = {"weapon_fists", "pocket", "keys", "stunstick", "weaponchecker", "unarrest_baton", "arrest_baton", "weapon_mad_mp5", "weapon_mad_usp", "door_ram"}, command = "secret", max = 2, salary = 80, admin = 0, vote = false, hasLicense = false }) TEAM_THIEF = AddExtraTeam("Thief", { color = Color(240, 240, 240, 255), model = "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/Group01/Female_07.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl", description = [[You're a thief and your job is to steal anything worth of value from the people of FFServers.]], weapons = {"weapon_fists", "pocket", "keys", "picklock"}, command = "thief", max = 4, salary = 80, admin = 0, vote = false, hasLicense = false }) TEAM_HITMAN = AddExtraTeam("Hitman", { color = Color(0, 255, 0, 255), model = "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/Group01/Female_07.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl", description = [[You're job as a Hitman is to take hits for a min of $1000 and kill that target as a living.]], weapons = {"weapon_fists", "pocket", "keys", "weapon_mad_usp"}, command = "hitman", max = 1, salary = 80, admin = 0, vote = false, hasLicense = false customCheck = function(ply) return CLIENT = or ply:GetNWString("usergroup") == "donator" or ply:GetNWString("usergroup") == "moderator" end, customCheckFailMsg = "This job is for Donators only!" }) TEAM_ADMIN = AddExtraTeam("Admin on Duty", { color = Color(255, 0, 0, 255), model = "models/player/combine_super_soldier.mdl", description = [[You are the admin on duty, goto users in need and help out.]], weapons = {"weapon_fists", "pocket", "keys", "picklock", "weaponchecker", "stunstick", "unarrest_baton"}, command = "admin", max = 2, salary = 0, admin = 1, vote = false, hasLicense = false }) TEAM_BANKER = AddExtraTeam("Banker", { color = Color(0, 102, 255, 255), model = "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/Group01/Female_07.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl", description = [[Store peoples printers for them. Don't steal money from the printers.]], weapons = {"weapon_fists", "pocket", "keys"}, command = "banker", max = 1, salary = 150, admin = 0, vote = true, hasLicense = false }) TEAM_GUARD = AddExtraTeam("Guard", { color = Color(0, 204, 255, 255), model = "models/player/odessa.mdl", description = [[You're job is to guard people that hire you.]], weapons = {"weapon_fists", "pocket", "keys", "weaponchecker", "stunstick"}, command = "guard", max = 4, salary = 150, admin = 0, vote = true, hasLicense = false }) TEAM_GUN = AddExtraTeam("Black Market", { color = Color(255, 204, 0, 255), model = "models/player/monk.mdl", description = [[See illegal weapons to the public]], weapons = {"weapon_fists", "pocket", "keys"}, command = "market", max = 2, salary = 100, admin = 0, vote = false, hasLicense = false }) TEAM_GUN = AddExtraTeam("Weapon Supplier", { color = Color(255, 255, 0, 255), model = "models/player/monk.mdl", description = [[You only sell weapon shipments to people.]], weapons = {"weapon_fists", "pocket", "keys"}, command = "supplier", max = 2, salary = 120, admin = 0, vote = false, hasLicense = false }) TEAM_TFF = AddExtraTeam("The First Three", { color = Color(102, 45, 0, 153), model = "models/player/phoenix.mdl", description = [[This is Frankie fords, Rolomacs and Toxinator's class. Anyone found using this class will automatically be banned.]], weapons = {"weapon_mad_ak47", "weapon_mad_usp", "weapon_mad_fists", "pocket", "keys"}, command = "frolinator", max = 3, salary = 500, admin = 2, vote = false, hasLicense = false }) /*--------------------------------------------------------------------------- Define which team joining players spawn into and what team you change to if demoted ---------------------------------------------------------------------------*/ GAMEMODE.DefaultTeam = TEAM_CITIZEN /*--------------------------------------------------------------------------- Define which teams belong to civil protection Civil protection can set warrants, make people wanted and do some other police related things ---------------------------------------------------------------------------*/ GAMEMODE.CivilProtection = { [TEAM_POLICE] = true, [TEAM_CHIEF] = true, [TEAM_MAYOR] = true } /*--------------------------------------------------------------------------- Jobs that are hitmen (enables the hitman menu) -----------------------
[QUOTE=Handsome Matt;43395380]it says more then [ERROR] addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:114 [editline]3rd January 2014[/editline] "CLIENT = or" is your syntax error anyway.[/QUOTE] so what do i need to replace it with to fix it? im a bit of a noob sorry
[lua]return CLIENT or [/lua]
[QUOTE=crazyscouter;43397213][lua]return CLIENT or [/lua][/QUOTE] that didn't work either heres a screenshot of what the error is saying [url]http://puu.sh/67Be9.png[/url] also note that i'm using ULX + ulib
Within the hitman group, the line above your code requires a comma at the end of it as it is part of a table. The line is [lua]hasLicense = false[/lua] There are other mistakes in there that won't throw errors but won't work as you expect, in several places you have [lua]model = "some/model", "some/model", "some/model"[/lua] when it should be [lua]model = { "some/model", "some/model", "some/model" }[/lua] Notice how the {} wrap around the whole bunch of them, making it one table.
thats done nothing and im still getting the same error, PLEASE LOOK AT THE SCREENSHOT. [url]http://puu.sh/67Be9.png[/url]
[QUOTE=Toxinator;43397679]thats done nothing and im still getting the same error, PLEASE LOOK AT THE SCREENSHOT. [url]http://puu.sh/67Be9.png[/url][/QUOTE] Go to line 109 and put a comma at the end of it.
[QUOTE=wh1t3rabbit;43397712]Go to line 109 and put a comma at the end of it.[/QUOTE] yes i've already done that... There are other mistakes in there that won't throw errors but won't work as you expect, in several places you have [lua]model = "some/model", "some/model", "some/model"[/lua] when it should be [lua]model = { "some/model", "some/model", "some/model" }[/lua] Notice how the {} wrap around the whole bunch of them, making it one table.[/QUOTE] that just created more errors
[QUOTE=Toxinator;43398018]yes i've already done that...[/QUOTE] Then paste your new code and make sure the error message is exactly the same or post a new one.
Dw all errors fixed besides donator jobs which still gives me the customCheck error
Which line is specifically 17? I can't see an issue.
Sorry, you need to Log In to post a reply to this thread.