mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
Banking Stuff
This commit is contained in:
@@ -256,6 +256,14 @@ QBCore.Player.CreatePlayer = function(PlayerData)
|
||||
return false
|
||||
end
|
||||
|
||||
self.Functions.GetMoney = function(moneytype)
|
||||
if moneytype ~= nil then
|
||||
local moneytype = moneytype:lower()
|
||||
return self.PlayerData.money[moneytype]
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
self.Functions.AddItem = function(item, amount, slot, info)
|
||||
local totalWeight = QBCore.Player.GetTotalWeight(self.PlayerData.items)
|
||||
local itemInfo = QBCore.Shared.Items[item:lower()]
|
||||
@@ -358,6 +366,23 @@ QBCore.Player.CreatePlayer = function(PlayerData)
|
||||
return nil
|
||||
end
|
||||
|
||||
self.Functions.GetItemsByName = function(item)
|
||||
local item = tostring(item):lower()
|
||||
local items = {}
|
||||
local slots = QBCore.Player.GetSlotsByItem(self.PlayerData.items, item)
|
||||
for _, slot in pairs(slots) do
|
||||
if slot ~= nil then
|
||||
table.insert(items, self.PlayerData.items[slot])
|
||||
end
|
||||
end
|
||||
return items
|
||||
end
|
||||
|
||||
self.Functions.SetCreditCard = function(cardNumber)
|
||||
self.PlayerData.charinfo.card = cardNumber
|
||||
self.Functions.UpdatePlayerData()
|
||||
end
|
||||
|
||||
self.Functions.GetItemBySlot = function(slot)
|
||||
local slot = tonumber(slot)
|
||||
if self.PlayerData.items[slot] ~= nil then
|
||||
|
||||
Reference in New Issue
Block a user