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.
In the config.lua file, we have the Config.UniquePhones option.
The Phone System only supports this system on ESX if the server uses ox_inventory, otherwise you need to disable this option and use the normal system (global phones, i.e. each player with their own phone).
Integration with the home system
Due to the huge variety of home systems for ESX, if you want to make your system compatible with the phone system, please open a ticket on our discord, we will help you.
Add this inside server_config file of Phone System:
ESX.RegisterServerCallback('jpr-phonesystem:server:GetPlayerHouses', function(source, cb, serie)
local src = source
local Player = ESX.GetPlayerFromId(src)
local MyHouses = {}
local CitizenId = MySQL.Sync.fetchAll('SELECT * FROM jpr_phonesystem_base WHERE idtelemovel = ?', {serie})
if (CitizenId[1]) then
-- for housing system adaptation, please open a discord ticket and talk with us
local pHouses = exports["esx_property"]:GetPlayerProperties(CitizenId[1].citizenid)
if pHouses then
for k, v in pairs(pHouses) do
if (pHouses[k]) then
pHouses[k].house = pHouses[k].Name
pHouses[k].citizenid = pHouses[k].Owner
pHouses[k].HouseData = {
coords = {
enter = {
x = pHouses[k].Entrance.x,
y = pHouses[k].Entrance.y,
}
},
adress = pHouses[k].Name,
}
pHouses[k].tier = pHouses[k].Interior
pHouses[k].label = pHouses[k].Name
end
end
cb(pHouses)
else
cb(nil)
end
else
cb(nil)
end
end)
Open config.lua of Phone System and change house name to this one:
Config.HouseScriptName = "jpr-housing"
Add this inside server_config file of Phone System:
ESX.RegisterServerCallback('jpr-phonesystem:server:GetPlayerHouses', function(source, cb, serie)
local myHouses = {}
local citizenId = MySQL.scalar.await('SELECT citizenid FROM jpr_phonesystem_base WHERE idtelemovel = ?', { serie })
if not citizenId then
return cb(nil)
end
local houses = MySQL.query.await("SELECT propertyid FROM loaf_properties WHERE owner = ?", { citizenId })
for i = 1, #houses do
local propertyId = houses[i].propertyid
local house = exports.loaf_housing:GetHouse(propertyId)
if house then
myHouses[#myHouses+1] = {
house = house.label,
label = house.label,
citizenid = citizenId,
HouseData = {
coords = {
enter = {
x = house.entrance.x,
y = house.entrance.y,
},
},
adress = house.label,
},
tier = {
label = "??",
}
}
end
end
cb(myHouses)
end)
This part is a template of our callback to house script owners being able to be supported by us, just need to adapt this little callback and everything will work perfect:
(Can be added inside server_config.lua of Phone System or directly on Housing Script server side.)
ESX.RegisterServerCallback('jpr-phonesystem:server:GetPlayerHouses', function(source, cb, serie)
local src = source
local Player = ESX.GetPlayerFromId(src)
local MyHouses = {}
local CitizenId = MySQL.Sync.fetchAll('SELECT * FROM jpr_phonesystem_base WHERE idtelemovel = ?', {serie})
if (CitizenId[1]) then
-- for housing system adaptation, please open a discord ticket and talk with us
local pHouses = exports["esx_property"]:GetPlayerProperties(CitizenId[1].citizenid)
if pHouses then
for k, v in pairs(pHouses) do
if (pHouses[k]) then
pHouses[k].house = pHouses[k].Name
pHouses[k].citizenid = pHouses[k].Owner
pHouses[k].HouseData = {
coords = {
enter = {
x = pHouses[k].Entrance.x,
y = pHouses[k].Entrance.y,
}
},
adress = pHouses[k].Name,
}
pHouses[k].tier = pHouses[k].Interior
pHouses[k].label = pHouses[k].Name
end
end
cb(pHouses)
else
cb(nil)
end
else
cb(nil)
end
end)
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.
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!
Inventory
Dont need to do any changes, just be sure you have all phones items and powerbank item created on SQL itemsTable.
ox_inventory - data - items.lua, replace phone item and add powerbank item:
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)
The default ESX inventory does not require any modification
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)
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.