[Release] ToggleID

Thanks for that, I was struggling to find the key number-

Hello, I am using your code and it is perfect, what I would like is that how do I work with:

if IsControlJustPressed(0, Keys['F9']) and Toggle == true then

I have changed the code, I have modified it a bit and it does not work for me, it continues using the:

if IsControlPressed(1, 197) then

I have also tried the Released, but I do not like it, what I would like is to use the JustPressed for when I press it to stay toggle: active/disactive

Thanks :smiley:

Yea, just remove this:

and GetPlayerPed( id ) ~= GetPlayerPed( -1 ))

In line 44 and you should be good.

I can’t manage to show my own id, any ideas?

For anyone wondering how to have it display your ID also, It’s exactly how Applezjuice said.

On line 44 of the client.lua change:

if ((NetworkIsPlayerActive( id )) and GetPlayerPed( id ) ~= GetPlayerPed( -1 )) then

to:

if NetworkIsPlayerActive( id ) then

That will now show you your ID above your head, aswell as showing everyone elses above theirs.

P.S. Sorry for digging up a topic that no one has posted on for a few months, I just thought it would be helpful since I was looking for how to do this for awhile.

1 Like

some way to place the key to activate and deactivate,

I mean that example you don’t need to press “the key to see the id”.

just by pressing the key you can see the id and then press again to deactivate

how to show the own id of player ?

Is there a way to show only own ID of player?

Solved it thanks

still won’t show my id :confused:

1 Like

how to do it on TokoVoip?

Is there anyway i can have it display the users steam: identifier next to the ID? Makes it easier for people to report a user if they recorded them!

Is there a way to only see the ID, pressing any key?

Someone who can tell me how to put the ID Head randomly every time the serve is entered for all players

Alright so I downloaded the script all I did was changed the keybind to 283 which is `~ key and the distance but I can’t get it to work. So I went back to using how you had it set up and it still doesn’t work is there some type of dependancey

How do i make it have ace permissions

not working?

I modified to run with ALT and show both IDs (yours and others)

--MODIFIED SIERRA
disPlayerNames = 5 --distance you see IDs at 
keyToToggleIDs = 19 --left alt by default

playerDistances = {}
showIDsAboveHead = false

Citizen.CreateThread(function()
    while true do 
        if IsControlJustPressed(0, keyToToggleIDs) then
            showIDsAboveHead = not showIDsAboveHead
			print("changed")
            Wait(50)
        end
        Wait(0)
    end
end)

Citizen.CreateThread(function()
    while true do
        for id = 0, 255 do
            if GetPlayerPed(id) then
                x1, y1, z1 = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
                x2, y2, z2 = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
                distance = math.floor(GetDistanceBetweenCoords(x1,  y1,  z1,  x2,  y2,  z2,  true))
                playerDistances[id] = distance
            end
        end
        Citizen.Wait(1000)
    end
end)




Citizen.CreateThread(function()
    while true do
        if showIDsAboveHead then
            for id = 0, 255 do 
                if NetworkIsPlayerActive(id) then
                    if GetPlayerPed(id) then
                        if (playerDistances[id] < disPlayerNames) then
                            x2, y2, z2 = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
                            if NetworkIsPlayerTalking(id) then
                                DrawText3D(x2, y2, z2+1, GetPlayerServerId(id), 247,124,24)
                            else
                                DrawText3D(x2, y2, z2+1, GetPlayerServerId(id), 255,255,255)
                            end
                        end  
                    end
                end
            end
        end
        Citizen.Wait(0)
    end
end)


function DrawText3D(x,y,z, text, r,g,b) 
    local onScreen,_x,_y=World3dToScreen2d(x,y,z)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
 
    local scale = (1/dist)*2 -- Este es el tamano de la letra.
    local fov = (1/GetGameplayCamFov())*100
    local scale = scale*fov
   
    if onScreen then
        SetTextScale(0.0*scale, 0.55*scale)
        SetTextFont(0)
        SetTextProportional(1)
        SetTextColour(r, g, b, 255)
        SetTextDropshadow(0, 0, 0, 0, 255)
        SetTextEdge(2, 0, 0, 0, 150)
        SetTextDropShadow()
        SetTextOutline()
        SetTextEntry("STRING")
        SetTextCentre(1)
        AddTextComponentString(text)
        DrawText(_x,_y)
    end
end
1 Like

how you make it to it show player
name

Is this still working as of today ? Because I can’t seem to get it work :frowning_face:

EDIT: I had the wrong keycode. Was trying to do it with TAB.
How do I change it, so they need to hold it. instead of a toggle ?