In-Game Tablet with Web Based CAD/MDT Support

Before it worked for me fine, but when I’ve downloaded today again (and changed only background pic), I can’t close it properly! Nui focus is still there. Only mouse cursor…

Does anybody know what’s with it? It’s not modified in any way. After pressing M, tab opens. Then both escape or middle button does the same thing. Tab closes, but focus prevails -.-

Edit.: SOLVED - problem was in renaming the resource to different name :man_facepalming:

What can I do to make char take out this prop? All they do atm, is to make those animation, but without any tablet in their hands

You need to use the tablet prop. Load the model and then attach it to the player.

Here’s the prop i used: prop_cs_tablet

1 Like

does anyone has the correct values for the bone index?

I was bit stuck with that. Would you mind to pass that bit of the code over?

i made a pull request for animation and prop (that works), sadly i didnt use an “subject” or something… this was my first time using a pull request, sry if i did something wrong.

oh, and the bone coords are correct now

Sure i’ll message you what i have

I’m getting memory usage errors from this now. It sucks because I put my penal code into it and it gets use a LOT. However, I can’t have a script that uses up my memory.

Have you changed anything in the code?

nope. started happening after one of the fivem updates.

We’ve been having the same issue.

What do you mean? I want the whole cad to fit inside the tablet… I have bubble cad

I’m also getting the high memory issue

with a touch of madness, I wonder if it’s possible to play, google games, such as this game … :stuck_out_tongue:

:smile: :smile: :smile:

Ill be looking into the tab issue sometime this week.

1 Like

discord…facebook… google … tweeter :heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes:

I fixed the high memory issue!
If you are using a command instead of control, use this:
You can’t have RegisterCommand inside Citizen.CreateThread (just learned this by mistake)


RegisterCommand("tablet", function()
OpenTablet()
end)

function OpenTablet()
                tabEnabled = not tabEnabled -- Toggle tablet visible state
                REQUEST_NUI_FOCUS(tabEnabled)
                print("The tablet state is: " .. tostring(tabEnabled))
end

Citizen.CreateThread(
    function()
        -- Wait for nui to load or just timeout
        local l = 0
        local timeout = false
        while not tabLoaded do
            Citizen.Wait(0)
            l = l + 1
            if l > 500 then
                tabLoaded = true --
                timeout = true
            end
        end

        if timeout == true then
            print("Failed to load tablet nui...")
        -- return ---- Quit
        end

        print("::The client lua for tablet loaded::")

        REQUEST_NUI_FOCUS(false) -- This is just in case the resources restarted whilst the NUI is focused.

        while true do
            if (tabEnabled) then
                local ped = GetPlayerPed(-1)
                DisableControlAction(0, 1, tabEnabled) -- LookLeftRight
                DisableControlAction(0, 2, tabEnabled) -- LookUpDown
                DisableControlAction(0, 24, tabEnabled) -- Attack
                DisablePlayerFiring(ped, tabEnabled) -- Disable weapon firing
                DisableControlAction(0, 142, tabEnabled) -- MeleeAttackAlternate
                DisableControlAction(0, 106, tabEnabled) -- VehicleMouseControlOverride
            end
            Citizen.Wait(0)
        end
    end
)
4 Likes

Seems to have fixed the resource time warning for us. Thanks for sharing!

1 Like

Anyone know how to fix a website if its super small like this?

make your iframe size bigger