mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
ATM function
This commit is contained in:
@@ -383,6 +383,19 @@ QBCore.Player.CreatePlayer = function(PlayerData)
|
||||
self.Functions.UpdatePlayerData()
|
||||
end
|
||||
|
||||
self.Functions.GetCardSlot = function(cardNumber, cardType)
|
||||
local item = tostring(cardType):lower()
|
||||
local slots = QBCore.Player.GetSlotsByItem(self.PlayerData.items, item)
|
||||
for _, slot in pairs(slots) do
|
||||
if slot ~= nil then
|
||||
if self.PlayerData.items[slot].info.cardNumber == cardNumber then
|
||||
return slot
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
self.Functions.GetItemBySlot = function(slot)
|
||||
local slot = tonumber(slot)
|
||||
if self.PlayerData.items[slot] ~= nil then
|
||||
|
||||
Reference in New Issue
Block a user