QBox

You will receive the script in keymaster.fivem.net profile, after this click in blue "download" button.

After download, put the script in your server files.

Remeber:

You need to be logged with the same cfx.re account you used to buy in my tebex store.

  1. Install all dependencies, and follow their respective installation instructions.

Dependencies Part

Download all the scripts by clicking on their respective names, put them in the server files and ensure in server.cfg

Webhooks

JPR Phone System uses webhooks for photo system, video system and audios files. All you need to do is replace the default webhooks, via config.lua Our log system works for regular players as well as more detailed logs for staff.

For more info how to create a discord webhook follow this tutorial: https://www.youtube.com/watch?v=fKksxz2Gdnc&t=7s&ab_channel=NoIntroTutorials

Integration with the home system

The JPR Phone System offers unique phones, so we have to get the information of the properties bought from the original buyer of the phone and not from the player who is using the phone, so we only need to little edits to the script.

Open config.lua of Phone System and change house name to this one:

Config.HouseScriptName = "qb-houses"

Edit server side file of QB-Houses, add this:

QBCore.Functions.CreateCallback('jpr-phonesystem:server:GetPlayerHouses', function(source, cb, serie)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    local MyHouses = {}
    local CitizenId = MySQL.query.await('SELECT * FROM jpr_phonesystem_base WHERE idtelemovel = ?', {serie})
    
    if (CitizenId[1]) then
        local result = MySQL.query.await('SELECT * FROM player_houses WHERE citizenid = ?',
            {CitizenId[1].citizenid})
        local DonoData = MySQL.query.await('SELECT * FROM players WHERE citizenid = ?', {CitizenId[1].citizenid})
        if result and result[1] and DonoData[1] then
            local nome = DonoData[1]
            DonoData = json.decode(DonoData[1].charinfo)
            for k, v in pairs(result) do
                MyHouses[#MyHouses+1] = {
                    name = v.house,
                    keyholders = {},
                    owner = CitizenId[1].citizenid,
                    price = Config.Houses[v.house].price,
                    label = Config.Houses[v.house].adress,
                    tier = Config.Houses[v.house].tier,
                    garage = Config.Houses[v.house].garage
                }

                if v.keyholders ~= "null" then
                    v.keyholders = json.decode(v.keyholders)
                    if v.keyholders then
                        for _, data in pairs(v.keyholders) do
                            local keyholderdata = MySQL.query.await('SELECT * FROM players WHERE citizenid = ?',
                                {data})
                            if keyholderdata[1] then
                                keyholderdata[1].charinfo = json.decode(keyholderdata[1].charinfo)

                                local userKeyHolderData = {
                                    charinfo = {
                                        firstname = keyholderdata[1].charinfo.firstname,
                                        lastname = keyholderdata[1].charinfo.lastname
                                    },
                                    citizenid = keyholderdata[1].citizenid,
                                    name = keyholderdata[1].name
                                }
                                MyHouses[k].keyholders[#MyHouses[k].keyholders+1] = userKeyHolderData
                            end
                        end
                    else
                        MyHouses[k].keyholders[1] = {
                            charinfo = {
                                firstname = DonoData.charinfo.firstname,
                                lastname = DonoData.charinfo.lastname
                            },
                            citizenid = CitizenId[1].citizenid,
                            name = nome.name
                        }
                    end
                else
                    MyHouses[k].keyholders[1] = {
                        charinfo = {
                            firstname = DonoData.charinfo.firstname,
                            lastname = DonoData.charinfo.lastname
                        },
                        citizenid = CitizenId[1].citizenid,
                        name = nome.name
                    }
                end
            end

            SetTimeout(100, function()
                cb(MyHouses)
            end)
        else
            cb({})
        end
    else
        cb({})
    end
end)

QBCore.Functions.CreateCallback('jpr-phonesystem:server:GetHouseKeys', function(source, cb, serie)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    local MyKeys = {}
    local CitizenId = MySQL.query.await('SELECT * FROM jpr_phonesystem_base WHERE idtelemovel = ?', {serie})
    
    if (CitizenId[1]) then
        local result = MySQL.query.await('SELECT * FROM player_houses', {})
        for _, v in pairs(result) do
            if v.keyholders ~= "null" then
                v.keyholders = json.decode(v.keyholders)
                for _, p in pairs(v.keyholders) do
                    if p == CitizenId[1].citizenid and (v.citizenid ~= CitizenId[1].citizenid) then
                        MyKeys[#MyKeys+1] = {
                            HouseData = Config.Houses[v.house]
                        }
                    end
                end
            end

            if v.citizenid == CitizenId[1].citizenid then
                MyKeys[#MyKeys+1] = {
                    HouseData = Config.Houses[v.house]
                }
            end
        end
    end
    cb(MyKeys)
end)

QBCore.Functions.CreateCallback('jpr-phonesystem:server:TransferCid', function(_, cb, NewCid, house)
    local result = MySQL.query.await('SELECT * FROM players WHERE citizenid = ?', {NewCid})
    if result[1] then
        local HouseName = house.name
        housekeyholders[HouseName] = {}
        housekeyholders[HouseName][1] = NewCid
        houseownercid[HouseName] = NewCid
        houseowneridentifier[HouseName] = result[1].license
        MySQL.update(
            'UPDATE player_houses SET citizenid = ?, keyholders = ?, identifier = ? WHERE house = ?',
            {NewCid, json.encode(housekeyholders[HouseName]), result[1].license, HouseName})
        cb(true)
    else
        cb(false)
    end
end)

If you cant find your housing script, open discord ticket, we can adapt it to your system!

Permissions to JPR Phone System

JPR Phone System needs permissions to record your voice, so you can send audio messages and record videos with audio by the phone.

If you receive a message like this, click F8, "Allow".

This message appears only once.

SQL

Execute JPR - Phone System.sql file in your SQL

This is mandatory!

MDT ⚠️

MDT app has all its code open, the filtering part is in openFunctions.js and the part that takes information from SQL is in client_config and server_config. Any change to your SQL can affect the way MDT works, so if you have the programming skills to adapt it to your server or it's already working (most of them) use it, otherwise disable it in the config.

Inventory Setup

Go to qbx-core, shared, items.lua, replace phone item line to this ones:

['phone'] = {['name']='phone',['label']='Phone',['weight']=700,['type']='item',['image']='phone.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat phone ya got there'},
['phone_white']={['name']='phone_white',['label']='White Phone',['weight']=700,['type']='item',['image']='phone_white.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat white phone ya got there'},
['phone_gold']={['name']='phone_gold',['label']='Gold Phone',['weight']=700,['type']='item',['image']='phone_gold.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat gold phone ya got there'},
['phone_red']={['name']='phone_red',['label']='Red Phone',['weight']=700,['type']='item',['image']='phone_red.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat red phone ya got there'},
['phone_blue']={['name']='phone_blue',['label']='Blue Phone',['weight']=700,['type']='item',['image']='phone_blue.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat blue phone ya got there'},
['phone_green']={['name']='phone_green',['label']='Green Phone',['weight']=700,['type']='item',['image']='phone_green.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat green phone ya got there'},
['phone_pink']={['name']='phone_pink',['label']='Pink Phone',['weight']=700,['type']='item',['image']='phone_pink.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat pink phone ya got there'},
['phone_green_light']={['name']='phone_greenLight',['label']='Green Light Phone',['weight']=700,['type']='item',['image']='phone_greenLight.png',['unique']=true,['useable']=true,['shouldClose']=true,['combinable']=nil,['description']='Neat green light phone ya got there'},
['powerbank'] 			 	 	 	 = {['name'] = 'powerbank', 			  			['label'] = 'Powerbank', 					['weight'] = 200, 		['type'] = 'item', 		['image'] = 'powerbank.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'A good way to get battery'},

Follow this little video to know how to use Fivemanage for media uploads ( avoid discord future problems ) with our Phone System:

(If you dont want this and keep "risking", we provide old system at same, just turn on UseOtherUploadSystem to true, UseFivemerrSystem to false and UseFiveManageSystem to false)

Using Fivemerr

Follow this little video to know how to use Fivemerr for media uploads ( avoid discord future problems ) with our Phone System:

(If you dont want this and keep "risking", we provide old system at same, just turn on UseOtherUploadSystem to true, UseFivemerrSystem to false and UseFiveManageSystem to false)

You can choice what system you want to use, Fivemanage or Fivemerr, they both work great, Fivemerr is know to have more space with free plans, so choice one of them and follow the video tutorial.

Video tutorial

If you have trouble installing it after all the explanation, you can watch this video of the script installation:

Click me

Last updated