Hi, I have problems with my shared.lua

Hello, First of all i hope this post is in the right group :slight_smile:

Secound off all, hi everyone. i have this problem, i tryed to make some custom jobs, but it just didnt went very well. When i go ingame my server and press f4, i dont see any jobs at all after i edited shared.lua i looked it through 100 times but i couldnt see what went wrong.

So will anyone look at it please :slight_smile:

[LUA]/*--------------------------------------------------------
Default teams. If you make a team above the citizen team, people will

spawn with that team!
--------------------------------------------------------*/
TEAM_CITIZEN = AddExtraTeam(“Citizen”, Color(20,

150, 20, 255), “models/player/group01/male_01.mdl”, [[The Citizen is the most basic level of society you can hold
besides being a

hobo.
You have no specific role in city life.]], {}, “citizen”, 0, 45, 0, false, false)

TEAM_POLICE = AddExtraTeam(“Police”, Color

(25, 25, 170, 255), “models/player/police.mdl”, [[The protector of every citizen that lives in the city .
You have the power to

arrest criminals and protect innocents.
Hit them with your arrest baton to put them in jail
Bash them with a stunstick and they

might learn better than to disobey
the law.
The Battering Ram can break down the door of a criminal with a warrant
for his/her

arrest.
The Battering Ram can also unfreeze frozen props(if enabled).
Type /wanted <name> to alert the public to this criminal
OR go

to tab and warrant someone by clicking the warrant button]], {“arrest_stick”, “unarrest_stick”, “weapon_glock2”, “stunstick”,

“door_ram”, “weaponchecker”}, “cp”, 4, 65, 0, true, true)

TEAM_GANG = AddExtraTeam(“Gangster”, Color(75, 75, 75, 255),

“models/player/group03/male_01.mdl”, [[A Gangstar follow his mobboss, the mobboss chose a agenda and you have to follow it!]],

{weapon_glock2}, “gangster”, 3, 45, 0, false, false)

TEAM_MOB = AddExtraTeam(“Mob boss”, Color(25, 25, 25, 255),

“models/player/gman_high.mdl”, [[The Mobboss is the boss of the criminals in the city.
With his power he coordinates the gangsters

and forms an efficent crime
organization.
He has the ability to break into houses by using a lockpick.
The Mobboss also can

unarrest you.]], {“lockpick”, “unarrest_stick”, “weapon_usp”}, “mobboss”, 1, 60, 0, false, false)

TEAM_GUN = AddExtraTeam("Weapon

Seller", Color(255, 140, 0, 255), “models/player/monk.mdl”, [[A Weapon seller sels guns in a hided place, since is unlegal to have

guns you are not allowed to sell them so watch out for cops!]], {}, “gundealer”, 2, 45, 0, false, false)

TEAM_MEDIC = AddExtraTeam

(“Medic”, Color(47, 79, 79, 255), “models/player/kleiner.mdl”, [[With your medical knowledge, you heal players to proper
health.
Without a medic, people can not be healed.
Left click with the Medical Kit to heal other players.
Right click with the Medical Kit

to heal yourself.]], {“med_kit”}, “medic”, 3, 45, 0, false, false)

TEAM_COOK = AddExtraTeam(“Burger King Owner”, Color(238, 99, 99,

255), “models/player/mossman.mdl”, [[As The Owner of burger king you have to make sure everyone is full of food, since noone can

survieve without food.]], {}, “cook”, 2, 45, 0, 0, false)

TEAM_CHIEF = AddExtraTeam(“Police Officer”, Color(20, 20, 255, 255),

“models/player/combine_soldier_prisonguard.mdl”, [[A Police Officer have the power to give orders to his men, you are the the

person who decide where the jail position are, (type /jailpos)]], {“arrest_stick”, “unarrest_stick”, “weapon_deagle2”,

“stunstick”, “door_ram”, “weaponchecker”}, “chief”, 1, 75, 0, false, true, TEAM_POLICE)

TEAM_MAYOR = AddExtraTeam(“Mayor”, Color

(150, 20, 20, 255), “models/player/breen.mdl”, [[You are the mayor, you have to be sure the people of your city is having it

well.]], {}, “mayor”, 1, 85, 0, true, false/, {TEAM_CHIEF, TEAM_POLICE}/)
/*

HOW TO MAKE AN EXTRA CLASS!!!

You can make extra classes here. Set everything up here and the rest will

be done for you! no more editing 100 files without knowing what you’re doing!!!
Ok here’s how:

To make an extra class do this:
AddExtraTeam( “<NAME OF THE CLASS>”, Color(<red>, <Green>, <blue>, 255), “<Player model>” , [[<the description(it can have

enters)>]], { “<first extra weapon>”,"<second extra weapon>", etc…}, “<chat command to become it(WITHOUT THE /!)>”, <maximum

amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to

become it>, true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)

The real example

is here: it’s the Hobo: */

–VAR without /!!! The name the color(what you see in tab)

the player model The description
TEAM_HOBO = AddExtraTeam(“Hobo”, Color(80, 45, 0, 255),

“models/player/corpse1.mdl”, [[The lowest member of society. All people see you laugh.
You have no home.
Beg for your food and

money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or
outside someone else’s door]],

{“weapon_bugbait”}, “hobo”, 5, 0, 0, false)
//No extra weapons say /hobo to become hobo Maximum hobo’s = 5

his salary = 0 because hobo’s don’t earn money. 0 = everyone can become hobo , false = you don’t have to vote to

become hobo
// MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
// TEAM_/DUDE IS WROOOOOONG !!!
// HAVING

“/dude” IN THE COMMAND FIELD IS WROOOOOOOONG!!!
//ADD TEAMS UNDER THIS LINE:

TEAM_SWAT = AddExtraTeam(“Swat”, Color(51,0,255,255), “model/player/combine.mdl”, [[As S.W.A.T it is your job to bust the drug

dealers and make sure nothing seriously illegal is going on.
]], {weapon_shotgun, weapon_mp52}, “SWAT”, 5, 80,
, true)
TEAM_THIEF = AddExtraTeam(“Thief”, Color(153,153,51,255), “models/player/group03/male_02.mdl”, [[
You are th crook of the town , you can be hired or just steal for fun you choose.
]], {“weapon_lockpick”,“weapon_keypad_cracker”}, “THIEF”, 4, 50, 0, true)
TEAM_SWATLDR = AddExtraTeam(“Swat Leader”, Color(51,0,255,255), “models/player/combine_soldier.mdl”, [[As SWAT LEADER it is to

order your men around and make the city a safe place.
]], {weapon_m42, weapon_deagle}, “SWATLDR”, 1, 90,
, true)
TEAM_GUARD = AddExtraTeam(“Bodyguard”, Color(0,0,51,255), “models/player/barney.mdl”, [[You are hired to protect and serve!
]], {weapon_glock2}, “GUARD”, 3, 60, 0, false)
TEAM_HIT = AddExtraTeam(“Hitman”, Color(153,153,153,255), “models/players/group02/male_01.mdl”, [[
You kill unwanted people for a price, YOU MUST ONLY kill if you got payed for it!
]], {weapon_deagle}, “HIT”, 3, 40, 0, true)
TEAM_BUILD = AddExtraTeam(“Builder”, Color(51,204,255,255), “models/players/alyx.mdl”, [[
You build things for people, for money of course.
]], {gmod_tool}, “BUILD”, 3, 60, 0, false)
TEAM_PRIVATE = AddExtraTeam(“Private Eye”, Color(0,0,0,255), “models/player/gman_high.mdl”, [[
You spy on people for money, you know just about everything in teh city.
]], {“weapon_glock2”}, “PRIVATE”, 2, 60, 0, true)

TEAM_SWAT = AddExtraTeam(“SWAT”, Color(0, 0, 255, 180), “models/player/urban.mdl”, [[You are set in by the cops in hard cases!]],

{“weapon_glock2”,“weapon_m42”,“door_ram”,“stunstick”,“unarrest_stick”,“arrest_stick”,“taser”,“talk”}, “swat”, 5, 150, 0, true)
//
TEAM_swat_sniper = AddExtraTeam(“swat_sniper”, Color(51,53,23,255),“models/player/riot.mdl”, [[Gives sense.]],

{“ls_sniper”,“weapon_glock2”,“talk”}, “sniper”, 1, 150, 0, true)
//[/LUA]

Btw, i dont get any console or lua errors ingame.

Thank you really much.

add “//” or “–[[CONTENT]]” when commenting things.

Check line 132 and 137.

Lots of strings making me confused.

It’s actually commented, but the lua highlighter doesn’t line up correctly, that’s my guess.

To much spacing [lua]TEAM_CITIZEN = AddExtraTeam(“Citizen”, Color(20,

150, 20, 255), “models/player/group01/male_01.mdl”, [[The Citizen is the most basic level of society you can hold
besides being a

hobo.
You have no specific role in city life.]], {}, “citizen”, 0, 45, 0, false, false)[/lua]
Needs to be.

[lua]TEAM_CITIZEN = AddExtraTeam(“Citizen”, Color(20, 150, 20, 255), “models/player/group01/male_01.mdl”, [[The Citizen is the most basic level of society you can hold
besides being a hobo. You have no specific role in city life.]], {}, “citizen”, 0, 45, 0, false, false)[/lua]

Thanks everyone, i will try to fix the things :slight_smile:

[editline]07:46AM[/editline]

Dammit, it still doesnt work with the things you guys said. :frowning:
Anyone else have some ideas maybe?

Thanks :smiley:

Is your darkrp at the newest revision?

The newest version, up to date

Whenever stuff doesn’t work it means there is an error. To get them fixed do the following :
Test in create multiplayer and take note of any lua errors in the console that are related to the script. If you can’t figure it out post the error here as well as the whole file it is occuring on, highlight the line with an error if possible. If you do that I can guarantee the issue will be found.
And make sure you search the whole console, not just the bottom part.

I see the problem!
on line 141:

TEAM_SWAT = AddExtraTeam(“Swat”, Color(51,0,255,255), “model/player/combine.mdl”, [[As S.W.A.T it is your job to bust the drug

dealers and make sure nothing seriously illegal is going on.

]], {weapon_shotgun, weapon_mp52}, “SWAT”, 5, 80,

See where is says {weapon_shotgun,weapon_mp52} well it should be like this {“weapon_shotgun”,“weapon_mp52”}
Any time there is a mistake look at all your custom jobs because if you miss a comma or a quotation it messes up everything.

I saw that a lot of other jobs are missing this so this should fix it.

Ty heylolwut im going to test it later today

Okay, i tried it out: still doesnt work, im trying it in singleplayer,

[editline]02:05PM[/editline]

Okay, im uploading it here: http://www.garrysmod.org/downloads/?a=view&id=94034

So can anyone please look through it all, and edit it. please i need help with this.

[editline]02:23PM[/editline]

But thanks everyone so far :slight_smile:

[editline]02:54PM[/editline]

I know this sounds silly but im willing to give admin for the working lua.

So please guys, i really need it. please :slight_smile:

Noone?

So… Many… Damned… Errors…

Take a look at the code from line 65 down. You have randomly commented lines, with small bits of functions still there.

If you had just done what Crazy Quebec had said, you would have found that almost instantly. :sigh:

Lines that aren’t properly commented/needed:
115, 130, 132, 137, 169, 173.

You also have way too many line breaks. It might be wordwrap (which you should turn off) but
Line 55~59:
[lua]TEAM_GUN = AddExtraTeam("Weapon

Seller", Color(255, 140, 0, 255), “models/player/monk.mdl”, [[A Weapon seller sels guns in a hided place, since is unlegal to have

guns you are not allowed to sell them so watch out for cops!]], {}, “gundealer”, 2, 45, 0, false, false)[/lua]

Should only be one line:
[lua]TEAM_GUN = AddExtraTeam(“Weapon Seller”, Color(255, 140, 0, 255), “models/player/monk.mdl”, [[A Weapon seller sels guns in a hided place, since is unlegal to have guns you are not allowed to sell them so watch out for cops!]], {}, “gundealer”, 2, 45, 0, false, false)[/lua]

^^^ This isn’t just the only place where you used too many line breaks. The whole file is drowned in unnecessary line breaks. Like you had a line break orgasm.

Thanks to you too, i fixed it, its work now sort of, when i press f4 on my server and choose a job, nothing happens. except i type /cp or /cook and so on. im going to upload the new one:

[editline]11:39AM[/editline]