forked from Simnation/Main
Update config_functions.lua
This commit is contained in:
parent
321e70b2cb
commit
0864c1408e
1 changed files with 16 additions and 23 deletions
|
@ -1,6 +1,7 @@
|
||||||
Config.Functions = {
|
Config.Functions = {
|
||||||
--#region Server
|
--#region Server
|
||||||
StartFramework = function()
|
StartFramework = function()
|
||||||
|
-- Keine Änderung nötig, da TGIANN mit ESX und QBCore funktioniert
|
||||||
if GetResourceState("es_extended") ~= "missing" then
|
if GetResourceState("es_extended") ~= "missing" then
|
||||||
ESX = exports["es_extended"]:getSharedObject()
|
ESX = exports["es_extended"]:getSharedObject()
|
||||||
elseif GetResourceState("qb-core") ~= "missing" then
|
elseif GetResourceState("qb-core") ~= "missing" then
|
||||||
|
@ -9,24 +10,29 @@ Config.Functions = {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GiveItem = function(source, itemName, count)
|
GiveItem = function(source, itemName, count)
|
||||||
-- https://utility-library.github.io/documentation/server/esx_integration/xplayer/AddItem/
|
-- TGIANN Inventory Version
|
||||||
AddItem(source, itemName, count)
|
exports["tgiann-inventory"]:AddItem(source, itemName, count)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
HaveMoney = function(source, type, amount)
|
HaveMoney = function(source, type, amount)
|
||||||
if amount == 0 then return true end
|
if amount == 0 then return true end
|
||||||
|
|
||||||
-- https://utility-library.github.io/documentation/server/esx_integration/xplayer/HaveMoney/
|
-- TGIANN Inventory Version für Geldprüfung
|
||||||
return HaveMoney(source, type, amount)
|
local money = exports["tgiann-inventory"]:GetItemByName(source, "money")
|
||||||
|
if money and money.amount >= amount then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end,
|
end,
|
||||||
|
|
||||||
RemoveMoney = function(source, type, amount)
|
RemoveMoney = function(source, type, amount)
|
||||||
if amount <= 0 then return end
|
if amount <= 0 then return end
|
||||||
|
|
||||||
-- https://utility-library.github.io/documentation/server/esx_integration/xplayer/RemoveMoney/
|
-- TGIANN Inventory Version für Geldentfernung
|
||||||
RemoveMoney(source, type, amount)
|
exports["tgiann-inventory"]:RemoveItem(source, "money", amount)
|
||||||
end,
|
end,
|
||||||
--#endregion
|
--#endregion
|
||||||
|
|
||||||
|
|
||||||
--#region Client
|
--#region Client
|
||||||
TryToBuy = function(self, selection, dbId, success)
|
TryToBuy = function(self, selection, dbId, success)
|
||||||
if Server.CanBuySnackFromVending(self.name, selection) then
|
if Server.CanBuySnackFromVending(self.name, selection) then
|
||||||
|
@ -42,17 +48,4 @@ Config.Functions = {
|
||||||
Server.SetVendingUsed(dbId, false)
|
Server.SetVendingUsed(dbId, false)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--[[
|
|
||||||
TargetAddModel = function(models, options)
|
|
||||||
|
|
||||||
end,
|
|
||||||
TargetAddLocalEntity = function(entity, options)
|
|
||||||
|
|
||||||
end,
|
|
||||||
TargetRemoveLocalEntity = function(entity)
|
|
||||||
|
|
||||||
end,
|
|
||||||
]]
|
|
||||||
--#endregion
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue