NR_Tablet

A customizable in-game tablet system with USB-based app unlocking, personal stash docking, and full support for adding your own custom apps.

Dependencies

Resource Description Required
qbx_core Core framework Yes
ox_inventory Inventory system Yes
ox_lib Utility library Yes

Installation

Step 1: Resource Installation

Download the resource and extract it to your resources folder:

server/
  └── resources/
      └── [nightrider]/
          └── NR_Tablet/

Add to your server.cfg:

ensure NR_Tablet

Step 2: ox_inventory Items

Navigate to ox_inventory/data/items.lua and add the following items:

['tablet'] = {
    label = 'Player Tablet',
    weight = 500,
    stack = false,
    close = false,
    consume = 1,
    buttons = {
        {
            label = 'Insert Required Items',
            action = function(slot)
                TriggerServerEvent('NR_Tablet:insertItems')
            end
        },
    },
    server = {
        export = 'NR_Tablet.tablet'
    }
},
['crew_usb'] = {
    label = 'Crew App Access Key',
    weight = 1,
    stack = false,
    close = true,
},

['mdt_usb'] = {
    label = 'MDT App Access Key',
    weight = 1,
    stack = false,
    close = true,
},

['boost_usb'] = {
    label = 'Boost App Access Key',
    weight = 1,
    stack = false,
    close = true,
},

['house_usb'] = {
    label = 'House Robbery App Access Key',
    weight = 1,
    stack = false,
    close = true,
},

['ug_usb'] = {
    label = 'Race App Access Key',
    weight = 1,
    stack = false,
    close = true,
},

Step 3: ox_inventory Stash

Navigate to ox_inventory/data/stashes.lua and add this stash configuration:

{
    name = 'tablet_stash',
    label = 'USB Dock',
    slots = 10,
    weight = 10000,
    whitelist = {
        'ug_usb',
        'crew_usb',
        'mdt_usb',
        'boost_usb',
        'house_usb'
    }
}

Step 4: Configure NR_Tablet

Edit NR_Tablet/config.lua to match your server setup:

Config = {}

Config.Debug = false
Config.Framework = 'qbx'
Config.FrameworkFolder = 'qbx_core'
Config.Inventory = 'ox_inventory'

--====================
-- TABLET STASH SETTINGS
--====================
Config.AllowedTabletItems = {
    'ug_usb',
    'crew_usb',
    'mdt_usb',
    'boost_usb',
    'house_usb'
}

Step 5: Restart

Restart your server to load the resource. Make sure qbx_core, ox_inventory, and ox_lib are all started before NR_Tablet.

Default Apps

App Required USB Notes
Codem Racing ug_usb Race App Access Key
CS Gangs crew_usb Crew App Access Key
PS MDT mdt_usb MDT App Access Key
Rahe Boosting boost_usb Boost App Access Key
House Robbery house_usb House Robbery App Access Key
VMS Housing None Always available (no USB required)

Adding Custom Apps

1. Add App to HTML

Navigate to NR_Tablet/web/index.html, find the apps section, and add your new app:

<!-- Your Custom App -->
<div class="app" data-app="your_app_name">
    <img src="assets/your_icon.png" alt="Your App">
    <p>Your App Name</p>
</div>

2. Add App Icon

Place your app icon (PNG recommended) in:

NR_Tablet/web/assets/your_icon.png

3. Configure App Logic

Navigate to NR_Tablet/client/custom_apps.lua and add your app's trigger in the openApp callback:

RegisterNUICallback("openApp", function(data, cb)
    TriggerEvent("TF_Tablet:fB")
    local app = data.appName

    if not app then
        cb('error')
        return
    end

    -- Add your custom app here
    if app == "your_app_name" then
        DebugPrint("Opening Your Custom App")
        -- Option 1: Trigger an event
        TriggerEvent('your_script:openApp')

        -- Option 2: Use an export
        exports['your_script']:openApp()

        -- Option 3: Trigger server event
        TriggerServerEvent('your_script:server:openApp')

    else
        DebugPrint("Unknown app requested: " .. tostring(app))
    end

    cb('ok')
end)

4. Link App to USB (Optional)

If you want your app to require a USB key:

A. Add the USB item to ox_inventory/data/items.lua:

['your_usb'] = {
    label = 'Your App Access Key',
    weight = 1,
    stack = false,
    close = true,
}

B. Add to Config.AllowedTabletItems in config.lua:

Config.AllowedTabletItems = {
    'ug_usb',
    'crew_usb',
    'mdt_usb',
    'boost_usb',
    'house_usb',
    'your_usb'  -- Add here
}

C. Update the HTML with the data-requires attribute:

<div class="app" data-app="your_app_name" data-requires="your_usb">
    <img src="assets/your_icon.png" alt="Your App">
    <p>Your App Name</p>
</div>

Usage

For Players

For Admins

Give items via commands:

/giveitem [player_id] tablet 1
/giveitem [player_id] ug_usb 1
/giveitem [player_id] crew_usb 1
/giveitem [player_id] mdt_usb 1
/giveitem [player_id] boost_usb 1
/giveitem [player_id] house_usb 1

Security Features

Performance

Troubleshooting

Apps not showing

Tablet won't open

Items not saving in dock

Custom app not working

Support

Need help? Join our Discord server for community support and updates.