Comment on page
📃
Config Walkthrough
A full walkthrough of all configuration options
Client Config
Server Config
UI Config
Config = {}
Config.Framework = 'QBCORE' -- 'QBCORE' or 'ESX'
if Config.Framework == 'QBCORE' then
QBCore = exports['qb-core']:GetCoreObject()
elseif Config.Framework == 'ESX' then
-- Newer esx versions e.g.
ESX = exports['es_extended']:getSharedObject()
-- Older versions
-- while ESX == nil do
-- TriggerEvent('esx:getSharedObject', function(sharedObject) ESX = sharedObject end)
-- Wait(500)
-- end
end
Change this depending on which framework you use.
Keybinds
-- Default: M
RegisterKeyMapping("icy_phone_toggle", "Phone", "keyboard", "M")
RegisterCommand("icy_phone_toggle", function()
exports[GetCurrentResourceName()]:open()
end, false)
-- Default: Backspace
RegisterKeyMapping("icy_phone_hangup", "Hang up phone", "keyboard", "BACK")
RegisterCommand("icy_phone_hangup", function()
exports[GetCurrentResourceName()]:callHangup()
end, false)
-- Default: Enter
RegisterKeyMapping("icy_phone_answer", "Answer incoming call", "keyboard", "RETURN")
RegisterCommand("icy_phone_answer", function()
exports[GetCurrentResourceName()]:callAnswer()
end, false)
Customize keybinds for the phone, or even remove these completely to make your own keybind system using the exports provided.
Config.PhotoWebhook = '<webhook here>'
The photo webhook should be a private channel somewhere, this is what the phone will use to upload photos people take & act as a sort of storage for the images. If you dont understand what webhooks are:
Config.PhoneModel = `prop_npc_phone_02`
If you have a custom made model for a phone, you can place it here. If you change this ensure the model is enclosed with ` instead of quotes, using ` returns the hash of the model.
AllowedPhoneItems
Config.AllowedPhoneItems = { ['phone'] = true }
The list of inventory items that count as a phone
Config.OnPlayerDied = ''
An event that is called when the player dies (to stop music playing, hanging up phone, etc.)
OnPlayerLoaded
Config.OnPlayerLoaded = 'QBCore:Client:OnPlayerLoaded'
Config.OnPlayerUnload = 'QBCore:Client:OnPlayerUnload'
Config.OnWeatherChange = 'qb-weathersync:client:SyncWeather'
An event that is called when the weather is changed, if you are using qb-weathersync leave this as is.
Config.AddPlayerToCall = function(callId)
exports["pma-voice"]:addPlayerToCall(callId)
-- Mumble example: exports["mumble-voip"]:addPlayerToCall(callId)
-- Saltychat example: TriggerServerEvent('icy-phone.config.AddPlayerToCall', callId)
end
Configure this function to support any VOIP script you would like, we have included an example for mumble-voip & saltychat - Saltychat will require you to configure the event provided in the server config.
Config.RemovePlayerFromCall = function(callId)
exports["pma-voice"]:removePlayerFromCall(callId)
-- Mumble example: exports["mumble-voip"]:removePlayerFromCall(callId)
-- Saltychat example: TriggerServerEvent('icy-phone.config.RemovePlayerFromCall', callId)
end
Configure this function to support any VOIP script you would like, we have included an example for mumble-voip & saltychat - Saltychat will require you to configure the event provided in the server config.
FakeTemperatures
Config.FakeTemperatures = {
['EXTRASUNNY'] = 27,
['CLEAR'] = 23,
['NEUTRAL'] = 21,
['SMOG'] = 19,
['FOGGY'] = 14,
['OVERCAST'] = 13,
['CLOUDS'] = 16,
['CLEARING'] = 17,
['RAIN'] = 12,
['THUNDER'] = 11,
['SNOW'] = -2,
['BLIZZARD'] = -5,
['SNOWLIGHT'] = -3,
['XMAS'] = -5,
['HALLOWEEN'] = 20,
}
The temperatures that are shown on the phone for each of the different weather types
Config.HasPhone = function()
if Config.Framework == 'QBCORE' then
local PlayerData = QBCore.Functions.GetPlayerData()
if PlayerData == nil or PlayerData.items == nil then return false end