JPResources Documentation
  • 👋Welcome to JPResources
  • Installation
    • 📲Phone System
      • Installation Page
        • QBCore
        • QBox
        • ESX
        • VRPex
      • Config File
      • Events & Commands
      • Custom APPs
      • Translations
      • Common Problems
      • Installation Video
    • 🏡Housing System
      • Installation Page
        • QBCore
        • QBox
        • ESX
      • Events & Commands
      • How to add MLO House
      • How to add SHELL Tier
      • Translations
      • Common Problems
    • 🚨MDT System
      • How to install
      • Events & Commands
      • Translations
    • 🏥EMS MDT System
      • How to install
      • Events & Commands
      • Translations
    • 🎒Inventory
      • How to install
      • Events & Commands
      • Translations
      • Common Issues
    • 🚘Vehicle Shops
      • Installation Page
        • QBCore
        • Qbox
        • ESX
      • Translations
    • 💰Business System
      • Installation Page
        • QBCore
        • Qbox
        • ESX
      • Translations
    • 💼Job System
      • Installation Page
        • QBCore
        • QBox
        • ESX
      • Translations
    • 📱Budget Phone
      • QBCore
    • ⚙️Crew System
      • QBCore
    • 👚Clothing System
      • QBCore
    • 🏢Garage System
      • Installation Page
        • QBCore
        • QBox
        • ESX
    • 👪Multichar
      • Installation Page
        • QBCore
        • ESX
    • 🔪Territories
      • Installation Page
        • QBCore
        • QBox
        • ESX
    • 🎒Backpack
      • QBCore
    • 💴Moneywash
      • Installation Page
        • QBCore
        • QBox
        • ESX
    • 🌊Poolcleaner Job
      • Installation Page
    • 🚗TDi Smoke
      • Installation Page
  • Support / Store
    • 🛠️Where i can find support and buy new scripts
    • 🛠️FiveM asset escrow errors
Powered by GitBook
On this page
  • Dependencies Part
  • Webhooks
  • Integration with the home system
  • Permissions to JPR Phone System
  • SQL
  • MDT
  • Inventory Setup
  • Using Fivemanage
  • Using Fivemerr
  • Setup Google API Key
  • Video tutorial
  1. Installation
  2. Phone System
  3. Installation Page

QBCore

PreviousInstallation PageNextQBox

Last updated 1 month ago

You will receive the script in 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 , and follow their respective installation instructions.

Dependencies Part

  • ( optional )

  • ( optional )

  • ( optional )

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.

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)

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

Config.HouseScriptName = "ps-housing"

Edit server side file of PS-Housing, 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 properties WHERE owner_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.property_id,
                    keyholders = {},
                    owner = CitizenId[1].citizenid,
                    label = v.street,
                    tier = v.shell,
                }

                if v.has_access ~= "null" then
                    v.has_access = json.decode(v.has_access)
                    if v.has_access then
                        for _, data in pairs(v.has_access) 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
                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 properties', {})
        for _, v in pairs(result) do
            if v.has_access ~= "null" then
                v.has_access = json.decode(v.has_access)
                for _, p in pairs(v.has_access) do
                    if p == CitizenId[1].citizenid and (v.citizenid ~= CitizenId[1].citizenid) then
                        local coordsRaw = json.decode(v.door_data)
                        MyKeys[#MyKeys+1] = {
                            HouseData = {
                                adress = v.street,
                                coords = {
                                    enter = {
                                        x = coordsRaw.x,
                                        y = coordsRaw.y,
                                    }
                                },
                                name = v.property_id,
                            }
                        }
                    end
                end
            end
            
            if v.citizenid == CitizenId[1].citizenid then
                local coordsRaw = json.decode(v.door_data)
                MyKeys[#MyKeys+1] = {
                    HouseData = {
                        adress = v.street,
                        coords = {
                            enter = {
                                x = coordsRaw.x,
                                y = coordsRaw.y,
                            }
                        },
                        name = v.property_id,
                    }
                }
            end
        end
    end
    cb(MyKeys)
end)

RegisterNetEvent('ps-housing:server:removeHouseKey', function(house, citizenData)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end

    local result = MySQL.query.await('SELECT * FROM properties where property_id = ?', {house})
    if #result > 0 then
        local newHolders = {}
        if result[1].has_access then
            local oldKeys = json.decode(result[1].has_access)
            for k, _ in pairs(oldKeys) do
                if oldKeys[k] ~= citizenData.citizenid then
                    newHolders[#newHolders+1] = oldKeys[k]
                end
            end
        end
    
        MySQL.update('UPDATE properties SET has_access = ? WHERE property_id = ?', {json.encode(newHolders), house})
    end
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
        MySQL.update(
            'UPDATE properties SET owner_citizenid = ? WHERE property_id = ?',
            {NewCid, HouseName})
        
        cb(true)
    else
        cb(false)
    end
end)

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

Config.HouseScriptName = "qs-housing"

Open fxmanifest.lua of QS-Housing and on server_scripts add this line:

Ready to go!

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

Config.HouseScriptName = "s4-house"

Open fxmanifest.lua of S4-House and on server_scripts add this line:

Ready to go!

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

Config.HouseScriptName = "jpr-housing"

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

Config.HouseScriptName = "loaf-housing"

Open fxmanifest.lua of Loaf-Housing and on server_scripts add this line:

Ready to go!

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 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 qb-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'},

Go to qb-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' },

ox_inventory - data - items.lua, replace phone item and add powerbank item:

['phone'] = {
	label = 'Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_white'] = {
	label = 'White Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_gold'] = {
	label = 'Gold Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_red'] = {
	label = 'Red Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_blue'] = {
	label = 'Blue Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_green'] = {
	label = 'Green Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_pink'] = {
	label = 'Pink Phone',
	weight = 190,
	stack = false,
	close = true,
},
['phone_green_light'] = {
	label = 'Green Light Phone',
	weight = 190,
	stack = false,
	close = true,
},
['powerbank'] = {
	label = 'Powerbank',
	weight = 190,
	stack = false,
	close = false,
},

ox_inventory - client.lua, remove this lines:

local phone = Items.phone

	if phone and phone.count < 1 then
		pcall(function()
			return exports.npwd:setPhoneDisabled(true)
		end)
	end

ox_inventory - modules - items - client.lua, remove this lines:

Item('phone', function(data, slot)
	local success, result = pcall(function()
		return exports.npwd:isPhoneVisible()
	end)

	if success then
		exports.npwd:setPhoneVisible(not result)
	end
end)

(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)

(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.

Setup Google API Key

Just need to follow this quick 1 min video:

Without this Google API Key, your spotify and youtube WILL NOT WORK!!

Video tutorial

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

For more info how to create a discord webhook follow this tutorial:

'jprphonesystem.lua', Now add this file on QS-Housing folder:

'jprphonesystem.lua', Now add this file on S4-House folder:

'jprphonesystem.lua', Now add this file on Loaf-Housing folder:

MDT

Using

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

Using

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

( video 1 ) or ( video 2 ) or ( video 3)

📲
⚠️
https://www.youtube.com/watch?v=fKksxz2Gdnc&t=7s&ab_channel=NoIntroTutorials
https://drive.google.com/file/d/10VIew0k2E_Ffg7EkzCLMw3WYdouPuD0a/view?usp=drive_link
https://drive.google.com/file/d/1cIFRyGNz9nfL6WDhPTk7utrGgLnQF6GJ/view?usp=drive_link
https://drive.google.com/file/d/1a0kQHnBzxE1NHU4PlXUg6xPxYxnMPRIS/view?usp=drive_link
Fivemanage
Fivemanage
Fivemerr
Fivemerr
Click me
Click me
Click me
keymaster.fivem.net
qb-core
oxmysql
qb-crypto
qb-houses
qb-lapraces
screenshot-basic
xsound
dependencies