Update player.lua

A more comprehensive way of notifying a player and checking if a player has items from the server side.
This commit is contained in:
Cocodrulo
2023-08-18 14:49:08 +01:00
committed by GitHub
parent 083229887b
commit 1769fbe8b0
+8
View File
@@ -249,6 +249,14 @@ function QBCore.Player.CreatePlayer(PlayerData, Offline)
return true
end
function self.Functions.Notify(text, type, lenght)
TriggerClientEvent('QBCore:Notify', self.PlayerData.source, text, type, lenght)
end
function self.Functions.HasItem(items, amount)
QBCore.Functions.HasItem(self.PlayerData.source, items, amount)
end
function self.Functions.SetJobDuty(onDuty)
self.PlayerData.job.onduty = not not onDuty -- Make sure the value is a boolean if nil is sent
TriggerEvent('QBCore:Server:OnJobUpdate', self.PlayerData.source, self.PlayerData.job)