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