diff --git a/server-data/resources/[bpt_addons]/bpt_idcard/client/main.lua b/server-data/resources/[bpt_addons]/bpt_idcard/client/main.lua new file mode 100644 index 000000000..c8c2b95d3 --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_idcard/client/main.lua @@ -0,0 +1,25 @@ +local open = false + +-- Open ID card +RegisterNetEvent("bpt_idcard:open") +AddEventHandler("bpt_idcard:open", function(data, type) + open = true + SendNUIMessage({ + action = "open", + array = data, + type = type, + }) +end) + +-- Key events +CreateThread(function() + while true do + Wait(0) + if IsControlJustReleased(0, 322) and open or IsControlJustReleased(0, 177) and open then + SendNUIMessage({ + action = "close", + }) + open = false + end + end +end)