diff --git a/IDsAboveHead/cl_idsabovehead.lua b/IDsAboveHead/cl_idsabovehead.lua index 2854311..1801123 100644 --- a/IDsAboveHead/cl_idsabovehead.lua +++ b/IDsAboveHead/cl_idsabovehead.lua @@ -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) @@ -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 + DrawText3D(targetPedCords, GetPlayerServerId(id), 255,255,255) + end end end end @@ -66,4 +77,4 @@ Citizen.CreateThread(function() end Wait(1000) end -end) \ No newline at end of file +end)