[Release] [ESX] Jobs Online

Basic script for showing online jobs.

It updates every 10 seconds. you can change It If you want.
You are free to edit and send your version in the comments.
But please don’t repost without my permission

One more thing:
If you have ESX_Voice and It will show it above.
To fix it change in: esx_voice\client\main.lua Line 27
Change with this:

EndTextCommandDisplayText(0.2, 0.867)

So it would look like this:
image

Enjoy!

Download: https://github.com/Guy293/esx_JobsOnline

8 Likes

Possible to make it register uniforms for Police EMS And Fire So you could use it without ESX? Just an idea :wink:

The script works In another way but I will try to make another version.
Follow the thread so you will know.

Will do tnx

(20 Char)

Maybe you could try to make it for vRP too? If possible

There’s A similar release for vrp

Is there a way you could possibly make this into a command so if someone does /police it will show how many cops are on?

Yes. If I will have time I will do it.

ok thanks much appreciated

1 Like

You Welcome :slight_smile:

Up. …&/&/…lk

how can i change the script to: Police: Online, EMS: Online if someone is online

Look at the code (client) and you will find it :slight_smile:

i dont get it bruh haha could you send me the right code for it

Would you help me edit this to my server?

What do you need help with?

1 Like

i dont understand how i find all the diffrent “jobs” like “taxionline” how do iknow what to type there? Sorry if im asking a stupid question im just abit confused

I did like this

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
			DrawText2(0.70, 1.449, 1.0,1.0,0.45, "POLITI Online: " .. policeonline , 0 ,119, 255, 150)
			DrawText2(0.70, 1.42, 1.0,1.0,0.45, "Læger online : " .. emsonline , 246 ,56, 56, 150)
			DrawText2(0.70, 1.391, 1.0,1.0,0.45, "Taxa Fører: " .. taxionline , 239 ,255, 0, 150)
			DrawText2(0.70, 1.391, 1.0,1.0,0.45, "arbejdsløs:"  .. unemployedonline , 239 ,255, 0, 150)
			DrawText2(0.70, 1.391, 1.0,1.0,0.45, "Taxi on duty:" .. mafiaonline , 239 ,255, 0, 150)
	end
end)

and this

  
  local xPlayers = ESX.GetPlayers()

	EMSConnected = 0
	PoliceConnected = 0
	TaxiConnected = 0
	unemployedConnected = 0
	mafiaConnected = 0
	
	for i=1, #xPlayers, 1 do
		local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
		if xPlayer.job.name == 'ambulance' then
			EMSConnected = EMSConnected + 1
		end		
		if xPlayer.job.name == 'unemployed' then
			unemployedConnected = unemployedConnected + 1
		end
		if xPlayer.job.name == 'police' then
			PoliceConnected = PoliceConnected + 1
		end
		if xPlayer.job.name == 'mafia' then
			mafiaConnected = mafiaConnected + 1
		end	
		if xPlayer.job.name == 'taxi' then
			TaxiConnected = TaxiConnected + 1
		end
	end
  
  
cb(EMSConnected, PoliceConnected, TaxiConnected,unemployedConnected,mafiaConnected)

end)

what did i do wrong? :s i get the error "Couldnt load recourse esx_jobsonline

i mean that he doesnt count.
he should show like this; Police: Online , EMS: Online and not 1,2,3,4.