Refactor (esx_example (client &server )): Fix Formatting and add useful prints

This commit is contained in:
Mycroft
2022-04-06 19:41:19 +01:00
parent 9acf0b29d6
commit ba09b5fc4a
2 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -1,11 +1,12 @@
RegisterNetEvent('esx:playerLoaded') -- Store the players data
AddEventHandler('esx:playerLoaded', function(xPlayer, isNew)
print("Player Loaded. New | " .. isNew)
ESX.PlayerData = xPlayer
ESX.PlayerLoaded = true
end)
RegisterNetEvent('esx:playerLogout') -- When a player logs out (multicharacter), reset their data
AddEventHandler('esx:playerLogout', function(xPlayer, isNew)
AddEventHandler('esx:playerLogout', function()
ESX.PlayerLoaded = false
ESX.PlayerData = {}
end)