Merge pull request #5 from The-Order-Of-The-Sacred-Framework/dev
Merge dev into main
This commit is contained in:
6 files changed
+32
-4
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ lua54 'yes'
|
|||||||
use_experimental_fxv2_oal 'yes'
|
use_experimental_fxv2_oal 'yes'
|
||||||
author 'The Order of the Sacred Framework'
|
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.'
|
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 {
|
shared_scripts {
|
||||||
'settings/sharedConfig.lua',
|
'settings/sharedConfig.lua',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Inventory.RemoveItem = function(src, item, count, slot, metadata)
|
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
|
end
|
||||||
|
|
||||||
Inventory.GetItemInfo = function(item)
|
Inventory.GetItemInfo = function(item)
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -193,4 +200,14 @@ end
|
|||||||
-- Registers a usable item with a callback function.
|
-- Registers a usable item with a callback function.
|
||||||
Framework.RegisterUsableItem = function(item, cb)
|
Framework.RegisterUsableItem = function(item, cb)
|
||||||
ESX.RegisterUsableItem(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
|
end
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Inventory.RemoveItem = function(src, item, count, slot, metadata)
|
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
|
end
|
||||||
|
|
||||||
Inventory.GetItemInfo = function(item)
|
Inventory.GetItemInfo = function(item)
|
||||||
|
|||||||
Reference in new issue
Block a user