Merge pull request #5 from The-Order-Of-The-Sacred-Framework/dev

Merge dev into main
This commit is contained in:
MrNewb authored and GitHub committed 2025-01-13 14:25:51 -05:00
commit 0f6578bcd7
6 files changed
+32 -4

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ lua54 'yes'
use_experimental_fxv2_oal 'yes'
author 'The Order of the Sacred Framework'
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
version '0.0.11'
version '0.1.2'
shared_scripts {
'settings/sharedConfig.lua',
+1 -1
View File
@@ -5,7 +5,7 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
end
Inventory.RemoveItem = function(src, item, count, slot, metadata)
return Framework.RemoveItem(src, item, count, slot, metadata)
return Framework.RemoveItem(src, item.name, count, slot, metadata)
end
Inventory.GetItemInfo = function(item)
+18 -1
View File
@@ -151,7 +151,14 @@ end
Framework.SetPlayerJob = function(src, name, grade)
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
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
-- Framework.AddAccountBalance(src, _type, amount)
@@ -193,4 +200,14 @@ end
-- Registers a usable item with a callback function.
Framework.RegisterUsableItem = function(item, cb)
ESX.RegisterUsableItem(item, cb)
end
Framework.Commands = {}
Framework.Commands.Add = function(name, help, arguments, argsrequired, callback, permission, ...)
ESX.RegisterCommand(name, permission, function(xPlayer, args, showError)
callback(xPlayer, args)
end, false, {
help = help,
arguments = arguments
})
end
+6
View File
@@ -182,6 +182,12 @@ Framework.SetPlayerJob = function(src, name, grade)
return player.Functions.SetJob(name, grade)
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)
-- Adds the specified amount to the player's account balance of the specified type.
Framework.AddAccountBalance = function(src, _type, amount)
+5
View File
@@ -181,6 +181,11 @@ Framework.SetPlayerJob = function(src, name, grade)
return player.Functions.SetJob(name, grade)
end
Framework.ToggleDuty = function(src, status)
local playerData = QBox:GetPlayer(src).PlayerData
QBox:SetJobDuty(playerData.citizenid, status)
end
-- Framework.AddAccountBalance(src, _type, amount)
-- Adds the specified amount to the player's account balance of the specified type.
Framework.AddAccountBalance = function(src, _type, amount)
+1 -1
View File
@@ -5,7 +5,7 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
end
Inventory.RemoveItem = function(src, item, count, slot, metadata)
return Framework.RemoveItem(src, item, count, slot, metadata)
return Framework.RemoveItem(src, item.name, count, slot, metadata)
end
Inventory.GetItemInfo = function(item)