mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 23:01:29 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user