PLEASE BE DETAILED ABOUT YOUR QUESTIONS AND DESCRIPTIVE ABOUT YOUR ISSUES, ANY IMAGES, ERROR CODES IN F8 or Console, ETC HELPS US RESOLVE YOUR ISSUE FASTER!!!
We also need to know which version of the phone you’re using, Did you update it from Halcroves Github, or Mine, and are you on the mysql-async 2.x version or 3.x
So I have seen A LOT of people asking various questions about the GCPhone system in various posts all over the forums, and I would like to help clean this up a bit.
ANY questions you have, please ask them here. I will contact Halcroves also to see if he wants to help with some of the questions, and I will update the first post here as time allows with the most frequent questions and the answers on how to resolve those questions.
Feel free to ask anything GCPhone related specifically, and one of the members around here can/will answer if/when we have time.
Question: Numbers aren’t generating for my players, How can I fix this?
Answer: Check this post by @yknuff [Q&A] GCPhone Questions? Ask them here, Will update main post frequently with updates
Question: How do I make Distress Signals work when you’re injured?
Answer: Search your esx_ambulancejob for:
function SendDistressSignal()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
ESX.ShowNotification(_U('distress_sent'))
TriggerServerEvent('esx_phone:send', 'ambulance', _U('distress_message'), false, {
x = coords.x,
y = coords.y,
z = coords.z
})
end
And replace with
function SendDistressSignal()
local playerPed = PlayerPedId()
PedPosition = GetEntityCoords(playerPed)
local PlayerCoords = { x = PedPosition.x, y = PedPosition.y, z = PedPosition.z }
ESX.ShowNotification(_U('distress_sent'))
TriggerServerEvent('esx_addons_gcphone:startCall', 'ambulance', _U('distress_message'), PlayerCoords, {
PlayerCoords = { x = PedPosition.x, y = PedPosition.y, z = PedPosition.z },
})
end
---------------------------------------------------------
Question: Calls aren’t working for police and ambulance/ems. How do I fix this?
Answer: The typical reason for this not working is because you Didn’t set your config up properly. You need to start esx_addons_gcphone and gcphone resources. Set your config up in this order:
####################### ES Base
start mysql-async
start essentialmode
start esplugin_mysql
start es_admin2
####################### BASIC
start instance
start es_extended
start esx_voice
start esx_addons_gcphone
start gcphone
###### Jobs ######
start esx_service
start esx_mecanojob
start esx_lscustom
start esx_truckerjob
---------------------------------------------------------------------
Question: How do I make the phone an Item? And purchasable.
Answer:
Add this to client.lua: (This opens the phone linked to an item)
ESX = nil
Citizen.CreateThread (function ()
while ESX == nil do
TriggerEvent (‘esx: getSharedObject’, function (obj) ESX = obj end)
Citizen.Wait (0)
end
end)
function hasPhone (cb)
if (ESX == nil) then return cb (0) end
ESX.TriggerServerCallback (‘gcphone: getItemAmount’, function (qtty)
cb (qtty> 0)
end, ‘phone’)
end
function ShowNoPhoneWarning ()
if (ESX == nil) then return end
ESX.ShowNotification (“You do not have a ~ r ~ phone ~ s ~”)
end
In the server side put:
local ESX = nil
TriggerEvent(‘esx:getSharedObject’, function(obj)
ESX = obj
ESX.RegisterServerCallback(‘gcphone:getItemAmount’, function(source, cb, item)
print('gcphone:getItemAmount call item : ’ … item)
local xPlayer = ESX.GetPlayerFromId(source)
local items = xPlayer.getInventoryItem(item)
if items == nil then
cb(0)
else
cb(items.count)
end
end)
end)
After that, in your Database, go to the items table, Right click inside and click “INSERT ROW” and set:
name: phone
label: Phone (Or whatever you want it to display as in your inventory)
limit: 1 (Unless you want them to be able to hold more than 1 item, but it’s useless to have more than 1 unless selling phones to people or buying one for a friend.)
And leave other options like “id” and “rare” and “can_remove” as default.
Make sure you put the item into your stores so they are purchasable.