Add ESX.PlayerLoaded

This commit is contained in:
Jérémie N'gadi
2017-08-30 18:07:18 +02:00
parent 10a903c9e0
commit 9c849044d5
2 changed files with 5 additions and 5 deletions
@@ -6,6 +6,7 @@ for i = 97, 122 do table.insert(Charset, string.char(i)) end
ESX = {}
ESX.PlayerData = {}
ESX.PlayerLoaded = false
ESX.CurrentRequestId = 0
ESX.ServerCallbacks = {}
ESX.TimeoutCallbacks = {}
@@ -12,7 +12,6 @@ local Keys = {
local GUI = {}
GUI.Time = 0
local PlayerLoaded = false
local LoadoutLoaded = false
local IsPaused = false
local LastLoadout = {}
@@ -21,8 +20,8 @@ local Pickups = {}
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerLoaded = true
ESX.PlayerData = xPlayer
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer
for i=1, #xPlayer.accounts, 1 do
@@ -60,7 +59,7 @@ AddEventHandler('playerSpawned', function()
Citizen.CreateThread(function()
while not PlayerLoaded do
while not ESX.PlayerLoaded do
Citizen.Wait(0)
end
@@ -89,7 +88,7 @@ end)
AddEventHandler('skinchanger:modelLoaded', function()
while not PlayerLoaded do
while not ESX.PlayerLoaded do
Citizen.Wait(0)
end