Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions IDsAboveHead/cl_idsabovehead.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
local disPlayerNames = 5
displayid = true
RegisterCommand(Config.ToggleCommand, function(source, args, rawCommand)
displayid = not displayid
TriggerEvent("chatMessage", "", {255,255,255}, Config.Prefix.." ^3You have ^5"..(displayid and "enabled" or "disabled").." ^3IDs above head.")
end)

local playerDistances = {}

local function DrawText3D(position, text, r,g,b)
Expand Down Expand Up @@ -39,10 +44,16 @@ Citizen.CreateThread(function()
if playerDistances[id] < disPlayerNames then
local targetPedCords = GetEntityCoords(targetPed)
if NetworkIsPlayerTalking(id) then
DrawText3D(targetPedCords, GetPlayerServerId(id), 247,124,24)
DrawMarker(27, targetPedCords.x, targetPedCords.y, targetPedCords.z-0.97, 0, 0, 0, 0, 0, 0, 1.001, 1.0001, 0.5001, 173, 216, 230, 100, 0, 0, 0, 0)
if displayid then
DrawText3D(targetPedCords, GetPlayerServerId(id), 52, 152, 219)
end
if Config.Blip then
DrawMarker(27, targetPedCords.x, targetPedCords.y, targetPedCords.z-0.97, 0, 0, 0, 0, 0, 0, 1.001, 1.0001, 0.5001, 173, 216, 230, 100, 0, 0, 0, 0)
end
else
DrawText3D(targetPedCords, GetPlayerServerId(id), 255,255,255)
if AlwaysDisplayID then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The else here is meant to show the text in white if they are not talking, now it looks like it will only show if they are talking

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the point. For my server, I have it that way. It only appears when they speak. So I decided to make it configurable here so if others who cannot exactly code but share the idea can have it.

DrawText3D(targetPedCords, GetPlayerServerId(id), 255,255,255)
end
end
end
end
Expand All @@ -66,4 +77,4 @@ Citizen.CreateThread(function()
end
Wait(1000)
end
end)
end)