[Help] Check job from jobs-system

Hello guys !
I’m stuck actually and I want a little help from the community :blush: I"m working on a job “Postman”, I try to make him compatible to job-system.
The original script come from to PoolJob from the opensource Lalife.

Client.lua

postman_client.lua (14.8 KB)

[details=In jobsystem]I add this in jobs-system :

RegisterServerEvent('jobssystem:jobs')
AddEventHandler('jobssystem:jobs', function()
  TriggerEvent('es:getPlayerFromId', source, function(user)
        TriggerClientEvent("check:getJobs", source, user:getJob())
  end)
end)

[/details]

[details=Job.lua] I changed

local myjob = 0

RegisterNetEvent("mine:getJobs")
AddEventHandler("mine:getJobs", function(job)
  myjob = job
end)

to

local myjob = 0

RegisterNetEvent("check:getJobs")
AddEventHandler("check:getJobs", function(job)
	myjob = job
end)
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if IsControlJustPressed(1,38) and inrangeofpool3 then
			TriggerServerEvent("poleemploi:getjobs")
			Wait(100)
			if jobId == 8 then

to

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if IsControlJustPressed(1,38) and inrangeofpool3 then
			TriggerServerEvent("jobssystem:jobs")
			Wait(100)
			if jobId == 8 then

but not working :frowning:
[/details]

1 Like

Maybe you will have more ansers by explaining what you are trying to do and what the script actually do.
Or comment your code.
Also, I will not help you, just because I need to DL something, you could use pastebin

Objective

  • Create new job for “Lalife” and jobs-system
    If we can adapt this script to jobs-system we can make a lot of job with “mission” like taxi, Pizza delivery, administrative agent etc…

what you are trying to do

  • I try to make him compatible to job-system because actually you need the “pole-emploi” from Lalife if you want the script works.

> what the script actually do

  • I"m working on a job “Postman”. You don’t really need to know what the script does the problem don’t come here…Actually the problem is the script don’t check on jobs system for verification of your job.

An example : if jobId == 8 then

> Or comment your code

  • The original script come from to PoolJob from the opensource Lalife.

Original script : Pooljob
Original script : Pole-emploi

Modification test with jobs-system : Postman and the first topic job.lua explain what i’m trying to do…I guess…

L 297 - 306 :

if IsVehicleModel(GetVehiclePedIsUsing(GetPlayerPed(-1)), 0xF21B33BE) then
        TriggerServerEvent("poleemploi:getjobs")
        Wait(100)
        if jobId == 8 then
            StartJobPool(1)
        else
            ShowMsgtime.msg = '~r~ Vous devez faire de Wood Postal !'
            ShowMsgtime.time = 150
        end
end

Instead of TriggerServerEvent("poleemploi:getjobs")
You have to check with the jobsystem

I forget to changed that in my modification but it’s already done on my version and still doing the same problem.

[details=Trigger]```
if IsVehicleModel(GetVehiclePedIsUsing(GetPlayerPed(-1)), 0xF21B33BE) then
TriggerServerEvent(“jobssystem:jobs”)
Wait(100)
if jobId == 8 then
StartJobPool(1)
else
ShowMsgtime.msg = ‘~r~ Vous devez faire partir de Wood Postal !’
ShowMsgtime.time = 150
end
end

**Update pastebin.**

The error from the console <img src="/uploads/default/original/2X/5/5f150dc178f07668eca2e32be18f6a0da5b7247e.png" width="690" height="22">
Problem found for this error but now it's : **you may need to call RegisterServerEvent from your script**

I think you want to do something that you don’t know, change my words if I’m wrong

Thx to close this topic.

Release here : [Release] GoPostal delivery job