From 4a179a4c337fa1f95d29bdc326c61738fa8e2653 Mon Sep 17 00:00:00 2001 From: BreezyTheDev <63890993+BreezyTheDev@users.noreply.github.com> Date: Fri, 12 Aug 2022 19:42:27 -0700 Subject: [PATCH 1/2] Added configurable options & made it toggle-able. --- IDsAboveHead/cl_idsabovehead.lua | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/IDsAboveHead/cl_idsabovehead.lua b/IDsAboveHead/cl_idsabovehead.lua index 2854311..84052a5 100644 --- a/IDsAboveHead/cl_idsabovehead.lua +++ b/IDsAboveHead/cl_idsabovehead.lua @@ -1,4 +1,14 @@ -local disPlayerNames = 5 +displayid = true +RegisterCommand(Config.ToggleCommand, function(source, args, rawCommand) + if displayid == true then + displayid = false + TriggerEvent('chatMessage', '', {255, 255, 255}, Config.Prefix..' ^3You have ^5disabled ^3IDs above head.') + elseif displayid == false then + displayid = true + TriggerEvent('chatMessage', '', {255, 255, 255}, Config.Prefix..' ^3You have ^5enabled ^3IDs above head.') + end +end) + local playerDistances = {} local function DrawText3D(position, text, r,g,b) @@ -39,10 +49,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 +82,4 @@ Citizen.CreateThread(function() end Wait(1000) end -end) \ No newline at end of file +end) From 13658611251e4578130038344bcef07c79ea9719 Mon Sep 17 00:00:00 2001 From: BreezyTheDev <63890993+BreezyTheDev@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:35:09 -0700 Subject: [PATCH 2/2] Update cl_idsabovehead.lua --- IDsAboveHead/cl_idsabovehead.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/IDsAboveHead/cl_idsabovehead.lua b/IDsAboveHead/cl_idsabovehead.lua index 84052a5..1801123 100644 --- a/IDsAboveHead/cl_idsabovehead.lua +++ b/IDsAboveHead/cl_idsabovehead.lua @@ -1,12 +1,7 @@ displayid = true RegisterCommand(Config.ToggleCommand, function(source, args, rawCommand) - if displayid == true then - displayid = false - TriggerEvent('chatMessage', '', {255, 255, 255}, Config.Prefix..' ^3You have ^5disabled ^3IDs above head.') - elseif displayid == false then - displayid = true - TriggerEvent('chatMessage', '', {255, 255, 255}, Config.Prefix..' ^3You have ^5enabled ^3IDs above head.') - end + displayid = not displayid + TriggerEvent("chatMessage", "", {255,255,255}, Config.Prefix.." ^3You have ^5"..(displayid and "enabled" or "disabled").." ^3IDs above head.") end) local playerDistances = {}