forked from Simnation/Main
Update config_functions.lua
This commit is contained in:
parent
97ff12a7b6
commit
381e6e5591
1 changed files with 23 additions and 24 deletions
|
@ -9,38 +9,24 @@ Config.Functions = {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
GiveItem = function(source, itemName, count)
|
GiveItem = function(source, itemName, count)
|
||||||
-- TGIANN Inventory Version anstelle von Utility Library
|
-- https://utility-library.github.io/documentation/server/esx_integration/xplayer/AddItem/
|
||||||
exports["tgiann-inventory"]:AddItem(source, itemName, count)
|
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
|
||||||
|
|
||||||
-- TGIANN Inventory Version für Geldprüfung
|
-- https://utility-library.github.io/documentation/server/esx_integration/xplayer/HaveMoney/
|
||||||
if type == "cash" then
|
return HaveMoney(source, type, amount)
|
||||||
local money = exports["tgiann-inventory"]:GetItemByName(source, "money")
|
|
||||||
return money and money.amount >= amount
|
|
||||||
elseif type == "bank" then
|
|
||||||
-- Hier musst du die entsprechende Funktion für Bankgeld in deinem System verwenden
|
|
||||||
-- Dies ist ein Beispiel und muss an dein System angepasst werden
|
|
||||||
return true -- Temporär immer true zurückgeben
|
|
||||||
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
|
||||||
|
|
||||||
-- TGIANN Inventory Version für Geldentfernung
|
-- https://utility-library.github.io/documentation/server/esx_integration/xplayer/RemoveMoney/
|
||||||
if type == "cash" then
|
RemoveMoney(source, type, amount)
|
||||||
exports["tgiann-inventory"]:RemoveItem(source, "money", amount)
|
|
||||||
elseif type == "bank" then
|
|
||||||
-- Hier musst du die entsprechende Funktion für Bankgeld in deinem System verwenden
|
|
||||||
-- Dies ist ein Beispiel und muss an dein System angepasst werden
|
|
||||||
end
|
|
||||||
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
|
||||||
|
@ -56,4 +42,17 @@ 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