Scripts by Finn

SBF Tablet Installation Guide

Requirements

System Requirements

  • FiveM Server
  • ESX Framework
  • MySQL Database

Compatible Frameworks

ESX QB-Core

Installation

1 Download & Extract

Extract the sbf_tablet folder to your server's resources directory:

Place in: server-data/resources/[tablet]/sbf_tablet

2 Database Setup

Import the provided SQL files into your database:

1. Main database file: sbf_tablet/installation/database.sql

3 Optional Database Templates

2. Optional Database Templates: The db folder contains SQL templates for additional functionality

Police templates: sbf_tablet/db/police_additional.sql
Ambulance templates: sbf_tablet/db/ambulance_additional.sql

4 Server Configuration

Add the resource to your server.cfg:

ensure sbf_tablet

Configuration

Complete Config.lua

Here is the complete configuration file with all available settings:

--     /$$$$$$  /$$$$$$$$ /$$   /$$ /$$$$$$$$ /$$$$$$$   /$$$$$$  /$$      
--    /$$__  $$| $$_____/| $$$ | $$| $$_____/| $$__  $$ /$$__  $$| $$      
--   | $$  \__/| $$      | $$$$| $$| $$      | $$  \ $$| $$  \ $$| $$      
--   | $$ /$$$$| $$$$$   | $$ $$ $$| $$$$$   | $$$$$$$/| $$$$$$$$| $$      
--   | $$|_  $$| $$__/   | $$  $$$$| $$__/   | $$__  $$| $$__  $$| $$      
--   | $$  \ $$| $$      | $$\  $$$| $$      | $$  \ $$| $$  | $$| $$      
--   |  $$$$$$/| $$$$$$$$| $$ \  $$| $$$$$$$$| $$  | $$| $$  | $$| $$$$$$$$
--    \______/ |________/|__/  \__/|________/|__/  |__/|__/  |__/|________/

Config = {}

-- Timezone Settings
Config.Timezone = 'Europe/Berlin' -- Timezone (e.g. 'Europe/Berlin', 'America/New_York', etc.)

-- Tablet Settings
Config.TabletItem = 'sbftablet' -- Item name

-- KeyMapping Settings
Config.KeyMapping = {
    commandName = 'open_tablet',            -- Command Name
    description = 'Open Tablet',           -- Description shown in FiveM settings
    inputGroup = 'keyboard',                -- Input Group (keyboard, mouse, controller)
    defaultKey = 'F1'                       -- Default key
}

-- Camera Settings
Config.Camera = {
    FiveManageApiKey = 'FIVEMANAGE_API_KEY',  -- Your FiveManage API key for image upload
    PhotoUploadUrl = "https://api.fivemanage.com/api/image", -- URL for photo upload
    PhotoEncoding = "png", -- (png, webp) png High quality, webp 5 times smaller file but bad img quality
}

-- License Settings
Config.Licenses = {
    {
        type = 'drive',
        name = {
            en = 'Driving License',
            de = 'Führerschein'
        },
        color = '#007AFF'
    },
    {
        type = 'drive_bike',
        name = {
            en = 'Motorcycle License',
            de = 'Motorradführerschein'
        },
        color = '#FF9500'
    },
    {
        type = 'drive_truck',
        name = {
            en = 'Truck License',
            de = 'LKW-Führerschein'
        },
        color = '#FF3B30'
    },
    {
        type = 'weapon',
        name = {
            en = 'Weapon License',
            de = 'Waffenschein'
        },
        color = '#8E8E93'
    },
    {
        type = 'pilot',
        name = {
            en = 'Pilot License',
            de = 'Pilotenlizenz'
        },
        color = '#34C759'
    },
    {
        type = 'boat',
        name = {
            en = 'Boat License',
            de = 'Bootslizenz'
        },
        color = '#00C7BE'
    }
}

-- Tablet Reset Settings
Config.TabletReset = {
    DeleteLanguageSettings = true,    -- Delete language settings
    DeleteDarkchatUsers = true,       -- Delete darkchat users
    DeleteDarkchatFriends = true,     -- Delete darkchat friends
    DeleteDarkchatGroupMembers = true, -- Delete darkchat group memberships
    DeleteDarkchatMessages = true,    -- Delete darkchat messages
    DeleteMapFriends = true,          -- Delete map friends
    DeleteMapUsers = true,            -- Delete map users
    DeleteCameraPhotos = true,        -- Delete camera photos
    DeleteNotes = true,               -- Delete notes
    DeleteServiceChats = true,        -- Delete service chats
    DeleteCustomBadgeNumbers = true   -- Delete custom badge numbers
}

-- Services Settings
Config.Services = {
    {
        id = 'mechanic',
        job = 'mechanic',
        name = {
            en = 'Mechanic',
            de = 'Mechaniker'
        },
        logo = 'https://i.postimg.cc/pr6XSw7c/Bild-2025-10-01-094737548.png'
    },
    {
        id = 'ambulance',
        job = 'ambulance',
        name = {
            en = 'Emergency Medical Services',
            de = 'Rettungsdienst'
        },
        logo = 'https://i.postimg.cc/02nL9GyN/Bild-2025-10-01-095100241.png'
    },
    {
        id = 'taxi',
        job = 'taxi',
        name = {
            en = 'Taxi Service',
            de = 'Taxi Service'
        },
        logo = 'https://i.postimg.cc/bJ1BWk5r/Bild-2025-10-01-095135452.png'
    },
    {
        id = 'police',
        job = 'police',
        name = {
            en = 'Police Department',
            de = 'Polizeibehörde'
        },
        logo = 'https://i.postimg.cc/13v3rfBL/icon.png'
    }
}

-- Police MDT Settings
Config.Police = {
    DepartmentName = 'Mobile Police Terminal',  
    AllowedJobs = {'police', 'sheriff', 'fbi'},       -- Allowed jobs for Police MDT
    
    -- Category Management - Minimum rank per job to manage categories
    CategoryPermissions = {
        Create = {
            ['police'] = 3,      -- Police: minimum rank 3 to create
            ['sheriff'] = 2,     -- Sheriff: minimum rank 2 to create
            ['fbi'] = 1,         -- FBI: minimum rank 1 to create
        },
        Edit = {
            ['police'] = 3,      -- Police: minimum rank 3 to edit
            ['sheriff'] = 2,     -- Sheriff: minimum rank 2 to edit
            ['fbi'] = 1,         -- FBI: minimum rank 1 to edit
        },
        Delete = {
            ['police'] = 4,      -- Police: minimum rank 4 to delete
            ['sheriff'] = 3,     -- Sheriff: minimum rank 3 to delete
            ['fbi'] = 2,         -- FBI: minimum rank 2 to delete
        }
    },
    
    -- Offences Management - Minimum rank per job to manage offences
    OffencePermissions = {
        Create = {
            ['police'] = 2,      -- Police: minimum rank 2 to create
            ['sheriff'] = 1,     -- Sheriff: minimum rank 1 to create
            ['fbi'] = 0,         -- FBI: any rank can create
        },
        Edit = {
            ['police'] = 2,      -- Police: minimum rank 2 to edit
            ['sheriff'] = 1,     -- Sheriff: minimum rank 1 to edit
            ['fbi'] = 0,         -- FBI: any rank can edit
        },
        Delete = {
            ['police'] = 3,      -- Police: minimum rank 3 to delete
            ['sheriff'] = 2,     -- Sheriff: minimum rank 2 to delete
            ['fbi'] = 1,         -- FBI: minimum rank 1 to delete
        }
    },
       
    -- Employee Management - Minimum rank per job to manage employees
    EmployeePermissions = {
        Hire = {
            ['police'] = 4,      -- Police: minimum rank 4 to hire
            ['sheriff'] = 3,     -- Sheriff: minimum rank 3 to hire
            ['fbi'] = 2,         -- FBI: minimum rank 2 to hire
        },
        Fire = {
            ['police'] = 4,      -- Police: minimum rank 4 to fire
            ['sheriff'] = 3,     -- Sheriff: minimum rank 3 to fire
            ['fbi'] = 2,         -- FBI: minimum rank 2 to fire
        },
        Promote = {
            ['police'] = 3,      -- Police: minimum rank 3 to promote
            ['sheriff'] = 2,     -- Sheriff: minimum rank 2 to promote
            ['fbi'] = 1,         -- FBI: minimum rank 1 to promote
        }
    },

    -- Badge Number Management - Minimum rank per job to manage badge numbers
    BadgeNumberPermissions = {
        ['police'] = 3,      -- Police: minimum rank 3 for badge number management
        ['sheriff'] = 4,     -- Sheriff: minimum rank 4 for badge number management
        ['fbi'] = 3,         -- FBI: minimum rank 3 for badge number management
    },
    
    -- Vehicle Tags - Predefined tags for vehicles
    VehicleTags = {
        {
            id = 'stolen',
            name = {
                en = 'Stolen',
                de = 'Gestohlen'
            },
            color = '#ff3b30' -- Red
        },
        {
            id = 'suspicious',
            name = {
                en = 'Suspicious',
                de = 'Verdächtig'
            },
            color = '#ff9500' -- Orange
        },
        {
            id = 'wanted',
            name = {
                en = 'Wanted',
                de = 'Gesucht'
            },
            color = '#ff2d92' -- Pink
        },
        {
            id = 'impounded',
            name = {
                en = 'Impounded',
                de = 'Beschlagnahmt'
            },
            color = '#8e8e93' -- Gray
        },
        {
            id = 'evidence',
            name = {
                en = 'Evidence',
                de = 'Beweismittel'
            },
            color = '#5856d6' -- Purple
        },
        {
            id = 'undercover',
            name = {
                en = 'Undercover',
                de = 'Undercover'
            },
            color = '#34c759' -- Green
        },
        {
            id = 'patrol',
            name = {
                en = 'Patrol Vehicle',
                de = 'Streifenwagen'
            },
            color = '#007aff' -- Blue
        },
        {
            id = 'vip',
            name = {
                en = 'VIP Vehicle',
                de = 'VIP Fahrzeug'
            },
            color = '#ffcc00' -- Gold
        }
    },
    
    -- Report Types - Predefined report types
    ReportTypes = {
        {
            id = 'incident',
            name = {
                en = 'Incident Report',
                de = 'Vorfall Bericht'
            },
            color = '#ff9500' -- Orange
        },
        {
            id = 'arrest',
            name = {
                en = 'Arrest Report',
                de = 'Festnahme Bericht'
            },
            color = '#ff3b30' -- Red
        },
        {
            id = 'traffic',
            name = {
                en = 'Traffic Report',
                de = 'Verkehrs Bericht'
            },
            color = '#007aff' -- Blue
        },
        {
            id = 'investigation',
            name = {
                en = 'Investigation Report',
                de = 'Ermittlungs Bericht'
            },
            color = '#5856d6' -- Purple
        },
        {
            id = 'patrol',
            name = {
                en = 'Patrol Report',
                de = 'Streife Bericht'
            },
            color = '#34c759' -- Green
        },
        {
            id = 'evidence',
            name = {
                en = 'Evidence Report',
                de = 'Beweis Bericht'
            },
            color = '#ff2d92' -- Pink
        },
        {
            id = 'complaint',
            name = {
                en = 'Complaint Report',
                de = 'Beschwerde Bericht'
            },
            color = '#8e8e93' -- Gray
        },
        {
            id = 'other',
            name = {
                en = 'Other Report',
                de = 'Sonstiger Bericht'
            },
            color = '#ffcc00' -- Gold
        }
    },

    CaseTypes = {
        {
            id = 'robbery',
            name = {
                en = 'Bank Robbery',
                de = 'Bankraub'
            },
            color = '#ff3b30' -- Red
        },
        {
            id = 'drugs',
            name = {
                en = 'Drug Crime',
                de = 'Drogendelikte'
            },
            color = '#ff9500' -- Orange
        },
        {
            id = 'gang',
            name = {
                en = 'Gang Activity',
                de = 'Gang Aktivität'
            },
            color = '#007aff' -- Blue
        },
        {
            id = 'investigation',
            name = {
                en = 'Investigation',
                de = 'Ermittlung'
            },
            color = '#5856d6' -- Purple
        },
        {
            id = 'traffic',
            name = {
                en = 'Street Racing',
                de = 'Straßenrennen'
            },
            color = '#34c759' -- Green
        },
        {
            id = 'weapons',
            name = {
                en = 'Weapons Case',
                de = 'Waffen Fall'
            },
            color = '#ff2d92' -- Pink
        },
        {
            id = 'violence',
            name = {
                en = 'Violent Crime',
                de = 'Gewaltdelikt'
            },
            color = '#8e8e93' -- Gray
        },
        {
            id = 'other',
            name = {
                en = 'Other Case',
                de = 'Sonstiger Fall'
            },
            color = '#ffcc00' -- Gold
        }
    }
}

-- EMS MDT Settings
Config.Ambulance = {
    DepartmentName = 'Emergency Medical Services',  
    AllowedJobs = {'ambulance'},       -- Allowed jobs for EMS MDT
    
    -- Employee Management - Minimum rank per job to manage employees
    EmployeePermissions = {
        Hire = {
            ['ambulance'] = 4,   -- Ambulance: minimum rank 4 to hire employees
        },
        Fire = {
            ['ambulance'] = 5,   -- Ambulance: minimum rank 5 to fire employees
        },
        Promote = {
            ['ambulance'] = 4,   -- Ambulance: minimum rank 4 to promote/demote employees
        }
    },

    -- Badge Number Management - Minimum rank per job to manage badge numbers
    BadgeNumberPermissions = {
        ['ambulance'] = 4,   -- Ambulance: minimum rank 4 for badge number management
    },
    
    -- Case Types - Predefined case types for Ambulance Cases
    CaseTypes = {
        {
            id = 'emergency',
            name = {
                en = 'Emergency',
                de = 'Notfall'
            },
            color = '#ff3b30' -- Red
        },
        {
            id = 'routine',
            name = {
                en = 'Routine Check',
                de = 'Routineuntersuchung'
            },
            color = '#34c759' -- Green
        },
        {
            id = 'surgery',
            name = {
                en = 'Surgery',
                de = 'Operation'
            },
            color = '#ff9500' -- Orange
        },
        {
            id = 'consultation',
            name = {
                en = 'Consultation',
                de = 'Beratung'
            },
            color = '#007aff' -- Blue
        },
        {
            id = 'therapy',
            name = {
                en = 'Therapy',
                de = 'Therapie'
            },
            color = '#5856d6' -- Purple
        },
        {
            id = 'diagnostic',
            name = {
                en = 'Diagnostic',
                de = 'Diagnose'
            },
            color = '#ff2d92' -- Pink
        },
        {
            id = 'followup',
            name = {
                en = 'Follow-up',
                de = 'Nachsorge'
            },
            color = '#8e8e93' -- Gray
        },
        {
            id = 'vaccination',
            name = {
                en = 'Vaccination',
                de = 'Impfung'
            },
            color = '#00C7BE' -- Turquoise
        },
        {
            id = 'trauma',
            name = {
                en = 'Trauma',
                de = 'Trauma'
            },
            color = '#ff6b35' -- Orange-Red
        },
        {
            id = 'psychiatric',
            name = {
                en = 'Psychiatric',
                de = 'Psychiatrisch'
            },
            color = '#6c5ce7' -- Purple-Blue
        },
        {
            id = 'rehabilitation',
            name = {
                en = 'Rehabilitation',
                de = 'Rehabilitation'
            },
            color = '#a29bfe' -- Light Purple
        },
        {
            id = 'other',
            name = {
                en = 'Other',
                de = 'Sonstiges'
            },
            color = '#ffcc00' -- Gold
        }
    },

    -- Work Material Categories Management - Minimum rank per job to manage categories
    MaterialPermissions = {
        Create = {
            ['ambulance'] = 3,   -- Ambulance: minimum rank 3 to create
        },
        Edit = {
            ['ambulance'] = 3,   -- Ambulance: minimum rank 3 to edit
        },
        Delete = {
            ['ambulance'] = 4,   -- Ambulance: minimum rank 4 to delete
        }
    },
    
    -- Material Management - Minimum rank per job to manage materials
    MaterialItemPermissions = {
        Create = {
            ['ambulance'] = 2,   -- Ambulance: minimum rank 2 to create
        },
        Edit = {
            ['ambulance'] = 2,   -- Ambulance: minimum rank 2 to edit
        },
        Delete = {
            ['ambulance'] = 3,   -- Ambulance: minimum rank 3 to delete
        }
    }
}

-- Faction App Settings
Config.Fraktion = {
    FraktionName = 'Faction',  -- Default faction name
    AllowedJobs = {             -- Allowed jobs for Faction App (can be dynamically extended)
        'muertoss',
        'police', 
        'mafia',
        'cartel',
        'gang',
        'fraktion'
    }
}

Exports

Service Dispatch Exports

The SBF Tablet includes powerful export functions for creating service dispatches from other scripts. This allows you to integrate emergency calls, service requests, and location sharing directly into the tablet's service system.

Example Usage:

-- Example: Creating a service dispatch from a robbery script
RegisterCommand('callpolice', function(source, args, rawCommand)
    local xPlayer = ESX.GetPlayerFromId(source)
    local coords = GetEntityCoords(GetPlayerPed(source))
    
    -- Create a new service chat for police
    local result = exports.sbf_tablet:createServiceChat('JOBNAME')
    
    if result and result.success then
        -- Send a message to the service
        exports.sbf_tablet:sendServiceMessage(result.chat.id, "TEXT TO CHAT")
        
        -- Send coordinates to the service
        exports.sbf_tablet:sendServiceCoordinates(result.chat.id, {
            x = coords.x,
            y = coords.y
        }, "location")
    end
end

Support

Need Help?

If you encounter any issues during installation or have questions about the script, please don't hesitate to contact the support team.