esx_duty icon indicating copy to clipboard operation
esx_duty copied to clipboard

how to add duty to mechanicjob

Open yumaihiko opened this issue 5 years ago • 8 comments

i want to add mechanic to duty ,can teach me how to add mechanic duty? thx a lot!

yumaihiko avatar Jun 29 '19 03:06 yumaihiko

server\main.lua - Add this under offambulance

	elseif job == 'offmechanic' then
        xPlayer.setJob('mechanic', grade)
        TriggerClientEvent('esx:showNotification', _source, _U('onduty'))
	elseif job == 'offsecuritas' then
    end

client\main.lua

        local jobs = {
            'offambulance',
            'offpolice',
			'offmechanic',
            'police',
            'ambulance',
			'mechanic'
        }

insert into the database

INSERT INTO `jobs` (name, label) VALUES
  ('offmechanic', 'Off-Duty')
;

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
  ('offmechanic',0,'recrue','Off Duty',12,'{}','{}'),
  ('offmechanic',1,'novice','Off Duty',24,'{}','{}'),
  ('offmechanic',2,'experimente','Off Duty',36,'{}','{}'),
  ('offmechanic',3,'chief','Off Duty',36,'{}','{}'),
  ('offmechanic',4,'boss','Off Duty',48,'{}','{}')
;

Just edit and you can add more jobs. Just make sure you add the same amount of job_name that you have as normal job_name for every job.

Example my police jobs Screenshot from Gyazo

Duqino avatar Jul 12 '19 11:07 Duqino

Duqino kan je me helpen, want bij mij werkt het niet...

PS. ik weet dat je nl bent door je screens.

larscrazynl avatar Mar 07 '20 18:03 larscrazynl

Wat werkt er niet en krijg je een foutmelding in console (F8 en/of server console)

Duqino avatar Mar 07 '20 19:03 Duqino

Nee, ik had een oudere versie dus moest meerdere dingen aanpassen. Het werkt nu eigenlijk wel. Alleen als je politie, ambulance of anwb bent kan je op alle 3 de plekken wisselen. Bij politie "rondje" kan je van mechanic naar offmechanic veranderen ect...

larscrazynl avatar Mar 08 '20 10:03 larscrazynl

Dat is altijd al zo geweest.

Duqino avatar Mar 08 '20 10:03 Duqino

Bij mij werkt dit niet hmm

DennisFusha avatar Mar 31 '20 23:03 DennisFusha

how to add the location? to the Config.lua

ghost avatar Nov 04 '20 15:11 ghost

Dont work by me, add mechanic.. but no error, no message. he dont go off dutty

MisterAltDeleteDev avatar Feb 01 '22 01:02 MisterAltDeleteDev