[Help] Player ID over esx_voice level

So im trying to setup a little script, that basicaly shows every player is ServerID Number. ex:

exampleid

I know that is something like:

    local pid = GetPlayerServerId()

function drawPid(r, g, b, a)
    SetTextFont(4)
    SetTextScale(0.5, 0.5)
    SetTextColour(r, g, b, a)
    SetTextDropShadow(0, 0, 0, 0, 255)
    SetTextEdge(1, 0, 0, 0, 255)
    SetTextDropShadow()
    SetTextOutline()
    BeginTextCommandDisplayText("STRING")
    AddTextComponentString("~y~ID:~s~ " .. pid)
    EndTextCommandDisplayText(0.192, 0.745)
end
1 Like

and what is your problem?

tbh, i want to create an ID Number text for each player ingame

Like in the image is just an handmade example…

the code i found it, and tried to play with it but no luck.

function drawPid(r, g, b, a, pid)
    SetTextFont(4)
    SetTextScale(0.5, 0.5)
    SetTextColour(r, g, b, a)
    SetTextDropShadow(0, 0, 0, 0, 255)
    SetTextEdge(1, 0, 0, 0, 255)
    SetTextDropShadow()
    SetTextOutline()
    BeginTextCommandDisplayText("STRING")
    AddTextComponentString("~y~ID:~s~ " .. pid)
    EndTextCommandDisplayText(0.192, 0.745)
end
if NetworkIsPlayerTalking(PlayerId()) then
	  local id = GetPlayerServerId(PlayerId())
          drawPid(41, 128, 185, 255, id)
    elseif not NetworkIsPlayerTalking(PlayerId()) then
	  local id = GetPlayerServerId(PlayerId())
	  drawPid(185, 185, 185, 255, id)	  
    end
  end
1 Like

Where it needs to be added? To client.lua ?

1 Like

Any fix so far ??