Hey i'm new to building and coding DarkRP but it seems quite easy iv'e created good jobs no errors got everything installed!
Now i'm not going to paste the whole error in here because it just says
[ERROR] Lua is unable to understand darkrp_customthings_jobs.lua because it's author has made a mistake on around line 46
Right before 'Officer', Lua expected to read a '>', but it didin't.
Hints:
- Did you forget a keyword?
- Did you forget a comma?
Here's my job code
TEAM_POLICEOFFICER = DarkRP.createJob ("Police Officer", {
color = Color(0,51,255.255),
model = {"models/player/fearless/sru01.mdl","models/player/fearless/sru02.mdl","models/player/nypd1940/male_01.mdl","models/player/nypd1940/male_02.mdl","models/player/nypd1940/male_03.mdl","models/player/nypd1940/male_04.mdl","models/player/nypd1940/male_05.mdl","models/player/nypd1940/male_06.mdl","models/player/nypd1940/male_07.mdl"}
description = [[Follow the police chiefs commands and help in Police Department Raids and in Criminal Investigation Raids, Protect the City and its People]],
weapons = {"arrest_stick","unarrest_stick","stunstick","door_ram","weaponchecker","fas2_glock20"},
command = "policeofficer",
max = 10,
salary = 50,
admin = 0,
vote = false,
hasLicense = true,
})
the model variable needs a comma at the end, try reading the hints next time.
By the looks of it, you're missing a comma after [i]male_07.mdl"}[/i]. Try this:
[lua]
TEAM_POLICEOFFICER = DarkRP.createJob ("Police Officer", {
color = Color(0,51,255),
model = {
"models/player/fearless/sru01.mdl",
"models/player/fearless/sru02.mdl",
"models/player/nypd1940/male_01.mdl",
"models/player/nypd1940/male_02.mdl",
"models/player/nypd1940/male_03.mdl",
"models/player/nypd1940/male_04.mdl",
"models/player/nypd1940/male_05.mdl",
"models/player/nypd1940/male_06.mdl",
"models/player/nypd1940/male_07.mdl"
},
description = [[Follow the police chiefs commands and help in Police Department Raids and in Criminal Investigation Raids, Protect the City and its People]],
weapons = {"arrest_stick","unarrest_stick","stunstick","door_ram","weaponchecker","fas2_glock20"},
command = "policeofficer",
max = 10,
salary = 50,
admin = 0,
vote = false,
hasLicense = true
})
[/lua]
also you did use an . instead of an , on color.
color = Color(0,51,255[B].[/B]255) should be color = Color(0,51,255[B],[/B]255)
Yea ive been getting new errors and fixing theese up its now showing all the corrupt jobs thanks for helping me
Im having one more problem tho says theres a problem in this job
PLEASE try to spot it for me <3
TEAM_GODFATHER = DarkRP.createJob("Godfather", {
color = Color(255,0,0,255),
model = {"models/player/vito.mdl"},
description = [[Your the leader of a Criminal Family with history of hostage and death, Lead your gang to victory and execute anyone that stands in your way of your goal]],
weapons = {"unarrest_stick","fas2_ragingbull"},
command = "godfather",
max = 1,
salary = 45,
admin = 0,
vote = false,
hasLicense = false,
})
[QUOTE=Ricci;47705263]Yea ive been getting new errors and fixing theese up its now showing all the corrupt jobs thanks for helping me
Im having one more problem tho says theres a problem in this job
PLEASE try to spot it for me <3
TEAM_GODFATHER = DarkRP.createJob("Godfather", {
color = Color(255,0,0,255),
model = {"models/player/vito.mdl"},
description = [[Your the leader of a Criminal Family with history of hostage and death, Lead your gang to victory and execute anyone that stands in your way of your goal]],
weapons = {"unarrest_stick","fas2_ragingbull"},
command = "godfather",
max = 1,
salary = 45,
admin = 0,
vote = false,
hasLicense = false,
})[/QUOTE]
Post the error.
This is not the place for DarkRP help. If you're having issues with creating DarkRP jobs, I suggest first looking at the error that the console spits at you. These are usually very detailed, telling you what kind of information you're missing, and on what like you can look at.
If looking at the error fails to help you, which it shouldn't, I'd then suggest looking for a comma after each statement. Make sure you have one.
Finally, if this is your first programming language, I recommend taking a coding 101 class. Learn the difference between strings, integers, booleans etc. I think that would definitely help.
lynda.com has some great classes that you can take. There's a monthly charge, but the content is just amazing. They offer pace-your-self classes (pre-recorded videos) on countless languages: PHP, HTML, CSS, C, C#, C++, Java, JavaScript etc. I'd recommend taking a look at something like that, even just a basic coding 101 video on youtube would be helpful.
[editline]14th May 2015[/editline]
Also, in the future please use [LUA] tags around your code. It just makes it easier for us to read quickly, and we can offer answers just that much quicker.
Oh my god...Fptje did an amazing system to show and format error codes so everybody can read it and people still asking for help?
Sorry, you need to Log In to post a reply to this thread.