[delete] Having 2 jobs

Added a new step in the description, look for it

1 Like

So I’m having a problem with the 2 Jobs system. I have edited all the files as described and every time it loads my character and everybody else into an NPC. It gave me 0 erros in console. I have double checked all the process and cant figurer it out :frowning:

[RESOLVED] [MISS ONE STEP]

Beautifull !! Now it’s work perfectly with esx_society and bossmenu for setjob and promote/hire/fire The job 1 and job2 ! Just amazing ! Thank you very much ! :slight_smile:
Just 1 problem. i cant see the money for job 1 AND job 2. but it’s refresh when we put some money ( or buy or withdraw)

i will try the peycheck system now. Thank you !

1 Like

good evening after a few days to redo the double job on my serve it finally works but I have one thing to ask you is that there are of you who has concerns with the paycheck I receive nothing of all if you can help me thank you all is still thank you the double job tomtom

Error running call reference function for resource es_extended: citizen:/scripting/lua/scheduler.lua:351: server/main.lua:222: attempt to index a nil value (field ‘?’)
stack traceback:
server/main.lua:222: in upvalue ‘ref’
citizen:/scripting/lua/scheduler.lua:337: in function citizen:/scripting/lua/scheduler.lua:336
[C]: in function ‘xpcall’
citizen:/scripting/lua/scheduler.lua:336: in function citizen:/scripting/lua/scheduler.lua:335
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:351: in function citizen:/scripting/lua/scheduler.lua:322
[ERROR] [MySQL] Check the error above, an error happens when executing the callback from the query : “SELECT * FROM job_grades WHERE job_name = @job_name AND grade = @grade {@job_name=unemployed2}”

Get that error, work without DBG_Lesterjobs work with esx_policejob

Its possible that you insert your files in pastebin / hastebin and give us the links, please?

Myabe because DBG_Lesterjobs sets the job 1 and you are trying to attribute the unemployed2 to the job 1
So you may edit DBG_Lesterjobs to make it pointing the job 2 .
(unemployed2 is when you have no job as JOB 2 )

good evening someone has already had trouble i do not get the salary is when i put back normal i get the job pay but if i but the function pay with job is job2 i have nothing is i have no information if anyone one had the same problem is if he can explain to me how to solve thank you to all

Hi Guys.
I have a problem on my server, with the ESX drugs system. AFter i installed all the step for 2 jobs, i got everything to work perfectly, But the police can now pick up drugs, even though they couldn’t do it before i did this 2 jobs.

Anyone have an idea how to fix that?

PS. Sorry about bad grammar, hope you get my question

  1. If you want that the job 2 is taking into account in scoreboards (to count policemen) you will have to edit the code etc…

If you read the description you may see that each script that verify

if PlayerData.job~=nil ... then  .......

have to be modified. BR

Hello, Ive changed all my scripts to as it is above, yet the second job insnt coming up when in game. I only have the one job? Ive done eveything that was said, I have no errors when I boot the game up, and while in game I have no errors?

Anyone else had this issue, I know it could be anything but if you have an idea id appreshiate a response.

Thank

its not running, to mutch to read, maybe the owner of this topic can please update it?

Maybe because you missed something, too much to ready for someone not interested in learning how things are done but looking for a drag and drop ressource that this post isn’t, nope only update it if I forgot something or did a mistake.

PS: The double job is a modification of the ESX framework, its not an independent ressource.
You saddly have to know a minimum of things. And I think that minimum is really appropriate according to the description I’ve done.

PS 2: The only one thing that is missing is the way to attribute the second job to a player without the /setjob2 command.
I’ve shared a way to do it, use DBG_LesterJobs and modify it (I’m not allowed to release a modification of his script) (Never asked for it) :

DBG_LesterJobs (the second job office from Santagain, for which I’ve never asked permission for editing and releasing modifications)

BR

I think so long to be there, that when it is published, that you do not have to work through 200 postings to get to a result. However thank you for this unqualified answer. Of course, I have already worked with the rescoure

Not a bad script at all! 100% will use!

? Still don’t understand the meaning of your unqualified remark. Maybe your remark was usefull for the topic or for helping someone but I missed that.
BR

So I done every step…we did it in twos and threes with six experienced eyes…it’s still not working. I don’t know what we did wrong. I uploaded my steps in Guthub, maybe one can look over it and see an error, fork and correct it, please.

Error:

  • I spawn as Tony Hawk
  • The Job, Mony, Bank and Job two I don’t see
  • /setjob 1 police 3 > Player not online.
  • /setjob2 testjob 0 > not working

Github:
All scripts have been downloaded and edited. I have only the edited files in the folders. I did not create the scripts and they do not belong to me, but to the creator!

To check file between fix and original I use Beyond Compare 4.

GreetZ
NebelRebell

So I done every step

nope sry :slight_smile:

-You spawn in Tony Hawk I think because you have a jobs2 and jobs_grade2 tables. You just have to insert into the jobs table the unemployed2 and not create 2 new tables.

Step 1 and 2:

1) Create a new job
Database -> jobs table -> add a new job in the jobs table (unemployed is for the job 1, unemployed2 will be used for the job 2)
2

2) Create a new job grade
Database -> job_grades table -> add a new grade

When you set the job 2 it will pick the job and the grade from the jobs table not from a jobs2 table
I forwarded few commits on your files but as you said “with six experienced eyes” you should see others mistakes like forgetting to modify

if PlayerData.job ~=nil and PlayerData.job.name==‘police’ then

With

if (PlayerData.job ~=nil and PlayerData.job.name==‘police’) or (PlayerData.job2 ~=nil and PlayerData.job2.name==‘police’) then

BR hope it will help

i will check, thx for helping, now I’m in the garden write later - sometimes you do not see the forest because there are too many trees in the way…

Step 1 and 2:


…where is the board in front of your head?!

Step 3 alos done…


…where ist here, please, my mistake?

Thx for HELPING…

1 Like

Why create table jobs2 ?
Why create table job_grades2 ?

You have already a jobs and jobs_grade table.
You have to insert into the

  • table JOBS : unemployed2
  • table JOBS_GRADES : unemployed2 0 0 {} {}

Look near the end of police job client.lua

ALTER TABLE `users`
	ADD COLUMN `job2` varchar(255) NULL DEFAULT 'unemployed2' AFTER `job_grade`,
	ADD COLUMN `job_grade2` INT NULL DEFAULT 0 AFTER `job2`
;


INSERT INTO `jobs` VALUES ('unemployed2','Arbeitslos');
INSERT INTO `job_grades` VALUES ('unemployed2','Arbeitslos','Arbeitslos',0,{},{});

no more things needed in the sql

Oh man…hope that was my wooden board in front of my eyes…will test and wrote back