Scripts by Finn

SBF Phone Installation Guide

Requirements

System Requirements

  • FiveM Server
  • ESX Framework
  • MySQL Database
  • Voice System: PMA-Voice or SaltyChat

Compatible Frameworks

ESX QB-Core

Discord Verification Required

This script requires Discord verification. You must be a member of our Discord server and configure your Discord User ID in the config file.

Join Discord Server

Installation

1 Download & Extract

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

Place in: server-data/resources/[phone]/sbf_phone

2 Database Setup

Import the provided SQL file into your database:

Database file: sbf_phone/installation/database.sql

3 Discord User ID Configuration

Open sbf_phone/shared/config.lua and enter your Discord User ID:

Config.DiscordUserId = "YOUR_DISCORD_USER_ID"

Important: You must be a member of our Discord server. Join at: discord.gg/pBuYB5ndZm

4 Item Configuration

Add the phone item to your ESX items database or items.lua:

-- SQL Database
INSERT INTO `items` (`name`, `label`, `weight`) VALUES ('sbfphone', 'SBF Phone', 1);

-- Or in items.lua
['sbfphone'] = {
    label = 'SBF Phone',
    weight = 1,
    stack = false,
    close = true,
    description = 'A modern smartphone'
}

5 Server Configuration

Add the resource to your server.cfg:

ensure sbf_phone

Configuration

Basic Settings

-- Discord Verification (REQUIRED!)
Config.DiscordUserId = "YOUR_DISCORD_USER_ID"

-- Timezone
Config.Timezone = 'Europe/Berlin'

-- Phone Item Name
Config.PhoneItem = 'sbfphone'

-- Voice System
Config.VoiceSystem = 'pma-voice' -- 'pma-voice' or 'saltychat'

-- Sync with SBF Tablet
Config.SBFTabletSync = true

Key Mapping Configuration

-- Phone Open/Close Key
Config.KeyMapping = {
    commandName = 'open_phone',
    description = 'Open Phone',
    inputGroup = 'keyboard',
    defaultKey = 'F1'
}

-- Phone Peek/Focus Toggle
Config.PeekKeyMapping = {
    commandName = 'sbf_phone_peek',
    description = 'SBF Phone Peek/Focus Toggle',
    inputGroup = 'keyboard',
    defaultKey = 'LMENU' -- Left ALT
}

Radio Configuration

Config.Radio = {
    VoiceSystem = 'pma-voice',
    
    -- Frequency Limits
    MinFrequency = 1,
    MaxFrequency = 999,
    
    -- Auto disconnect on death
    DisconnectOnDeath = true,
    
    -- Reserved frequencies for jobs
    ReservedFrequencies = {
        {min = 1, max = 50, jobs = {'police'}},
        {min = 51, max = 100, jobs = {'ambulance'}},
        {min = 101, max = 150, jobs = {'mechanic'}},
    },
    
    -- Default volume
    DefaultVolume = 50,
    
    -- PMA-Voice settings
    PMAVoice = {
        RadioEffect = true,
        RadioClicks = true
    },
}

Camera & Photo Settings

Config.Camera = {
    FiveManageApiKey = 'YOUR_API_KEY',
    PhotoUploadUrl = "https://api.fivemanage.com/api/image",
    PhotoEncoding = "png", -- 'png' or 'webp'
}

Config.Photos = {
    DiscordWebhook = {
        enabled = false,
        url = 'DISCORD_WEBHOOK_URL',
        botName = 'SBF Phone',
        color = 3447003,
        includeSelfies = true
    }
}

Services Configuration

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 = 'police',
        job = 'police',
        name = {
            en = 'Police Department',
            de = 'Polizeibehörde'
        },
        logo = 'https://i.postimg.cc/13v3rfBL/icon.png'
    }
}

Exports

Service Dispatch Exports

The SBF Phone 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 phone'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_phone:createServiceChat('police')
    
    if result and result.success then
        -- Send a message to the service
        exports.sbf_phone:sendServiceMessage(result.chat.id, "Emergency: Bank robbery in progress!")
        
        -- Send coordinates to the service
        exports.sbf_phone:sendServiceCoordinates(result.chat.id, {
            x = coords.x,
            y = coords.y
        }, "location")
    end
end)

Phone Number System

The SBF Phone features an automatic phone number system that assigns 6-digit numbers to players. You can retrieve and use phone numbers in your scripts:

-- Get a player's phone number
local phoneNumber = exports.sbf_phone:getPhoneNumber(source)

-- Check if player has a phone number
if phoneNumber then
    print("Player phone number: " .. phoneNumber)
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.