Tutorial For GCPhone with call and job message...other

phone
esx_phone
gcphone
call

#104

Oh ok,
Maybe check in the server.lua if player have item :

local phone_item = xPlayer.getInventoryItem('nameofphoneindb')
local xPlayer = ESX.GetPlayerFromId(destPlayer)

And check this party of code (not sure because I’m at work and I do not have access to everything :thinking:)

    if is_valid == true then
        getSourceFromIdentifier(destPlayer, function (srcTo)
            if srcTo ~= nill then
                AppelsEnCours[indexCall].receiver_src = srcTo
                TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
                TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
                TriggerClientEvent('gcPhone:waitingCall', srcTo, AppelsEnCours[indexCall], false)
            else
                TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
                TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
            end
        end)
    else
        TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
        TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
    end

look this ?

	local xPlayer = ESX.GetPlayerFromId(destPlayer)
	local phone_item = xPlayer.getInventoryItem('nameofphoneindb')

    if is_valid == true then
        getSourceFromIdentifier(destPlayer, function (srcTo)
		
			if phone_item.count ~= 0 then -- add this
				if srcTo ~= nill then
					AppelsEnCours[indexCall].receiver_src = srcTo
					TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
					TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
					TriggerClientEvent('gcPhone:waitingCall', srcTo, AppelsEnCours[indexCall], false)
				else
					TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
					TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
				end
			end 
			-- fin
        end)
   -- else
        --TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
        --TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
    end

#105

Hi, is there some way to set zoom at 80% by default?


#106

attempt to index a nil value (local ‘xPlayer’) on “local phone_item = xPlayer.getInventoryItem(‘phone’)” It Doesnt want to grab destPlayer for some reason


#107

Hi,

Maybe add in your config.json this :

"zoom" : "80%",

Or in your html/static/js/app.js, search

 zoom: window.localStorage.gc_zoom || "100%",

and replace by :

 zoom: window.localStorage.gc_zoom || "80%",

#108

Hummm…

    if is_valid == true then
        getSourceFromIdentifier(destPlayer, function (srcTo)
			local xPlayer = ESX.GetPlayerFromId(destPlayer)
			local phone_item = xPlayer.getInventoryItem('phone')
			
			if phone_item.count ~= 0 then -- add this
				if srcTo ~= nill then
					AppelsEnCours[indexCall].receiver_src = srcTo
					TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
					TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
					TriggerClientEvent('gcPhone:waitingCall', srcTo, AppelsEnCours[indexCall], false)
				else
					TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
					TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
				end
			end 
			-- fin
        end)
   -- else
        --TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
        --TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
    -- endriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
    end

#109

Same result. Don’t know what i’m doing wrong.


#110

If you add a simple print for get the value of “destPlayer” what does it return? (look in F8 console)

    if is_valid == true then
        getSourceFromIdentifier(destPlayer, function (srcTo)
			local xPlayer = ESX.GetPlayerFromId(destPlayer)
			local phone_item = xPlayer.getInventoryItem('phone')
---- THIS
			print(xPlayer .. "=>" .. srcTo)
---- THIS
			if phone_item.count ~= 0 then -- add this
				if srcTo ~= nill then
					AppelsEnCours[indexCall].receiver_src = srcTo
					TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
					TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
					TriggerClientEvent('gcPhone:waitingCall', srcTo, AppelsEnCours[indexCall], false)
				else
					TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
					TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
				end
			end 
			-- fin
        end)
   -- else
        --TriggerEvent('gcPhone:addCall', AppelsEnCours[indexCall])
        --TriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
    -- endriggerClientEvent('gcPhone:waitingCall', sourcePlayer, AppelsEnCours[indexCall], true)
    end

#111

It returns the number i was calling. {“numero”: “924-4835”}


#112

Oh yep… it’s just the number of the player calling …
I’m sorry i do not see how, I’m not competent enough to help you more :disappointed_relieved:


#113

Get this error over and over. No idea why.

Edit: fixed this but the whole mod is broken and this tutorial confused the hell outta me haha. Might give this mod a miss. Sucks though because I’ve used this on another server and it was fantastic.


#114

Je suis bien troubler. Voila quelques semaine que je jongle avec gcphone…
J’ai fais toutes les manip.
Le cellulaire ouvre… par contre les messages… sms ou darkchat ne sont pas instantanné…
Il s’affiche seulement après une reconnection…
EX: j’envoie message d’urgence a la police…
La police recoie le ou les message lors de sa prochaine connection seulement.
Meme chose pour les sms.

Aussi sur console j’ai cette erreur lorsque j’envoie un sms ou message:

mysql-async.js:211133: Uncaught TypeError: Cannot read property ‘type’ of undefined

Si je peut avoir l’assistance de quelqu’un avec qui GCPHONE fonctionne bien svp.

discord:
sixsens#5703

Merci Beaucoup


#115

J’ai mis a jour mysql async… et maintenant les message sms entre cependant quand j’eesaie de voir le nouveau message entrant, je clique l’icone messagerie et l’écran est blanc. :face_with_head_bandage:

Aussi nouveau message d’erreur sur console:
[MySQL] [Slow Query Warning] [gcphone] [869ms] SELECT phone_messages.* FROM phone_messages LEFT JOIN users ON users.identifier = ‘steam:11111111111’ WHERE phone_messages.receiver = users.phone_number
[MySQL] [Slow Query Warning] [es_extended] [2284ms] UPDATE users SET name = ‘Sixsens’ WHERE identifier = ‘steam:1111111112222’


#116

Hello,
[MySQL] [Slow Query Warning] [es_extended] [2284ms]

2284 ms pour récupérer les infos de la base, il y a un problème. Ton serveur tourne sous Windows/Linux ? Tu as quelle version de mysql / async ?


#117

sous windows server

la derniere version mysql / async
3.0.8


#118

I was able to get the steam id from the phonenumber i was calling but even then it prints as null when checking inventory.

local target = getIdentifierByPhoneNumber(phone_number)
print(target ) returns “steam:xxxxxxxxxxx”
local phone = target.getInventoryItem(‘phone’).count
print(target ) returns “null”


#119

Test with :

local phone = target.getInventoryItem("phone")


if phone.count ~= 0 then 

end

#120

That didn’t work but then i realised it started events in the client and added check there instead. Everything is working flawlessly now :slight_smile: thankyou so much for your help


#121

hello, what is it for you gcphone works perfectly? because other people and I, we have the concern of the whitescreen in the messages, when we receive a message in games so a new message when we return in the app it will be directly in whitescreen on the other hand if we leave and come back can see the messages in the app but the next message that we will find the whitescreen come back, as if it was because of you have a new message, here is the error code in the game console nui: // gcphone / html / static / js / vendor.js: 6, TypeError: Can not read property ‘0’ of undefined


#122

Hi !
Yep, the gcphone works properly for me. If this is not the case for you, try downloading my version on github => https://github.com/HalCroves/gcphone

  • The only thing that does not work for now is the selfies

For vendor.js: 6, TypeError: Can not read property ‘0’ of undefined, I would have to look :thinking:


#123

thx Halcroves I will test