Open DestinyDragon49 opened 4 years ago
I tried this and it worked for me: in server.lua, add this at the beginning
local ESX = nil
TriggerEvent('esx:getSharedObject', function(obj)
ESX = obj
end)
Replace
function getPlayerID(source)
local identifiers = GetPlayerIdentifiers(source)
local player = getIdentifiant(identifiers)
return player
end
by
function getPlayerID(source)
local xplayer = ESX.GetPlayerFromId(source)
local player = xplayer.identifier
return player
end
Then replace
function getSourceFromIdentifier(identifier, cb)
TriggerEvent("esx:getPlayers", function(users)
for k , user in pairs(users) do
if (user.getIdentifier ~= nil and user.getIdentifier() == identifier) or (user.identifier == identifier) then
cb(k)
return
end
end
end)
cb(nil)
end
by
function getSourceFromIdentifier(identifier, cb)
local users = ESX.GetPlayers()
for k , user in pairs(users) do
local xplayer = ESX.GetPlayerFromId(user)
if (xplayer.getIdentifier ~= nil and xplayer.getIdentifier() == identifier) or (xplayer.identifier == identifier) then
cb(k)
return
end
end
--cb(nil)
end
and if the phone numbers aren’t given replace:
es:playerLoaded
by
esx:playerLoaded
You'll still have an error on the console but it works
Thank you, it worked but i change this:
function getPlayerID(source)
local xplayer = ESX.GetPlayerFromId(source)
local player = xplayer.identifier
return player
end
to this
function getPlayerID(source)
local xPlayer = ESX.GetPlayerFromId(source)
local player = xPlayer.getIdentifier()
return player
end
btw the console show this: SCRIPT ERROR: @gcphone/server/server.lua:82: attempt to index a nil value (local 'xPlayer')
but it does not affect the operation, I think I will leave it like that lol 🤷♂️
It worked but when you got more players inside phone number shuffled . I mean instead of you will received that message other player received? anyone ?
Its still not working. Hmm i think we need to rework complete server side
same issue for the fixing SCRIPT ERROR: @gcphone/server/server.lua:82: attempt to index a nil value (local 'xPlayer')
ny solution for this problem. Regards. I'm a little bad for English
@Guigui thanks a lot man!
Thanks! This working
It worked but when you got more players inside phone number shuffled . I mean instead of you will received that message other player received? anyone ?
@phpadmin1 same for me, do you have a solution ?
It worked but when you got more players inside phone number shuffled . I mean instead of you will received that message other player received? anyone ?
@phpadmin1 same for me, do you have a solution ?
When i call, the console show this: [gcphone] An error happens on MySQL for query "INSERT INTO phone_calls (
owner
,num
,incoming
,accepts
) VALUES(@owner, 'police', 1, false)": ER_BAD_NULL_ERROR: Column 'owner' cannot be null