mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
feat (main): Pulling main into dev. (#542)
* Update README.md * Update README.md * feat (locale/tr): Added turkish locale. Türkçe Karakter Yer Almakta * feat (locale/es): Added spanish. * updated spanish Sounded weird * Update es.lua * feat (locale/lv): Added latvian. I'm personally a native speaker and I can approve this is correct. * feat(qb-core/player): Added server-side event onJobUpdate (#516) Added server-side event onJobUpdate so scripts can listen on server if any player changed their job. It's safer than redirecting client event to server again. * feat (server/player): Added Job update on duty update (#519) * Trigger Job Update on Duty Update * Add server event Co-authored-by: Kakarot <57848836+GhzGarage@users.noreply.github.com> Co-authored-by: Muhammed Developer <56224780+muhammed10100@users.noreply.github.com> Co-authored-by: MonkeyWhisper <82112471+MonkeyWhisper@users.noreply.github.com> Co-authored-by: Casper <71441748+JajarGaming@users.noreply.github.com> Co-authored-by: Chaini <28576404+chainiDV@users.noreply.github.com> Co-authored-by: Brady F <bmf1418@gmail.com>
This commit is contained in:
@@ -196,6 +196,7 @@ function QBCore.Player.CreatePlayer(PlayerData)
|
||||
end
|
||||
|
||||
self.Functions.UpdatePlayerData()
|
||||
TriggerEvent('QBCore:Server:OnJobUpdate', self.PlayerData.source, self.PlayerData.job)
|
||||
TriggerClientEvent('QBCore:Client:OnJobUpdate', self.PlayerData.source, self.PlayerData.job)
|
||||
return true
|
||||
end
|
||||
@@ -233,6 +234,8 @@ function QBCore.Player.CreatePlayer(PlayerData)
|
||||
self.Functions.SetJobDuty = function(onDuty)
|
||||
self.PlayerData.job.onduty = onDuty
|
||||
self.Functions.UpdatePlayerData()
|
||||
TriggerEvent('QBCore:Server:OnJobUpdate', self.PlayerData.source, self.PlayerData.job)
|
||||
TriggerClientEvent('QBCore:Client:OnJobUpdate', self.PlayerData.source, self.PlayerData.job)
|
||||
end
|
||||
|
||||
self.Functions.SetMetaData = function(meta, val)
|
||||
|
||||
Reference in New Issue
Block a user