#Adding jobs to shared jobs

1 messages · Page 1 of 1 (latest)

sour oracle
#

I am having trouble adding jobs to the qbcore shared jobs.lua file, I have copied and pasted the police job and only changed police to sheriff, hiway patrol etc but everytime I do it freezes and wont let characters load into the multicharacter I have.

swift fern
#

Do what "it" don't help us help you. Adding to jobs.lua shouldn't freeze server just throw error

flint notch
#

Hi Viking.

Could you explain what are you trying to achieve?

#

If you duplicate the police job in shared/jobs.lua and renaming it to "sheriff" or "highwayPatrol" and etc. this won't work by itself.

Functions across qbcore scripts are "hardcoded" to "police" job., so your server is freezing because multicharacter couldn't resolve the new job.

What you can do is:

Either add a grade label in your exsisting police job instance in jobs.lua

Or

Seperate job, which is quite tricky but not impossible.

You need to define it properly as it is in shared/jobs.lua

You would need to update qb-policejob and any dependent scripts like dispatch, garages, armory, duty and so on to also recognize "sheriff" or "highwayPatrol".

You would need to duplicate and adjust exports and conditions everywhere that currently checks only for "police"

I'd go for the first method since it's much easier and the other one is bit more advanced ( if you know what you're doing ).

sour oracle