[Q&A] GCPhone Questions? Ask them here, Will update main post frequently with updates

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.

1 Like

Hey,
It’s been two days. :slight_smile:
I still have no clue how to edit the app.js because I’m Pepega.

im having this issue where the phone has a white screen can anyone help me fix it


Literally all I did was change 289 -> 288 and the comment

I cant listen when i call another person, or they cant hear me… is there a way to fix that?

Hi guys, i need your help please :confounded:

I would like to update my gcphone but i don’t now how i instal

I drop gcphone ( with de client and server) but i don’t know where the “src_htmlPhone” goes

When i look your screenshot you have a folder html

Please guys, i love this script

Thanks to read me and for your help

1 Like

You grabbed the one part of the phone

Yes but how ?

And for the _ressource.lua ?

Oxiiie are you on one sync? If so you need to install a webrtc. I won’t be making instructions on that. Google is your friend.

If on 32 slot, do you have mumble disabled and running something like esx_voice?

If 32 slot. Make sure webrtc in config.json is set to false.

1 Like

I call a Friend but he dosent hear me i got a server with 14 slots I got esx_voice but and in the config.json wbrtc is false pls Help

Well, i have try and, i haven’t phone

(my player take a phone (animation) and after i have nothing on my screen)

Someone can help me ?

How do i set the gcphone as a item?

How do you make it so that when somone in your contact list calls it shows who is calling you rather than
“number”
“Unknown Caller”

I have a person saved as “Name” but when “name” calls me it says
“number”
“Unknown Caller”

Look at the lines 45 -69 for the client.lua
and Look at the lines 28-42 for the server.lua

And i thinks you need to create a item with the name of “phone” but i’m not sure for that

try and tell me if has worked

Has anyone got a fix for my problem?

I was wondering if there was a way to auto assign phone numbers when players join, is there anyway?

Just realized today that when new “users” are registered, they don’t get assigned a phone number? anyone had this issue?

1 Like

Create a phone in your items table of your database
It is in the first post of this thread…

Check your config.lua

When people log in for the first time, it should automatically give them a phone number.