Tons of errors, unusable right now.
Housing is obfuscated with errors, so it's not repairable.
Probably gonna need 20 credits back. I'm still trying to fix the MDT.
Can you provide the fixed client.lua? It's all obfuscated and not working.
The only client.lua I could find is client > main.lua and I added this to the obfuscation without any luck:
Code:
local MDT_UI_OPEN = false
local MDT_DISABLE_THREAD = nil
local function mdt_setFocus(state)
MDT_UI_OPEN = state
-- Give/clear focus + keep input so you can still move camera if you want
SetNuiFocus(state, state)
SetNuiFocusKeepInput(state)
-- (Optional) show the built-in cursor hint
-- SetCursorLocation(0.5, 0.5)
-- Spin a control-disabling thread only while UI is open
if state and MDT_DISABLE_THREAD == nil then
MDT_DISABLE_THREAD = CreateThread(function()
while MDT_UI_OPEN do
-- Block most gameplay controls while NUI is focused
DisableControlAction(0, 1, true) -- LookLeftRight
DisableControlAction(0, 2, true) -- LookUpDown
DisableControlAction(0, 16, true) -- NextWeapon
DisableControlAction(0, 17, true) -- PrevWeapon
DisableControlAction(0, 22, true) -- Jump
DisableControlAction(0, 24, true) -- Attack
DisableControlAction(0, 25, true) -- Aim
DisableControlAction(0, 37, true) -- SelectWeapon
DisableControlAction(0, 44, true) -- Cover
DisableControlAction(0, 45, true) -- Reload
DisableControlAction(0, 75, true) -- Exit vehicle
DisableControlAction(0, 140, true) -- Melee attack light
DisableControlAction(0, 141, true) -- Melee attack heavy
DisableControlAction(0, 142, true) -- Melee alternate
DisableControlAction(0, 199, true) -- Pause/Menu
DisableControlAction(0, 200, true) -- ESC / Back
DisableControlAction(0, 257, true) -- Attack 2
DisableControlAction(0, 263, true) -- Melee
DisableControlAction(0, 264, true) -- Melee
DisableControlAction(0, 322, true) -- ESC
DisableControlAction(0, 106, true) -- Vehicle mouse control override
-- Let player close with ESC if your HTML doesn’t already send a close
if IsControlJustPressed(0, 200) or IsControlJustPressed(0, 322) then
-- Tell UI to close itself (your html/js should listen) OR just hard-close here:
SendNUIMessage({ action = "mdt:requestClose" })
-- Failsafe hard-close after 150ms in case UI doesn't respond
SetTimeout(150, function()
if MDT_UI_OPEN then
mdt_closeUI()
end
end)
end
Wait(0)
end
MDT_DISABLE_THREAD = nil
end)
end
end
function mdt_openUI(payload)
-- payload is optional; pass anything your UI needs (player/job/etc)
SendNUIMessage({ action = "mdt:open", data = payload })
mdt_setFocus(true)
end
function mdt_closeUI()
SendNUIMessage({ action = "mdt:close" })
mdt_setFocus(false)
end
-- NUI callbacks expected from your HTML/JS
-- Call `fetch('https://<resourceName>/mdt:ready', {method: 'POST', body: '{}'})` when UI is ready
RegisterNUICallback('mdt:ready', function(_, cb)
cb(1)
end)
-- Call this from JS when user clicks your UI close/X button
RegisterNUICallback('mdt:close', function(_, cb)
mdt_closeUI()
cb(1)
end)
-- Optional: focus on/off from JS if you need it (modals, text inputs, etc.)
RegisterNUICallback('mdt:setFocus', function(data, cb)
local state = data and data.state == true
mdt_setFocus(state)
cb(1)
end)
-- Optional: open from server or other client code
-- Example: TriggerEvent('mdt:client:open', { plate = '00ABC123' })
RegisterNetEvent('mdt:client:open', function(data)
mdt_openUI(data)
end)
RegisterNetEvent('mdt:client:close', function()
mdt_closeUI()
end)
-- Safety: if the resource stops while focused, release focus so player isn't stuck
AddEventHandler('onResourceStop', function(res)
if res == GetCurrentResourceName() and MDT_UI_OPEN then
SetNuiFocus(false, false)
SetNuiFocusKeepInput(false)
end
end)
No idea why OP is claiming any of this is open-sourced.. because it's all obfuscated with errors. Don't waste your credits here until he fixes some of it.
Honestly the code looks crazy as like l1 l2 etc as variables but give it chat gpt and ask it to fix the specific issue your having and it works, tho Ive not tested absojletely everything in it yet there may be other errors to fix, once its tested properly ill update but for now
-- =========================
-- QS unified NUI focus patch (bottom-only)
-- =========================
local QS_uiOpen = false
-- central focus helper (ties cursor to focus; runs tablet anims; clears camera flag)
local function QS_SetFocus(state, notablet)
SetNuiFocus(state, state) -- keep mouse visibility tied to focus
if SetNuiFocusKeepInput then SetNuiFocusKeepInput(false) end
if state then
if not notablet and TabletAnimation then
TabletAnimation(true, nil, true)
end
else
if Globals then Globals.CameraCreateMenu = false end
if TabletAnimation then TabletAnimation(false, nil, true) end
end
end
-- one place that closes every UI and fully drops focus/cursor
local function QS_CloseAll()
if ToggleNewMDT then ToggleNewMDT(false) end
if TogleMdt then TogleMdt(false) end
if ToggleLargue then ToggleLargue(false) end
QS_SetFocus(false)
-- safety: double-clear in case anything stuck around
SetNuiFocus(false, false)
if SetNuiFocusKeepInput then SetNuiFocusKeepInput(false) end
QS_uiOpen = false
end
-- NUI asks to change focus (called from the React/HTML side)
RegisterNUICallback("SetNuiFocus", function(data, cb)
local focused = data and data.focused == true
local notablet = data and data.notablet == true
QS_uiOpen = focused
QS_SetFocus(focused, notablet)
if cb then cb({ ok = true }) end
end)
-- If your UI sends a "CloseAll" NUI event, handle it here too.
-- (If you already have another CloseAll handler above, keep only one to avoid duplicates.)
RegisterNUICallback("CloseAll", function(_, cb)
QS_CloseAll()
if cb then cb({ ok = true }) end
end)
-- While any QS UI is open, block pause/back & make ESC close MDT instead of pausing.
CreateThread(function()
while true do
if QS_uiOpen then
-- Disable pause/escape/back
DisableControlAction(0, 200, true) -- ESC / frontend pause
DisableControlAction(0, 199, true) -- Pause/Break
DisableControlAction(0, 322, true) -- ESC (in-game)
DisableControlAction(0, 202, true) -- Back (frontend)
DisableControlAction(0, 177, true) -- Backspace/Cancel
if IsDisabledControlJustReleased(0, 200)
or IsDisabledControlJustReleased(0, 322)
or IsDisabledControlJustReleased(0, 202)
or IsDisabledControlJustReleased(0, 177) then
QS_CloseAll()
end
Wait(0)
else
Wait(250)
end
end
end)
— end
For now I placed this at the bottom of the client and I can open and close everything, and everything seemed to work fine tho as I mentioned I haven't actually gone through and tested gameplay just yet other that checking dispatch calls come through, and the first options are clickable and useable