Duty Toggles
Needs Tested
This commit is contained in:
1 parent
ecaf970e48
commit
7e294b55fa
3 files changed
+19
-1
No files matched your search
@@ -151,7 +151,14 @@ end
|
|||||||
Framework.SetPlayerJob = function(src, name, grade)
|
Framework.SetPlayerJob = function(src, name, grade)
|
||||||
local xPlayer = ESX.GetPlayerFromId(src)
|
local xPlayer = ESX.GetPlayerFromId(src)
|
||||||
if not ESX.DoesJobExist(name, grade) then lib.print.error("Job Does Not Exsist In Framework :NAME "..name.." Grade:"..grade) return end
|
if not ESX.DoesJobExist(name, grade) then lib.print.error("Job Does Not Exsist In Framework :NAME "..name.." Grade:"..grade) return end
|
||||||
return xPlayer.setJob(name, grade)
|
return xPlayer.setJob(name, grade, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
Framework.ToggleDuty = function(src, status)
|
||||||
|
local xPlayer = ESX.GetPlayerFromId(src)
|
||||||
|
local name = xPlayer.getJob().name
|
||||||
|
local grade = xPlayer.getJob().grade
|
||||||
|
xPlayer.setJob(name, grade, status)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Framework.AddAccountBalance(src, _type, amount)
|
-- Framework.AddAccountBalance(src, _type, amount)
|
||||||
|
|||||||
@@ -182,6 +182,12 @@ Framework.SetPlayerJob = function(src, name, grade)
|
|||||||
return player.Functions.SetJob(name, grade)
|
return player.Functions.SetJob(name, grade)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Framework.ToggleDuty = function(src, status)
|
||||||
|
local player = QBCore.Functions.GetPlayer(src)
|
||||||
|
player.Functions.SetJobDuty(status)
|
||||||
|
TriggerEvent('QBCore:Server:SetDuty', src, player.PlayerData.job.onduty)
|
||||||
|
end
|
||||||
|
|
||||||
-- Framework.AddAccountBalance(src, _type, amount)
|
-- Framework.AddAccountBalance(src, _type, amount)
|
||||||
-- Adds the specified amount to the player's account balance of the specified type.
|
-- Adds the specified amount to the player's account balance of the specified type.
|
||||||
Framework.AddAccountBalance = function(src, _type, amount)
|
Framework.AddAccountBalance = function(src, _type, amount)
|
||||||
|
|||||||
@@ -181,6 +181,11 @@ Framework.SetPlayerJob = function(src, name, grade)
|
|||||||
return player.Functions.SetJob(name, grade)
|
return player.Functions.SetJob(name, grade)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Framework.ToggleDuty = function(src, status)
|
||||||
|
local playerData = QBox:GetPlayer(src).PlayerData
|
||||||
|
QBox:SetJobDuty(playerData.citizenid, status)
|
||||||
|
end
|
||||||
|
|
||||||
-- Framework.AddAccountBalance(src, _type, amount)
|
-- Framework.AddAccountBalance(src, _type, amount)
|
||||||
-- Adds the specified amount to the player's account balance of the specified type.
|
-- Adds the specified amount to the player's account balance of the specified type.
|
||||||
Framework.AddAccountBalance = function(src, _type, amount)
|
Framework.AddAccountBalance = function(src, _type, amount)
|
||||||
|
|||||||
Reference in new issue
Block a user