feat(server/player): PlayerLoaded event for third party handling

Third party resources may need access to created Player instance on join, emit 'QBCore:Server:PlayerLoaded' with ref
This commit is contained in:
Taso
2021-08-21 17:45:00 -04:00
parent 545e029e84
commit 0e68bbf1b5
+4 -1
View File
@@ -423,9 +423,12 @@ QBCore.Player.CreatePlayer = function(PlayerData)
self.Functions.Save = function()
QBCore.Player.Save(self.PlayerData.source)
end
QBCore.Players[self.PlayerData.source] = self
QBCore.Player.Save(self.PlayerData.source)
-- At this point we are safe to emit new instance to third party resource for load handling
TriggerEvent('QBCore:Server:PlayerLoaded', self)
self.Functions.UpdatePlayerData()
end