[Release] [ESX] Jobs Online


#21

Send me the client script


#22

This is just like esx_jobCounter… it add aplayer in service even tough the player is not in service…
You should update your script to work with the new esx_service


#23

Doesn’t work for me. I get:

Error loading script server.lua in resource esx_jobsonline: server.lua: attempt to index a nil value (global ‘ESX’)
stack traceback: server.lua:15: in main chunk
Failed to load script server.lua.
Started resource esx_jobsonline

And before you ask, yes i have started esx_jobsonline AFTER essentialmode, mysql, etc.


#24

how would i add fire and other services please


#25

Send me the line you have problem with


#26

You are using esx?? If not you cant use it


#27

Send me the line you have error with


#28

Iam yes …


#29

TriggerEvent(‘esx:getSharedObject’, function(obj) ESX = obj end)

– Register server callback for jobs online
ESX.RegisterServerCallback(‘guy293_getJobsOnline’, function(source, cb)

It seems to break on either of those 2, if i take one out it will just break on the other with the same error.


#30

I don’t have a problem with the script… just saying that this is the same thing as : https://github.com/ESX-PUBLIC/esx_jobCounter

and it count the player online with the job insted of player being in service


#31

I have a fix. I will send later


#32

It is, completely copied and posted after editing to write in letters instead of numbers.


#33

I don’t know what your talking about…


#34

can u give me the link?


#35

I don’t remember the name tho. If I will find it I will send it.


#36

thx u men loool 20 char


#37

I have problem when i start this script it will show those jobs for like < 20 seconds and then it disapears from the screen?


#38

Send error on server & client


#39

Where i put

EndTextCommandDisplayText(0.2, 0.867)

On my code

--[[

-- ESX Voice
-- Original Author of Script: github.com/aabbfive
-- Edited by: nearbyplayer

--]]

local voice = {default = 5.0, shout = 12.0, whisper = 1.0, current = 0, level = nil}

function drawLevel(r, g, b, a)
  SetTextFont(4)
  SetTextProportional(1)
  SetTextScale(0.5, 0.5)
  SetTextColour(r, g, b, a)
  SetTextDropShadow(0, 0, 0, 0, 255)
  SetTextEdge(1, 0, 0, 0, 255)
  SetTextDropShadow()
  SetTextOutline()
  SetTextEntry("STRING")
  AddTextComponentString("~y~Voice:~s~ " .. voice.level)
  DrawText(0.175, 0.92)
end

AddEventHandler('onClientMapStart', function()
  if voice.current == 0 then
    NetworkSetTalkerProximity(voice.default)
  elseif voice.current == 1 then
    NetworkSetTalkerProximity(voice.shout)
  elseif voice.current == 2 then
    NetworkSetTalkerProximity(voice.whisper)
  end
end)

Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
    if IsControlJustPressed(1, 74) and IsControlPressed(1, 21) then
      voice.current = (voice.current + 1) % 3
      if voice.current == 0 then
        NetworkSetTalkerProximity(voice.default)
        voice.level = "Normal"
      elseif voice.current == 1 then
        NetworkSetTalkerProximity(voice.shout)
        voice.level = "Shout"
      elseif voice.current == 2 then
        NetworkSetTalkerProximity(voice.whisper)
        voice.level = "Whisper"
      end
    end
    if voice.current == 0 then
      voice.level = "Normal"
    elseif voice.current == 1 then
      voice.level = "Shout"
    elseif voice.current == 2 then
      voice.level = "Whisper"
    end
    if NetworkIsPlayerTalking(PlayerId()) then
      drawLevel(41, 128, 185, 255)
    elseif not NetworkIsPlayerTalking(PlayerId()) then
      drawLevel(185, 185, 185, 255)
    end
  end
end)

#40

Are you joking?
:man_facepalming:
Replace with the line i told to.
Look for the same row and replace…