Fix xPlayer is nil

This commit is contained in:
Jérémie N'gadi
2017-08-09 09:59:31 +02:00
parent d823f61715
commit 455fe5cb6c
+1 -2
View File
@@ -181,6 +181,7 @@ end)
RegisterServerEvent('esx_phone:addPlayerContact')
AddEventHandler('esx_phone:addPlayerContact', function(phoneNumber, contactName)
local xPlayer = ESX.GetPlayerFromId(source)
local xPlayers = ESX.GetPlayers()
local foundNumber = false
local foundPlayer = nil
@@ -197,8 +198,6 @@ AddEventHandler('esx_phone:addPlayerContact', function(phoneNumber, contactName)
end
if foundNumber then
local xPlayer = ESX.GetPlayerFromId(source)
if phoneNumber == xPlayer.get('phoneNumber') then
TriggerClientEvent('esx:showNotification', _source, 'Vous ne pouvez pas vous ajouter vous-même')