Im not sure if this is the right section but,
im having some problems with my darkrp jobs.lua (for the darkrpmodification addon)
The custom jobs i put dont show up in the f4 menu, only the default ones do.
Heres my code:
[CODE]/*---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------
This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.
Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the job to this file and edit it.
The default jobs can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua
For examples and explanation please visit this wiki page:
http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
Add jobs under the following line:
---------------------------------------------------------------------------*/
TEAM_MOB = DarkRP.createJob("Hitman", {
color = Color(255, 10, 5, 255),
model = {"models/player/leet.mdl",}
description = {[[You're a Hitman, You take hits from clients.]],}
weapons = {"weapon_deagle2"},
command = "hman",
max = 3,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_HLORD = DarkRP.createJob("Hobo Lord", {
color = Color(102, 255, 255, 255),
model = {"models/player/charple01.mdl",}
description = [[You're a king amongst hobos!]],
weapons = {"weapon_bugbait", "lockpick"},
command = "hlord",
max = 1,
salary = 30,
admin = 0,
vote = true,
hasLicense = false
})
They cant take deposited items for themself!]], {}, "banker", 1, 50, 0, false, false)
TEAM_BJLOL = DarkRP.createJob("Bodyguard", {
color = Color(255, 255, 51, 255),
model = {"models/player/odessa.mdl",}
description = [[You're a bodyguard. People hire you to guard people or places.]],
weapons = {"weapon_fiveseven2", "stunstick",}
command = "bj",
max = 10,
salary = 30,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_THIEF = DarkRP.createJob("Thief", {
color = Color(0, 0, 0, 255),
model = {"models/player/Phoenix.mdl",}
description = [[You're a thief, you are allowed to raid and steal peoples things!]],
weapons = {"keypad_cracker", "lockpick",}
command = "thief",
max = 5,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_AOD = DarkRP.createJob("Admin On Duty", {
color = Color(255, 0, 0, 255),
model = {"models/player/combine_super_soldier.mdl",}
description = [[#2cool4school]],
weapons = {"lockpick", "admin_keypad_cracker",}
command = "aod",
max = 100,
salary = 50000,
admin = 1,
vote = false,
hasLicense = true
})
TEAM_SWAT = DarkRP.createJob("S.W.A.T", {
color = Color(80, 45, 0, 255),
model = {"models/player/swat.mdl",}
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker"},
command = "swat",
max = 3,
salary = 100,
admin = 0,
vote = true,
hasLicense = true,
})
TEAM_SWATC = DarkRP.createJob("S.W.A.T Cheif", {
color = Color(80, 45, 0, 255),
model = {"models/player/swat.mdl",}
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.
You can heal your team, but it's not optinal unless theres
no medics alive. If theres no mayor, you're in charge.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "med_kit"},
command = "swat",
max = 1,
salary = 200,
admin = 0,
vote = true,
hasLicense = true,
})
/*---------------------------------------------------------------------------
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,
[TEAM_SWAT] = true,
[TEAM_SWATC] = true,
}
/*---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------*/
DarkRP.addHitmanTeam(TEAM_MOB)
[/CODE]
Any help would be appreciated!
:smile:
I was gonna do it myself, but it'd be nice for you to learn yourself.
Take a look at the code and find EVERY comma mistake.
Here's one:
[lua] description = {[[You're a Hitman, You take hits from clients.]],} [/lua]
[QUOTE=Aeternal;44768445]I was gonna do it myself, but it'd be nice for you to learn yourself.
Take a look at the code and find EVERY comma mistake.
Here's one:
[lua] description = {[[You're a Hitman, You take hits from clients.]],} [/lua][/QUOTE]
I thought i fixed it, but it still dosen't work, heres my new code:
[CODE]/*---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------
This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.
Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the job to this file and edit it.
The default jobs can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua
For examples and explanation please visit this wiki page:
http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
Add jobs under the following line:
---------------------------------------------------------------------------*/
TEAM_MOB = DarkRP.createJob("Hitman", {
color = Color(255, 10, 5, 255),
model = {"models/player/leet.mdl",}
description = {[[You're a Hitman, You take hits from clients.]]}
weapons = {"weapon_deagle2"},
command = "hman",
max = 3,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_HLORD = DarkRP.createJob("Hobo Lord", {
color = Color(102, 255, 255, 255),
model = {"models/player/charple01.mdl",}
description = [[You're a king amongst hobos!]],
weapons = {"weapon_bugbait", "lockpick"},
command = "hlord",
max = 1,
salary = 30,
admin = 0,
vote = true,
hasLicense = false
})
TEAM_BJLOL = DarkRP.createJob("Bodyguard", {
color = Color(255, 255, 51, 255),
model = {"models/player/odessa.mdl",}
description = [[You're a bodyguard. People hire you to guard people or places.]],
weapons = {"weapon_fiveseven2", "stunstick",}
command = "bj",
max = 10,
salary = 30,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_THIEF = DarkRP.createJob("Thief", {
color = Color(0, 0, 0, 255),
model = {"models/player/Phoenix.mdl",}
description = [[You're a thief, you are allowed to raid and steal peoples things!]],
weapons = {"keypad_cracker", "lockpick",}
command = "thief",
max = 5,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_AOD = DarkRP.createJob("Admin On Duty", {
color = Color(255, 0, 0, 255),
model = {"models/player/combine_super_soldier.mdl",}
description = [[#2cool4school]],
weapons = {"lockpick", "admin_keypad_cracker",}
command = "aod",
max = 100,
salary = 50000,
admin = 1,
vote = false,
hasLicense = true
})
TEAM_SWAT = DarkRP.createJob("S.W.A.T", {
color = Color(80, 45, 0, 255),
model = {"models/player/swat.mdl",}
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker"},
command = "swat",
max = 3,
salary = 100,
admin = 0,
vote = true,
hasLicense = true,
})
TEAM_SWATC = DarkRP.createJob("S.W.A.T Cheif", {
color = Color(80, 45, 0, 255),
model = {"models/player/swat.mdl",}
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.
You can heal your team, but it's not optinal unless theres
no medics alive. If theres no mayor, you're in charge.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "med_kit"},
command = "swat",
max = 1,
salary = 200,
admin = 0,
vote = true,
hasLicense = true,
})
/*---------------------------------------------------------------------------
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,
[TEAM_SWAT] = true,
[TEAM_SWATC] = true,
}
/*---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------*/
DarkRP.addHitmanTeam(TEAM_MOB)
[/CODE]
There is more than that one. You still need the comma but just move it.
I cant see anything else wrong with the script, i followed the wiki's example script too and that didnt work.
Semi-Updated code:
[CODE]/*---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------
This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.
Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the job to this file and edit it.
The default jobs can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua
For examples and explanation please visit this wiki page:
http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
Add jobs under the following line:
---------------------------------------------------------------------------*/
TEAM_MOB = DarkRP.createJob("Hitman", {
color = Color(255, 10, 5, 255),
model = "models/player/leet.mdl",
description = [[You're a Hitman, You take hits from clients.]],
weapons = {"weapon_deagle2"},
command = "hman",
max = 3,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_HLORD = DarkRP.createJob("Hobo Lord", {
color = Color(102, 255, 255, 255),
model = "models/player/charple01.mdl",
description = [[You're a king amongst hobos!]],
weapons = {"weapon_bugbait", "lockpick"},
command = "hlord",
max = 1,
salary = 30,
admin = 0,
vote = true,
hasLicense = false
})
TEAM_BJLOL = DarkRP.createJob("Bodyguard", {
color = Color(255, 255, 51, 255),
model = "models/player/odessa.mdl",
description = [[You're a bodyguard. People hire you to guard people or places.]],
weapons = {"weapon_fiveseven2", "stunstick",}
command = "bj",
max = 10,
salary = 30,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_THIEF = DarkRP.createJob("Thief", {
color = Color(0, 0, 0, 255),
model = "models/player/Phoenix.mdl",
description = [[You're a thief, you are allowed to raid and steal peoples things!]],
weapons = {"keypad_cracker", "lockpick",}
command = "thief",
max = 5,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_AOD = DarkRP.createJob("Admin On Duty", {
color = Color(255, 0, 0, 255),
model = "models/player/combine_super_soldier.mdl",
description = [[#2cool4school]],
weapons = {"lockpick", "admin_keypad_cracker",}
command = "aod",
max = 100,
salary = 50000,
admin = 1,
vote = false,
hasLicense = true
})
TEAM_SWAT = DarkRP.createJob("S.W.A.T", {
color = Color(80, 45, 0, 255),
model = "models/player/swat.mdl",
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker"},
command = "swat",
max = 3,
salary = 100,
admin = 0,
vote = true,
hasLicense = true,
})
TEAM_SWATC = DarkRP.createJob("S.W.A.T Cheif", {
color = Color(80, 45, 0, 255),
model = "models/player/swat.mdl",
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
Do everything you can to keep the city safe.
You can heal your team, but it's not optinal unless theres
no medics alive. If theres no mayor, you're in charge.]],
weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "med_kit"},
command = "swat",
max = 1,
salary = 200,
admin = 0,
vote = true,
hasLicense = true,
})
/*---------------------------------------------------------------------------
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,
[TEAM_SWAT] = true,
[TEAM_SWATC] = true,
}
/*---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------*/
DarkRP.addHitmanTeam(TEAM_MOB)
[/CODE]
could you please point out whats wrong :(
[lua]description = {[[You're a Hitman, You take hits from clients.]]} [/lua]
hur durr -->
[lua]description = [[You're a Hitman, You take hits from clients.]], [/lua]
hurrr durrr!
{[[You're a Hitman, You take hits from clients.]]} = Nooo
[[You're a Hitman, You take hits from clients.]][B],[/B] = :)
[QUOTE=ds;44768662][lua]description = [[You're a Hitman, You take hits from clients.]], [/lua]
hur durr -->
[lua]description = [[You're a Hitman, You take hits from clients.]], [/lua]
hurrr durrr!
[[You're a Hitman, You take hits from clients.]][B],[/B] = :)[/QUOTE]
i dont understand what that means, it looks like the exact same thing
I was editing some stuff calm your panties. Pressed submit on accident.
[lua] weapons = {"weapon_fiveseven2", ="string">"stunstick",}
weapons = {"lockpick", ="string">"admin_keypad_cracker",}
[/lua]
There's two more
[lua]/*---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------
This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.
Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the job to this file and edit it.
The default jobs can be found here:
[url]https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua[/url]
For examples and explanation please visit this wiki page:
[url]http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields[/url]
Add jobs under the following line:
---------------------------------------------------------------------------*/
TEAM_MOB = DarkRP.createJob("Hitman", {
color = Color(255, 10, 5, 255),
model = "models/player/leet.mdl",
description = [[You're a Hitman, You take hits from clients.]],
weapons = {"weapon_deagle2"},
command = "hman",
max = 3,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_HLORD = DarkRP.createJob("Hobo Lord", {
color = Color(102, 255, 255, 255),
model = "models/player/charple01.mdl",
description = [[You're a king amongst hobos!]],
weapons = {"weapon_bugbait", ="string">"lockpick"},
command = "hlord",
max = 1,
salary = 30,
admin = 0,
vote = true,
hasLicense = false
})
TEAM_BJLOL = DarkRP.="function call">createJob("Bodyguard", {
color = Color(255, 255, 51, 255),
model = "models/player/odessa.mdl",
description = [[You're a bodyguard. People hire you to guard people ="keyword">or places.]],
weapons = {"weapon_fiveseven2", ="string">"stunstick"},
command = "bj",
max = 10,
salary = 30,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_THIEF = DarkRP.createJob("Thief", {
color = Color(0, 0, 0, 255),
model = "models/player/Phoenix.mdl",
description = [[You're a thief, you are allowed to raid ="keyword operator">="keyword">and steal peoples things!]],
weapons = {"keypad_cracker", "lockpick"},
command = "thief",
max = 5,
salary = 50,
admin = 0,
vote = false,
hasLicense = false
})
TEAM_AOD = DarkRP.createJob("Admin On Duty", {
color = Color(255, 0, 0, 255),
model = "models/player/combine_super_soldier.mdl",
description = [[#2cool4school]],
weapons = {"lockpick", ="string">"admin_keypad_cracker"},
command = "aod",
max = 100,
salary = 50000,
admin = ="constant numeric">1,
vote = false,
hasLicense = true
})
TEAM_SWAT = DarkRP.createJob("S.W.A.T", {
color = Color(="constant numeric">80, 45, 0, 255),
model = "models/player/swat.mdl",
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
="keyword operator">="keyword operator">="keyword operator">="keyword operator">="keyword operator">="keyword">Do everything you can to keep the city safe.]],
weapons = {"arrest_stick", ="string">"unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker"},
command = "swat",
max = 3,
salary = 100,
admin = 0,
vote = true,
hasLicense = true,
})
TEAM_SWATC = DarkRP.createJob("S.W.A.T Cheif", {
color = Color(80, 45, 0, 255),
model = "models/player/swat.mdl",
description = [[Your duty is to heal on of your
wounded operatives. You should stay in the PD
until backup is needed.
="keyword operator">="keyword operator">="keyword operator">="keyword">Do everything you can to keep the city safe.
You can heal your team, but it's not optinal unless theres
no medics alive. ="keyword operator">="keyword operator">="keyword operator">="keyword">If theres no mayor, you're in charge.]],
weapons = {"arrest_stick", ="string">"unarrest_stick", "weapon_glock2", "weapon_ak472", "ls_sniper", "weapon_m42", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "med_kit"},
command = "swat",
max = 1,
salary = 200,
admin = 0,
vote = true,
hasLicense = true,
})
/*---------------------------------------------------------------------------
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,
[TEAM_SWAT] = true,
[TEAM_SWATC] = true,
}
/*---------------------------------------------------------------------------
Jobs that are hitmen (enables the hitman menu)
---------------------------------------------------------------------------*/
DarkRP.addHitmanTeam(TEAM_MOB)[/lua]
That should work as long as I fixed all of the commas.
Look at what Aeternal posted above it shows what was wrong.
weapons = {"weapon_fiveseven2", ="string">"stunstick",} = incorrect
weapons = {"weapon_fiveseven2", ="string">"stunstick"}, = correct
I got this error:
[ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:31: unexpected symbol near '='
1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0
The jobs still dont show up in the menu
[editline]9th May 2014[/editline]
Bump please help
I just went ahead and redid the whole thing :v:
-snip the code kept bugging-
[URL="http://pastebin.com/TDy9kaY0"]Reuploaded[/URL]
Sorry, you need to Log In to post a reply to this thread.