Hi, today I made a vip job and I realized that non-vip's can use them too. Simply by typing in chat: /vipthief [example]. So as I was trying to fix this, It actually removed all my jobs and basically broke darkrp.
Here was the original code, where users could spawn as a vip job. Keep in mind they couldn't spawn from the f4 menu, but when they typed it, it worked.
[lua] TEAM_MYSTERYTHIEF = AddExtraTeam("Mystery Thief", {
color = Color(3, 21, 48, 255),
VIPOnly = true,
model = "models/player/leet.mdl",
description = [[You are a mystery among most men, the only thing
people know about you is that you have the basic rules of that
of a normal thief, except you have way better weapons.]],
weapons = {"weapon_fists", "pro_lockpick_update", "weapon_lordi_wep_galil", "weapon_lordi_wep_deagle", "lockpick"},
command = "mysterythief",
max = 4,
salary = 1000,
admin = 0,
vote = false,
hasLicense = false,
candemote = true,
mysterythief = true,
mayorCanSetSalary = false,
PlayerSpawn = function(ply) ply:SetArmor(100) end,
}) [/lua]
And here is the code that broke the jobs.
[lua]
TEAM_MYSTERYTHIEF = AddExtraTeam("Mystery Thief", {
color = Color(3, 21, 48, 255),
VIPOnly = true,
model = "models/player/leet.mdl",
description = [[You are a mystery among most men, the only thing
people know about you is that you have the basic rules of that
of a normal thief, except you have way better weapons.]],
weapons = {"weapon_fists", "pro_lockpick_update", "weapon_lordi_wep_galil", "weapon_lordi_wep_deagle", "lockpick"},
command = "mysterythief",
max = 4,
salary = 1000,
admin = 0,
vote = false,
hasLicense = false,
candemote = true,
mysterythief = true,
mayorCanSetSalary = false,
customCheck = function(ply) return ply:IsUserGroup("vip") or ply:IsUserGroup("moderator") end
CustomCheckFailMsg = "You have to be vip to use this job, sorry.",
PlayerSpawn = function(ply) ply:SetArmor(100) end,
})
[/lua]
THIS URGENT PLEASE HELP! I even un did my actions and the jobs are still screwed up.
1. If you want to use lua tags, the first tag doesn't use a slash, and the second one does.
2. You need a comma after end on the customCheck.
[QUOTE=code_gs;46099110]1. If you want to use lua tags, the first tag doesn't use a slash, and the second one does.
2. You need a comma after end on the customCheck.[/QUOTE]
Yes yes thank you so much, but even if the code is right, my jobs is still screwed up... I dont know what to do., They aren't appearing
Post your whole fixed jobs code.
[editline]28th September 2014[/editline]
And any errors you have.
-snip-
Do NOT use AddExtraTeam. Read that wiki page I linked again.
[QUOTE=code_gs;46099359]Do NOT use AddExtraTeam. Read that wiki page I linked again.[/QUOTE]
Where?? Do I need to change it to DarkRP.createJob????
[editline]28th September 2014[/editline]
This still didn't work.. All of my jobs are still messed up!
Post your code again with the DarkRP.createJob
-snip-
I would say, just out of my OCD, don't make your Lua files capitalized...
[QUOTE=SwikCoder;46099746]I would say, just out of my OCD, don't make your Lua files capitalized...[/QUOTE]
They aren't, am just really scared right now because this is urgent
TEAM_SEWERDEMON, you have multiple models that aren't in a table.
[editline]28th September 2014[/editline]
TEAM_KILLFORCASH's CustomCheckFailMsg is also messed up:
[code] CustomCheckFailMsg = "This is KIllforcash's custom job. You are not allowed to use it. Sorry.", return CLIENT end[/code]
Sorry, you need to Log In to post a reply to this thread.