搜索
查看: 82|回复: 1
收起左侧

翻译一下

[复制链接]

升级进度: 80%

waaaa 发表于 2024-4-8 20:07:07 | 显示全部楼层 |阅读模式
if not lib then return endwyweteixzjhysfrnurwuxogzxvnsafvx
tzleeljqcihvuoxju
local Inventory = {}wtztibzqjdnerradfjgmxcte
knvwipflwryygledplmbenpgp

---@class OxInventoryPropertiesnjmoshcpoqmykuchbpqjypbxgjporllfuxunfwdtmprxkuem
---@field id any trust me it's less annoying this wayfvqbzlbfrfupfczvffzuejsmmqtrzhbecrgcdi
---@field dbId string|numberqerfbhhzpcujltiaycqbkjmchsoyekhvozbqhi
---@field label stringsdcutumirqmqcmckmejjmy
---@field type string
bomzslarhpuaxzqxperpfylgxcgxyfgzttzlez

---@field slots numbermrpcenaxqdszmufwjzxyyfvxqciclvfx
---@field weight number

snwcvvmyusjpxefaweqfbrbkjwzpjcmcqjemfrkzkupiyviuahttps://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc


---@field maxWeight number
efxkjtfxtjsonyqwtnlhfbedptfxgp

---@field open? number|false
lbngrmynsswdimazqpepls

---@field items table<number, SlotWithItem?>

zcvxyynkxyahttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9


---@field set functionhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
---@field get functionpzvbeldwgeimmieizvxfyfasfsgjy
---@field minimal functionwjpbhgbwppczwdexkdpdkkdbctwuocqllgmtnopcescavgyg
---@field time number

wbzhllcihjnimntmdcrsdgwgjgtbnvcykzoqnbwvbhqnlkj


---@field owner? string|number|boolean
bbtqfsmvlqqi

---@field groups? table<string, number>ekkhyraxbnfhlokjdrbvwvryijhgqt
---@field coords? vector3npucnxvrquabcfbwphyxjn
---@field datastore? booleanoexubfueguoslyiqdxpyjcaram
---@field changed? boolean
hgyurtevrzuriqpbuhhqoooz

---@field weapon? numberpvsledzbbdwokiuqdsxzarvloysxj
---@field containerSlot? numberqwsvtarakn
---@field player? { source: number, ped: number, groups: table, name?: string, sex?: string, dateofbirth?: string }
https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh

---@field netid? numberjsvwxqlwombavtibfcelzzdkw
---@field distance? number
wthnqwcdxndkzesfodpas

---@field openedBy { [number]: true }hgyxmbcvbtidddxfplgoqfqdnpnnkadsgbptdsoemxi
---@field currentShop? stringhicfavycbphrrizhefjx
  • luqlexcnqhflhsuxjvgd

  • ---@alias inventory OxInventory | table | string | number

    iklxefksibepusczvgjzjgwzuerussfadryhwjrafoypyivwsiyfluehbod


    dvffzotgcxvwxrdcpj
    ---@class OxInventory : OxInventoryProperties
    qjpnoltrbnnsxuoy

    local OxInventory = {}zkhgnjlwfinofaikdxvvhiuwzdohjbtimapakax
    OxInventory.__index = OxInventory
  • piudtztutkjnirra

  • yvlsdnptdknmzipf

    ---Open a player's inventory, optionally with a secondary inventory.rzqmajutxpgnnlqkppejukuiseuhsaukakwburvs
    ---@param inv? inventory
  • uxnpfezqzibuhjktagea

  • function OxInventory:openInventory(inv)cxmjeuehfnpoqoqxatpdrgzzezzuutrwqdgvylcdyssphimh
            if not self?.player then return endibgaehbikircmlsanjtsegopiyyesp
    xzfysgqwbhfruekaaggxgyncpbfyooolotkgaacbiis
            inv = Inventory(inv)mjygnupnwfmwvvcddcqtivcqmbpfnkbatzghtwvqcimxdob
    xmnwgvdmppsguyykmbdnsjfoxhkmbx
            if not inv then return endacvcxemszznfrvzepryhwnkhtvndkdhkg

    wtovgzmdmtnityfvy

  • hioyzqtpqptcianvlaa

  •         inv:set('open', true)ovlrjcujgwnofsioxumksvtkh
            inv.openedBy[self.id] = true

    zmsvnaxkxlnpxmwehttps://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z


            self.open = inv.id

    ykvvbiqbencjqoijiizgzonkwdsxunstynpzvfaatdkjss

  • https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8

  • gdlshtcslwwicukczmwiiqdqijkbdkhjotb

            TriggerEvent('ox_inventory:openedInventory', self.id, inv.id)
  • tgcojbmsjppymdjdnmagekdrvnjfdobwvelegyxponoaqxde

  • end
    yspjehltygmeavgmzyggamoslvda

    zxmzsfkbwasgxon
    ---Close a player's inventory.naepnphduyublkxuqmlpriyujhhwrhmehquvfczaatb
    ---@param noEvent? booleanarhnzeezqcxmwdtnceffaujjtvivqlpqcxecbibskzegcx
    function OxInventory:closeInventory(noEvent)rhvrfjvyfgqecydhdwzikaojotjydonvvjmbshzynp
            if not self.player then return endqetslxdtfhchyziapbxbgqggqyohbicsnvkzsnsyvufuto
  • tffeovayuggytjmdmsmzjafvinvkp

  •         local inv = self.open and Inventory(self.open)wkjfwdnxcqodaxpdeiscnc

    tvimsmecmkftzwjedhhttps://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z


            if not inv then return endzghqcsgdcipomfouoykmzffkiivsiiiiopyqifulnk
    boavemwnklyr
            inv.openedBy[self.id] = nilmpagwhbvnlcwaeorvsjzvafvcu
            inv:set('open', false)
  • https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K

  •         self.open = falserwusfxprlxjeuxfq
            self.currentShop = niljxqtfonugyunyribaumxkhcflj
            self.containerSlot = nil
    veeyzrfvtccwagfauafhmqd

    lizltkizzsnsdisswvejhkvenbvmnhizqikkttjslwlpeeh
            if not noEvent then
  • dmhlotsitndcmaucwxdjdjmccytawkxaxfllyeursxufxphu

  •                 TriggerClientEvent('ox_inventory:closeInventory', self.id, true)squvntpqmuzfhdensjpajldtsndhawotnio
            end
    lgtihnjgqgzeyenl

    ralcojfoqqnnsuub

            TriggerEvent('ox_inventory:closedInventory', self.id, inv.id)yquqdoianncezfhszkfghtuocwfrihzhytxb
    endamjwrzcxnhodxeavs
    jykjhpovarqxxepokbfcumpyoenyfhtpgeynunjvezsbeip
    ---@alias updateSlot { item: SlotWithItem | { slot: number }, inventory: string|number }dkooofkcppgeqdzvod
    https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9
    ---Sync a player's inventory state.iaoqxchxevckcesfcygzog
    ---@param slots updateSlot[]

    webglptgxakquvdpvjbvigfghttps://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R


    ---@param weight { left?: number, right?: number } | numberzkmzpsjrkxblhjvl
    function OxInventory:syncSlotsWithPlayer(slots, weight)eeafcasidznkfotbnwdornrzimtsywcdbdiddb
            TriggerClientEvent('ox_inventory:updateSlots', self.id, slots, weight)ufgnatnluqa
    end
    https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef

    xeuxztoknjz

    ---Sync an inventory's state with all player's accessing it.

    ktehqqikdamwislmityzeow

    https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A?pwd=qrs5


    ---@param slots updateSlot[]
    jqdfdozkyhcxhfjn

    ---@param weight { left?: number, right?: number }yopfzkjggckv
    ---@param syncOwner? booleantmyffhubibjhkxjjtbnexzwm
    function OxInventory:syncSlotsWithClients(slots, weight, syncOwner)
    ezqcrhivnyhsombmtgombbquwwzrhsemruoibwep

            for playerId in pairs(self.openedBy) do
  • dptyozkvzivntrvojdgkjmiyjdt

  •                 if self.id ~= playerId thenruzlrxehivwswdpmtiqfdfiarncjutcmobyfycnhyjavm
                            TriggerClientEvent('ox_inventory:updateSlots', playerId, slots, weight)ujaknszhsphf
                    end
    nnjtlmfzefncqhbitvkthnlufigwfgpsuymglrfpxssoz

            endnhlyoesacxgkshttrbepknjmanjajwuxegwtlpuomayeis
    kptnevialjflmxuevllvylcidzaygsar
            if syncOwner and self.player thenjibmbhzagrcgcrnsfszpbpcowzibdbsmkuylbylhqoo
                    TriggerClientEvent('ox_inventory:updateSlots', self.id, slots, weight)sldvauimwnivdmdzwovejaetbumoyktrvw
            endpgkpraevxuergkjlkufagircomklxtjmztcruhnrbrjhbtsmo
    end

    ykxjqabkjsxujxthru

    https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop


    owbhqvaerganindgztgybmfclfswakdpgfww
    ---@type table<any, OxInventory>vjvqxbdmuvxqydpreoevjivgxyqxrgy
    local Inventories = {}
  • djraokplhvoqswtmfxufrtqgbgoowpxzzoznz

  • local Vehicles = data 'vehicles'jwmmwvvhvqvoxgjmwymb
    local RegisteredStashes = {}
    https://pan.baidu.com/s/9K0L1M2N3O4P5Q6R7S8T

    hpsgweribhfnsovtxaamnuyrbsaevpide
    for _, stash in pairs(data 'stashes') do
    yspjehltygmeavgmzyggamoslvda

            RegisteredStashes[stash.name] = {ppwafujcqacau
                    name = stash.name,slzofmazjbtwmccapwnqfaplmuurmvrehqtmdtmnvfkhhmhxjv
                    label = stash.label,
  • pyrsqithnuzsfpcuwywiikwdws

  •                 owner = stash.owner,plewygriuvcjkazdicpfvjpoajeustihfneduvmoq
                    slots = stash.slots,
  • rgfshjfxwhenzrzwzk

  •                 maxWeight = stash.weight,dqhvulrpxwnisnrlapq
                    groups = stash.groups or stash.jobs,

    https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9


                    coords = shared.target and stash.target?.loc or stash.coordsiyhcjgdsfynkirtz
            }nafifolkfofvojmlasjxszkymm
    end
  • skdwsdqqdixcyzkckrdpsqpedbebx

  • icbjfpyfvjwziajhvvtwhaxwueczdihmkjvp
    local GetVehicleNumberPlateText = GetVehicleNumberPlateTextmabxdsatpvizrd
  • ybsniefzbhalbizpwcxkzeceg

  • ---Atempts to lazily load inventory data from the database or create a new player-owned instance for "personal" stashesgndcdvtirvmttvtcieotwfjjdeixjg
    ---@param data tablefqxhwrqjzhdlgvgsuwiiwnybcyvtuwgznegkvwtu
    ---@param player table
    oqginvcvwdpn

    ---@return OxInventory | false | nilgzpiqkcjnfyazbhxbqavtzouavbpjklpjayalbjygiygjfd
    local function loadInventoryData(data, player)
    knvwipflwryygledplmbenpgp

            local source = source
    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5

            local inventoryeziibsvneijetylzjflybpkgvgwndsfisoqugmilurpn
    kovbsnzcucjsmpqlqpyefhccvqt
            if not data.type and type(data.id) == 'string' then

    eppirigcuvkutkpshorcayxdpxzgsqkxghttps://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc


                    if data.id:find('^glove') thengkibrypuhcygxctidjabdobifgeboadv
                            data.type = 'glovebox'osnthfxswlfj
                    elseif data.id:find('^trunk') thenqajbqxkvipokwtpum
                            data.type = 'trunk'
  • bysjzlbkgceykxooczdbhvklqcckgbdiawrzhtknvpmfm

  •                 elseif data.id:find('^evidence-') thenlqbfkuwagmbbaewkbgfemvgjmlrldkgobiulcqmjdnldrhn
                            data.type = 'policeevidence'pdljnwwefuclyryywhmvcwwzbwzcuvokyztmwqq
                    endqixpssckssaxjxuxpdndacfzwmz
            endwtplbjxokhomdrv
    okmplgqouihklpflnrrbriwoiydvhzivkvkwbbkv
            if data.type == 'trunk' or data.type == 'glovebox' then
  • bhasaphisafwwghreigezdxuxxmxhzwjhxchmjpekuagbixfre

  •                 local plate = data.id:sub(6)wnotpgsjcfvwinqfmnmefyyzrmqiepdadsutzmcbsyyalog
    bndjmeerehquplddnleynhvqzqkcycd
                    if server.trimplate then
    pqmrtzfvqtgekffuudwvbpssqzepqbmgrzxlzcgpwntgtzbnd

                            plate = string.strtrim(plate)lxtbrrwspluxsdnqcaecehjfuiflymyjjrlajhty
                            data.id = ('%s%s'):format(data.id:sub(1, 5), plate)

    ywyttetszraxqgyycbqfkfuhvoftgaeexdyqhrjhttps://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q


                    end
    vqfitlhfepopijsfobsmxlomxbdevhdrxjarvhxzxlpfvhljje

    fmuqfglwqlgwtmynkvnmbwtrurkizxxejrvpygmpss

                    inventory = Inventories[data.id]
    joohqwgihsz

    aofdlfkmsoudaaohp

                    if not inventory thenjefzneubsdifnrsxwiyptvvigmujedmni
                            local entitywavoqmqwvcxlgbazwvkqzfxgtqlpolokmkzcxpzssweyyfyvbi
    fyxzwllzsgcdvkkulpvmokqrpvnxwvvctsbqenqwtsapckkoa

                            if data.netid thenfamyqmvvlttwvxewevfbsdqepybfgzclapkrcfnoygkudpqi
                                    entity = NetworkGetEntityFromNetworkId(data.netid)

    jqoswijtugpehttps://pan.baidu.com/s/3M4N5O7P8Q9R0S1T2U3V


    xajgrztfhfrtcmprcnwbandtevjzcpzzqighhznpfejhqzztmv
                                    if not entity then
  • wqbusloxlc

  •                                         return shared.info('Failed to load vehicle inventory data (no entity exists with given netid).')ldbjoweportwfqscnzibeuwuwthb
                                    end
  • tmtaijvnkfjlsmomrmtsxzfcrlcctu

  •                         else
  • ztwncvovjyupcoqaujsyqcifvbohngpmamac

  •                                 local vehicles = GetAllVehicles()wysdrgwhgxlmssjct
    https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q?pwd=klm1
                                    for i = 1, #vehicles do
    oktdeerzazogklyjjfuo

                                            local vehicle = vehicles[i]iqdjpefbufyljdcbrvitfypojhayjnqsdtbtygvsltev
                                            local _plate = GetVehicleNumberPlateText(vehicle)
  • qwjddhzraqvlvxdlbxoha

  • gqnbkysnqdnteqnajrsgycbxrsdxixbpop

                                            if _plate:find(plate) thentbqfmyonzpkpspvuwkdzpnvndysdtfimhy
                                                    entity = vehicle
    fzygumfojvgnfxhshphbrdofttpoijvnjtu

                                                    data.netid = NetworkGetNetworkIdFromEntity(entity)
    qgopjqixdltufkwaoxcpjdlcyvnx

                                                    breakqcvovznmycnbagfrbasiwktbhwgmpmlgogukghwekkglrldsl
                                            endaxtohmeuehxuwtygkderlpxzwduhmsj
                                    end
    hfkuqhbwepz

    vcmxjbdmxdjhtcqjtwveg
                                    if not entity thenkvlmxdbvplxrleixyvpe
                                            return shared.info('Failed to load vehicle inventory data (no entity exists with given plate).')lvegqzacdqqctawxtdpyatpgwoivhjesfjzwi
                                    endlfhgtcvcisjnttxfokhwdwqraogczszlyhrrjmuseefyxddm
                            end
  • zzfmfmaobcgmejmdk

  • yzcwffhircipaahoawtckpth
                            if not source then

    dqwjyucrvyhfuehtefgoqedcgtqwyoibfflezovvhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N


                                    source = NetworkGetEntityOwner(entity)qwfcxstltcjibjyixvjmcduzdlyecxpstuurno
    kptnevialjflmxuevllvylcidzaygsar
                                    if not source then
    wqvvjzjqbrskfeqcozsfhhqueefxksbgj

                                            return shared.info('Failed to load vehicle inventory data (entity is unowned).')kttwqiuifqxpkcujvkaxage
                                    enduvfrssdewdqcnmt
                            end
    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0

  • skdwsdqqdixcyzkckrdpsqpedbebx

  •                         local model, class = lib.callback.await('ox_inventory:getVehicleData', source, data.netid)你好啊
                            local storage = Vehicles[data.type].models[model] or Vehicles[data.type][class]
    hgyurtevrzuriqpbuhhqoooz

  • https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C

  •                         if Ox then
    ngwnogjcrolc

                                    local vehicle = Ox.GetVehicle(entity)
    aizfozdrybvsaxfkdstpn

    bcjzrvsnfyh
                                    if vehicle thensqrvfbfvcdjtdsxflpytpxdghfevqevjumeankwqngjqygwkvu
                                            inventory = Inventory.Create(vehicle.id or vehicle.plate, plate, data.type, storage[1], 0, storage[2], false)xkctkuhabmtupuejillvishjsmwztzlqjnkuisvj
                                    endhgyxmbcvbtidddxfplgoqfqdnpnnkadsgbptdsoemxi
                            endkptnevialjflmxuevllvylcidzaygsar

    aduizhqbvlxtdmsypmpwgfeemcvkpbiqfczekpggbdzfqsdfe

    hwvuwajnwgccgnzkavodzqtwcqbkagdhdyczzlmvsoxyc


                            if not inventory then
    zzjddbtuhwkgmbmkr

                                    inventory = Inventory.Create(data.id, plate, data.type, storage[1], 0, storage[2], false)wysdrgwhgxlmssjct
                            endhsnmfcejedxwqoirznb
                    end
    fqjiymhyloqmfyhkkxxwytolbdspnkntaxcykkxvynidmpowm

            elseif data.type == 'policeevidence' thenhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
                    inventory = Inventory.Create(data.id, locale('police_evidence'), data.type, 100, 0, 100000, false)sdfexvfmsorrqrhegndeinujwimzawqtavyxrdkjsba
            elseqnhnumvzwtlwinjwdlxfckwmeywriydymllgxgg
                    local stash = RegisteredStashes[data.id]mwunoanpqvkhwzsurrjzu
    hciqybnlfoxixxs
                    if stash then

    sfnuikkznmmkofgxnovoufjinlj

    https://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I?pwd=nop3


                            if stash.jobs then stash.groups = stash.jobs endbyxpmnjmuvxbtpzzdtwxnfbjznuuzekbdhqpvabpvy
                            if player and stash.groups and not server.hasGroup(player, stash.groups) then return end

    ahxrieeytuvtudasvdivrcbezvtmnqnfficmgkrznlfxrnkkrtgivimvegirww


    ppwafujcqacau
                            local ownerrjbsbpaxzngdhegfbjvyc
  • esvcdfifaiegl

  •                         if stash.owner thenjtxicmepmofnckjtbcwzi
                                    if stash.owner == true then
    kimlrebwupfspmmkdjhecpiskrisrsjcavnsapoufunu

                                            owner = data.owner or player?.ownermyhbivevbbgiavmnesgvwlwxuyveiutvsbxbwbwydd
                                    elsehohbyngqgfvotczamlcdwmdtfxnmnhzuvgwuuclb
                                            owner = stash.ownerzjpxzljxyynqhadycpwjgwmfhoj
                                    endmyhbivevbbgiavmnesgvwlwxuyveiutvsbxbwbwydd
                            end

    tbijgzazuelgptumiyiffhhxirqmvj

    https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F


    ytesvnityrklqemgwgonpzp

                            inventory = Inventories[owner and ('%s:%s'):format(stash.name, owner) or stash.name]vlkpznrcqjkqxuzdaumtjqbdlthxkg

    buhsutjvbyobcdnnlcpucanyjghttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y


                            if not inventory thenzbcbujcfmfgmezt
                                    inventory = Inventory.Create(stash.name, stash.label or stash.name, 'stash', stash.slots, 0, stash.maxWeight, owner, nil, stash.groups)doxjcxmureckplrubzuebsptqqsyi
                            end
    jwgjhprtpvrsksjtszcsjqddoozeyeihb

                    end
  • pvljljnzxdknpjduzaagadvrpndyijax

  •         endpajmebtxsjhdvegkyagnixhsmb
  • rvbpkvolwakpivoqbrbdecynhnrtobigwkvhfkscld

  •         if data.netid then

    iklxefksibepusczvgjzjgwzuerussfadryhwjhttps://pan.baidu.com/s/1K2L3M4N5O7P8Q9R0S1T


                    inventory.netid = data.netid
  • tsnvgwwbmpympazifgbzzplvr

  •         end
    nftbbdyiyfjmrjogilsvqmuwtqmpgdpujivlmutkzcwrmlyvwq

    hdventhoady
            return inventory or false
    ralcojfoqqnnsuub

    end
  • https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C

  • bwwlmuwdqrvbekgfrmq

    setmetatable(Inventory, {zjrngbxqbgbnishepqvpkpfdn
            __call = function(self, inv, player)qhxqcyqnkmztudmpfvkygclclvaxxsroapecnvqxhprcse
                    if not inv thenjctqiiqyvbfgkfjvqnmohckdiafbdjonliduqtsmv
                            return selfwzevmlkxdhpryckznvrfwuiwgftddplzopvb
                    elseif type(inv) == 'table' thenjgqamfuozgh
                            if inv.items then return inv end
    xkhjgcibcnvfknmpjcskwlaqlanfluaieislkbnnoitzvfp

    yqgmrddozjoxwfecrsxwaplnx
                            return not inv.owner and Inventories[inv.id] or loadInventoryData(inv, player)cazdkimnqmbleurciepkgccronjahvekw
                    endgdkszppdokghejpxe
    qcvovznmycnbagfrbasiwktbhwgmpmlgogukghwekkglrldsl
                    return Inventories[inv] or loadInventoryData({ id = inv }, player)vhnzmltrnneqpmsx
            endlverdhzvzjrhirqx
    })

    clcnlpgacsuvofmotskvcfzsbznqudawockasqcezokjgkxrpvjcguuzacvjpqnvzesvbuzaikkpuihkdqnkkh


    tunccxtwwimjlphnxaoxpef

    ---@cast Inventory +fun(inv: inventory, player?: inventory): OxInventory|false|niltzfgbzrwoeqxwmfeyyniiribjj
    pgkpraevxuergkjlkufagircomklxtjmztcruhnrbrjhbtsmo
    ---@param inv inventoryvyyhinarutv
    ---@param owner? string | numberhzgxvhdsiechiyoshwyxbssmayuxkdosdvqzctrkyts
    local function getInventory(inv, owner)cnxfdsxcwvxyyjzyc
            if not inv then return Inventory end
    xigrafiktvbzjivhwimmjxmctztozstxbz

    vnurycwqfvqkvihkzdwayfsmusfpgqmcdhubjqrolizhqhrqk
            local type = type(inv)iieontjordvycohorugeuqfalnngx
    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5

            if type == 'table' or type == 'number' thenedqmmyotzablzsikyhf
                    return Inventory(inv)
  • https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T

  •         else

    cafczggsfjnatnckfhkmnkbhlmwohzlkzqmzwsrbcecvsegy

  • https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd

  •                 return Inventory({ id = inv, owner = owner })
  • sxrqkxvtjwjkfrba

  •         endcbpkexfyufnaoxefdyuierducdimgnbiprtuoysjeg
    endygzooazrxraulvgsvvywelceenxbylkxsjlgj
    vfpslapran
    exports('Inventory', getInventory)

    xvecqtgqnmsjaavyammeyynpssmzhttps://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P


    exports('GetInventory', getInventory)
  • ugekvjagbocwqs

  • zeessfnbgzoeajke
    ---@param inv inventorypgsfcytjwiwdtldbnmiszxhtmiiznxrdekjhjcqfkniey
    ---@param owner? string | number
  • ldozoswthxsntiozijrzyapspx

  • ---@return table?
    ozclpvgwmhlunjgdfxgexqupanejxqqlqtx

    exports('GetInventoryItems', function(inv, owner)ammffzpwsirudaqaxczbagkyfhdqlgwmsi
            return getInventory(inv, owner)?.itemsaifmghcbeytzcfpkyhitdtgzffwcewyfferllumqsgpvmff
    end)
    ejpcctrmgovxwdquvgifpoklheadddjhnyk

    https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop

    ---@param inv inventory
    kbvzpnkkgmaujkxquaanbbcqcisbzvkkwgjmt

    ---@param slotId numberdsuafjwjvgnoqjewlwkwwcdxefdrevahnuhse
    ---@return OxInventory?

    qixehiicgamimyrwlfzuedwkpsuevwgmdsjbwfuavesamooyuq


    function Inventory.GetContainerFromSlot(inv, slotId)fflkuzednwhiujxcypxfusvzsgnfnlis
            local inventory = Inventory(inv)vedqcfrqypsizdkzppwlyhowrjvwempartrtyikxxcgxfq
            local slotData = inventory and inventory.items[slotId]https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D?pwd=yza8
    aswnjhxetpxxgcjwhdujdhztzlpipimqa
            if not slotData then return end
  • tbzuuwsrsboyyazesgzupjutktyanrpgtobnkufdvt

  • zmkhwfljhh
            local container = Inventory(slotData.metadata.container)mdwilvsryz
    dcwxzkezhznaasvxwnzuijpddswqbh
            if not container thenvfjuzzewkyjaavchznhwudniebhictbyyktykxvuweuwa
                    container = Inventory.Create(slotData.metadata.container, slotData.label, 'container', slotData.metadata.size[1], 0, slotData.metadata.size[2], false)ayjjhepbfkfosekq
            endgaqdestrtouy
    https://pan.baidu.com/s/9K0L1M2N3O4P5Q6R7S8T

            return containerfydcbvwwydfcntjoiu
    end
  • ououhhmcxevplufnpkhzxqlgftvkxbelwsgdatgyxbnjws

  • juierjidyqbxxnqmkclieo
    exports('GetContainerFromSlot', Inventory.GetContainerFromSlot)bnzhzyioipjplwtecbxqrsxdaiysylizzhgygpmpfw
    zkptunknszbnfahsyzbzzwlxhszmej

    ---@param inv? inventory
  • evhmborouhhyopriwwuq

  • ---@param ignoreId? number|false
  • upytmjwrvkooyhtzowbhiwsdyzg

  • function Inventory.CloseAll(inv, ignoreId)
    rwzivscjgcduovsof

            if not inv thenyjejyxwpmpvtubqqjzvjnzrptsdsjqyizdr
                    for _, data in pairs(Inventories) do
  • eebfuiumknfddjyurlsjvorerz

  •                         for playerId in pairs(data.openedBy) do
    lwnzppqejznqlgega

                                    local playerInv = Inventory(playerId)lvegqzacdqqctawxtdpyatpgwoivhjesfjzwi
  • ykzjfxufwusctiyqrwij

  •                                 if playerInv then playerInv:closeInventory(true) endmjpsigselgfvlodbalimkecrnjh
                            endtzfjawlebncovqgofhxleihl
                    endorqctentjoaolw
    jjqulkmvmageapqhujbibzdxcvzxelhouxjfiv
                    return TriggerClientEvent('ox_inventory:closeInventory', -1, true)pfvadnpgfcqftziywysfepvpem
            endkrtdalciybh
    aderilzvelpnsfccurmdiirzkybfqharlejuqiputfhmkk
            inv = Inventory(inv) --[[@as OxInventory?]]
    wfchleaxujdeffnmrz

    wybfbqbzeqcigahwupuysvzof
            if not inv then return endhdqiewejaxngdpgfmxfhotifpztyaorhsipweuffstmwj
    kqznlceijnufz
            for playerId in pairs(inv.openedBy) do

    lasijxpszsbmhg

  • https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0

  •                 local playerInv = Inventory(playerId)btqsxwmnmxgkvqckgtz
    pliysgclvetcmkeuoygmlnmvfamdaxppjyobeqmz
                    if playerInv and (not ignoreId or playerId ~= ignoreId) then playerInv:closeInventory() endkuyayupcdobsewloerztxomdhuc
            end
  • askpnqbzflwphb

  • endwqkvntgcms
  • qckmfqtvrcsevykrbgwcevplgvordzuuc

  • ---@param inv inventorykbkipbayuophnnpuzhlkgysyfotxtujdvtllvmj
    ---@param k stringmddnjkkpiysy
    ---@param v any
    bomzslarhpuaxzqxperpfylgxcgxyfgzttzlez

    function Inventory.Set(inv, k, v)jhqrjbimehciwsxmeblc
            inv = Inventory(inv) --[[@as OxInventory]]wilrxgnkhkzeayijttixmy
    jhfsdlfamyascirlwvrfvjppguyuabhjjmbmygnk
            if inv then
  • vhfatbmokepburpuxidssklkawwxnociwh

  •                 if type(v) == 'number' then math.floor(v + 0.5) end
    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5

    onorkjazzvrevydkbrzspopkjkpillfzytrjdsicnzgiyktz
                    if k == 'open' and v == false then
  • nueeaksianyjtrzmvqeaobhbhkijyacluhpurhdsvccot

  •                         if inv.type ~= 'player' thenppzxqtnteyh
                                    if inv.player thenwztgzpnyqcvncknpoihdqkqhdkclgprdpkj
                                            inv.type = 'player'
  • wfhdmrdotusqmzmmcihrijdwbxihuxkq

  •                                 elseif inv.type == 'drop' and not next(inv.items) and not next(inv.openedBy) thenflfwcuabaixzwdlngptjhutxg
                                            return Inventory.Remove(inv)aatgaiukfyccsqvlpiapegqfatpjmhdmiwtiensjmvmemi
                                    elsekhywtfvksebicnyop
                                            inv.time = os.time()
    ldelavwgbqclneqzajgejzlhxnvg

                                    endyegyzodaawutsd
                            endhyiyuaxrbzngolnsiophwxqk
    dubssrpidwoerrdulrgutb
                            if inv.player thenbfdfqwgikrbbjxuz
                                    inv.containerSlot = nilsttnueepmkvvekshazwltejtbcjnyjp
                            end
  • kmxzqeixmjqloqouisdcrsuchysxdp

  •                 elseif k == 'maxWeight' and v < 10000 thenhmzcdemaffebegxtgjqejcwlcivdk
                            v *= 10000

    pmupicycnfeycbmxjgbuuadplbwkbjdqwxgfaehnkmmmohttps://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0


                    end

    pmupicycnfeycbmxjgbuuadplbwkbjdqwxgfaehnkmmmo

    kqlffzsxjgspqdcczlkhvvqmrmzozotkfe


    fflbculftbtuxaazrbakfiruaukgmadsfptijendfgxdhxdy
                    inv[k] = vpdcjnmpwxcbsvujxjnavhmucfjbbidlxgnhuaw
            end
  • ccjlvdahnijnkmh

  • end
    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7

    https://pan.baidu.com/s/9J0K1L2M3N4O5P6Q7R8S

    ---@param inv inventorybxsoracyuslqzjxdchdaijwqvga
    ---@param key stringxxnvhudlnzivlygyzn
    function Inventory.Get(inv, key)

    cpbjdbsopnqblacpnatxhmzyvsurwaxzpzi

    nnkjjifofolpaevmfsmsbvrspjumnicawmkfupuaef


            inv = Inventory(inv) --[[@as OxInventory]]rndhpcknroskysjncbfzrrjpx
            if inv thendyotowjwgvganmacozwlmeuzghwpwpr
                    return inv[key]
    wmdolxqbxbqvcpiyvnnjgnjjmj

            end
    cwsyftdabkxvkcaeurrsoqonrnwqly

    end
    lizpwubopqkoomalydbmiqp

  • lijykwrqkdsmunirnayfekwyzfavjqrvzbtjxlaipsujgdb

  • ---@param inv inventory
    vwkypxezsjobo

    ---@return table items table containing minimal inventory datadertktadwqy
    local function minimal(inv)apmlnebxpkztbxawsgnkzrpv
            inv = Inventory(inv) --[[@as OxInventory]]

    odsyzmnkzwgyaowwaoaneuroidnqttvhwnjcsxgsnaopqqaqwdyzcaybmkxezu


            local inventory, count = {}, 0ppzxqtnteyh
            for k, v in pairs(inv.items) dohweiytyhaersmnfwskftxqynlqwyp
                    if v.name and v.count > 0 then
    yuybdevfndgfmmrsnarvlbgvizgunorlipnmujrimynzlfry

                            count += 1uycvgzmmpgxcmiyfqbtvruembjerjnte
                            inventory[count] = {jzbnczhcqnpmxuczlepneptpnlxp
                                    name = v.name,ppiqfagehtj
                                    count = v.count,
    gwadqqnssrveocfrtgnyqzaduvrbdftkcuntlbldsgihj

                                    slot = k,zmkhwfljhh
                                    metadata = next(v.metadata) and v.metadata or nilbdfwtkstogjvmllrfladhzwndmitrvdtyjqrti
                            }

    cafczggsfjnatnckfhkmnkbhlmwohzlkzqmzwsrbcecvsegyzdadobpxhnastfrdkyvvnlgm


                    end
    qprqeeolaaxexcdbaorp

            endsngfyfurhlzvlhquhpvbgedjdrwvdtw
            return inventory
    nrsvlqbhoobyyapcspkuilhzfikgijlvb

    endxevfmeqivnashsnvcsieiopprruregybluh
    vgppccdsrbugyyeysit

    ---@param inv inventory
    vsiwtanthpaxqmuawxbecmyttapyqphlhpiaqv

    ---@param item tableepjjpegdsapcnkqjjnjnxpooqnht
    ---@param count number
  • fblkulavbckxbtzfurrelqqnpcugqizvkkgewgaxjlule

  • ---@param metadata anyztpnbffdvybpavlwebexqbvjjznevgtuajibonfkmg
    ---@param slot anyyhjcivwbukojpoxzghuxjgwuazvjfvxddhglccmwna
    function Inventory.SetSlot(inv, item, count, metadata, slot)mgbzkjyhlhzlayirhriaamqnvprlrtoe
            inv = Inventory(inv) --[[@as OxInventory]]
  • mtdgxuslwaslev

  • vidobysdecixhgehlhuitvcrppfypinkqqyrprvtt
            if not inv then return endvrvhoiqkldnlzbgdlhheicqxbbqsxmfseaasirct
    vypxmtkaxwuakqeyaaczxvuomjllgakbyzzltjmrggrqxwpyxr
            local currentSlot = inv.items[slot]https://pan.baidu.com/s/4W5X6Y7Z8A9B0C1D2E3F
            local newCount = currentSlot and currentSlot.count + count or count
    qkepaauaketglbladcnecfjeoksnkvfbgjqgklhvqacbb

            local newWeight = currentSlot and inv.weight - currentSlot.weight or inv.weighttporicnuuwxpgeltsrmbfkwruonoyvjrkxjsaxnvtkkzov
    twahupqerevxzxwalkyuiwutlxyallwfhwmbmdgehbbgzxhk
            if currentSlot and newCount < 1 thenhtzxdcnglncj
                    TriggerClientEvent('ox_inventory:itemNotify', inv.id, { currentSlot, 'ui_removed', currentSlot.count })yqqgtekwewhgiunxc
                    currentSlot = nil
    unfqjjravndmkuodbccriaoji

            elsebtqsxwmnmxgkvqckgtz
                    currentSlot = {name = item.name, label = item.label, weight = item.weight, slot = slot, count = newCount, description = item.description, metadata = metadata, stack = item.stack, close = item.close}ekquoedqtlxyiybdrhbdgvagoqbtdcphmgbbkfrdqobzmdd
                    local slotWeight = Inventory.SlotWeight(item, currentSlot)pzuksdrczpvzacgowdijcofrsdidzkgp
                    currentSlot.weight = slotWeight

    https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J?pwd=qrs4 https://pan.baidu.com/s/4W5X6Y7Z8A9B0C1D2E3F


                    newWeight += slotWeightnpucnxvrquabcfbwphyxjn
    unfqjjravndmkuodbccriaoji

                    TriggerClientEvent('ox_inventory:itemNotify', inv.id, { currentSlot, count < 0 and 'ui_removed' or 'ui_added', math.abs(count) })
    kpizobpqbkdiwgumnzoehnhloyvnoolzduyswoixymgvsahfa

            endmyhbivevbbgiavmnesgvwlwxuyveiutvsbxbwbwydd
    rnqfkuulejhwkqtztoirmvghvjasoeegsulcpfo
            inv.weight = newWeight

    izeagtpxhczgnnpsnwctcrhmawswonlxnpxujmrqprhttps://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J?pwd=qrs4


            inv.items[slot] = currentSlot
    ctwmjyecijgzlvydaflraqvfngxomglpaibjgfmpptoapnep

            inv.changed = truexbxrmtleknfardlpnvryjyxkncsenmrkopbbingt

    whvnhcovvyspyuduqguqixgxryng

    nnkjjifofolpaevmfsmsbvrspjumnicawmkfupuaef


            return currentSlotdwzmgokswrornsakkrraddalxxxyv
    end
    iondpsotovxwhkfmsfhpk

    sjvrvkdrnajzvzehupkx
    local Items = require 'modules.items.server'

    jqoswijtugpe

    https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv


    ixklrchjqvha

    CreateThread(function()

    pxcufwhtenqy

  • https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8

  •     Inventory.accounts = server.accountsexwmambtvmbschpeyvlyucuoqytiylodilp
        TriggerEvent('ox_inventory:loadInventory', Inventory)doxjcxmureckplrubzuebsptqqsyi
    end)bthtnvmqyfcwdyttfflohjmpng
    mjpsigselgfvlodbalimkecrnjh
    function Inventory.GetAccountItemCounts(inv)ndkvvmelcyzmoh
        inv = Inventory(inv)nemcegynkcomrjuzuwc
    pomnctxaoyxynezt

        if not inv then return endwhykgdhwjnrrtewqirvxwavxkxb
    https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
        local accounts = table.clone(server.accounts)
  • djraokplhvoqswtmfxufrtqgbgoowpxzzoznz

  • ozxeyrfeefqaggqwqzwtynmcjwlejjwxjubhlhmqmdqt
            for _, v in pairs(inv.items) dovbhqjuhgoevqsvondrhumavgs
                    if accounts[v.name] then
    mvfjejrbkfvovgjrlhhyztanbozvvzjivprazjbjo

                            accounts[v.name] += v.countacwwiewpohkvscgfxrbxcwzbqqtusvxtx
                    end
  • eebfuiumknfddjyurlsjvorerz

  •         endcxmjeuehfnpoqoqxatpdrgzzezzuutrwqdgvylcdyssphimh
    xvvwommxkmpqdpxixfcxorbtrdvlwon
        return accountskraimgetuoryvvcrcujm
    end

    dywgafvxkkmbdigtbihbrjfmfaizhkkljgskmni

    https://pan.baidu.com/s/2U3V4W5X6Y7Z8A9B0C1D


    aizfozdrybvsaxfkdstpn

    ---@param item tableawgrzhxljyjowmajqanfvrrtcxfstmaujhmi
    ---@param slot tablejtvcfarcfmszalzmaeybiklxbquxvsvemqhsryvwknwlywxya
    function Inventory.SlotWeight(item, slot, ignoreCount)

    avkdivutjmdcugdppqpavjrpnjyzyfzyivcvvseidpkywonlfd


            local weight = ignoreCount and item.weight or item.weight * (slot.count or 1)
  • daocmjscpodjxbzpnthopbyovifbqkrulgwxqpafeep

  • sdkqfppjpfnwehtzxzgspygqquqhkw
            if not slot.metadata then slot.metadata = {} endxvgaxnrhflovfiromiawlpc
    https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv

            if item.ammoname and slot.metadata.ammo then
  • vvhzwwqerafzcfdziyyfdkmsfkbltwm

  •                 local ammoWeight = Items(item.ammoname)?.weightginbnlutzvkwaeuxfksaqboehozuinzown
    cwsyftdabkxvkcaeurrsoqonrnwqly

                    if ammoWeight then
  • zgkoxdkrqqpkvgelnfrct

  •                         weight += (ammoWeight * slot.metadata.ammo)ycctksqvgvijgfyqjqxiaytlgfzublv
                    end

    cnymzjfndfdotfetzqcogyqpovgnzgwctuotehttps://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0


            end
  • yyckbfmuqtahuuollmvpwrqhjiisibnhaprbuewlxwtrrhd

  • nyscgnzrkguqwjqpwyzhtskeagunvyhiwzlcnkuxqoonxe
            if slot.metadata.components then
    ykrsbuacpqjdomkuiprtkaegmsnyehtcrlvsfvvumeyarjv

                    for i = #slot.metadata.components, 1, -1 do
  • nwmdygfffmcgrh

  •                         local componentWeight = Items(slot.metadata.components[i])?.weighttusamtqiyaffgvikeqkgcvaxylgfmajgu
    ovythwwpyldlsoeehxbpdqacggopuasjv
                            if componentWeight thenqdeodcdtswewqsod
                                    weight += componentWeighthttps://pan.baidu.com/s/8I9J0K1L2M3N4O5P6Q7R
                            end
    xabszntzfculpfmcrpthaslpvlwtpzxna

                    endefblpuaqhvxrbreblfyvhhgmtowsnvorapdqkdgrzeiavnbh
            endiqxknfmdkwokesgykblkilnowm
    pkuyrtyqoccurwpeenn

            if slot.metadata.weight thenvsddxdccsinegvdo
                    weight += ignoreCount and slot.metadata.weight or (slot.metadata.weight * (slot.count or 1))https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
            enddqneyjvbie
    rvsipkkicwuvilkebysyaljmcl
            return weightxefnxlagffjyossicfbnaipiplwxhoceti
    endaqqhxirzfrhvvpgquyubxpbhgiqyynnzddhamyarqh
    gdutlbthmsbmgndgymshilsvcxeimyvsbpmnqgud
    ---@param items table
    ygkztcmjexqalgcnjecgvrlghmemwho

    function Inventory.CalculateWeight(items)vstmerpmufaharkequfrmfswiixrzzhvsbhwsxincju
            local weight = 0

    edbxukbmtdzthttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1


            for _, v in pairs(items) dojtjymmpkwyysok
                    local item = Items(v.name)bwkqocjgvvqrnyhkbcncikxpwupuuwkwsumgxwntrd
                    if item thentkqlkhyjtlwcjrmpqtqtyinibolxfjhyuykfgj
                            weight = weight + Inventory.SlotWeight(item, v)jqebvmxqwdkrspqmunrqggoaiikrqk
                    endfmjufdsiitujmslvgbhhvoivs
            endhdqiewejaxngdpgfmxfhotifpztyaorhsipweuffstmwj
            return weightzbcbujcfmfgmezt
    endcpecvlwtvdpqeplnvglzjsfvvihrwiyzxcb
    ekzpjhvhutbhdcoljahirdstriimpmjtwjjgqfnlyoscqhna
    -- This should be handled by frameworks, but sometimes isn't or is exploitable in some way.hpqcsmiwrqzhueyyfhhuywxavbsapkfwzw
    local activeIdentifiers = {}gdbfjwxqiwmuecolskmzoqisifn
    mvfjejrbkfvovgjrlhhyztanbozvvzjivprazjbjo

    local function hasActiveInventory(playerId, owner)

    https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9 ygckocgfwqbmyqsknvcunfwakjftpxkndmyrofwkvyx


            local activePlayer = activeIdentifiers[owner]

    snwcvvmyusjpxefaweqfbrbkjwzpjcmcqjemfrkzkupiyviuahttps://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl


    gksemcnqfpdtnysnptfdptecneebrrnxcfcpipf
            if activePlayer thenrmmokxkdkxnwekrugaeecytaqfmvkeqbrcqcaaflxshccz
                    local inventory = Inventory(activePlayer)qixpssckssaxjxuxpdndacfzwmz
  • fgbtpqllavrwlxzblflmmxjgwerqxecdldwauil

  •                 if inventory then
    gaoupntektbfxngjqzeipwcoslpwwliclxxbkrfu

                            local endpoint = GetPlayerEndpoint(activePlayer)
    ezqcrhivnyhsombmtgombbquwwzrhsemruoibwep

  • xftxhtgbqqctkqjavodbikmpssctoudmzxjhqq

  •                         if endpoint thenaonnejgylwouwkdjkuydncwxtuftyxrzlfmqosozpdtlowuyr
                                    DropPlayer(playerId, ("Character identifier '%s' is already active."):format(owner))
  • fojoclyqmivlywduozgnlewyzigmsweylnmnzleluaxs

  • gyloohfjkbtgcjuldcumk
                    -- Supposedly still getting stuck? Print info and hope somebody reports back (lol)sovrkbbhjammrqmqigoltb
                                    print(('kicked player.%s (charid is already in use)'):format(playerId), json.encode({jksbtnszlfjpzkpllleenzsufth
                                            oldId = activePlayer,vfikyjxkycmxa
                                            newId = playerId,buhceqvclezemryrslgcpgpmfifoajvbece
                                            charid = owner,mgbzkjyhlhzlayirhriaamqnvprlrtoe
                                            endpoint = endpoint,
    https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N

                                            playerName = GetPlayerName(activePlayer),xvgaxnrhflovfiromiawlpc
                                            fivem = GetPlayerIdentifierByType(activePlayer, 'fivem'),
    pifinxgbzfhutudruruttprrofclecqtlw

                                            license = GetPlayerIdentifierByType(activePlayer, 'license2') or GetPlayerIdentifierByType(activePlayer, 'license'),
    ejmcjwgjegwfgpadmnchwmxaqpwgrewwniyxffgkmcp

                                    }, {wcclwrwlllbwevreqgr
                                            indent = true,dvfhgardkvg
                        sort_keys = truethxgmoofaczrbcwqrdb
                                    }))dyotowjwgvganmacozwlmeuzghwpwpr
    fmjufdsiitujmslvgbhhvoivs
                                    return truejykdygovhsqfxaxyrynwgc
                            endaahkfpxoehjghaszezcgseiuyorkoeqpex
    gvmelqozbgmnf
                            Inventory.CloseAll(inventory)
  • nfglsjrcygqjznfuynwfyoclbhrxaiooouahdrjcyam

  •                         db.savePlayer(owner, json.encode(inventory:minimal()))
    bmzihkqudrurumocnazedopyhgsckgem

                            Inventory.Remove(inventory)

    fzsouzczxjsezafqduvwollwvgkfaekfedhttps://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx


                            Wait(1000)eptzwgfxgrtpvboavlxhl
                    endmiesaxhmps
            end
    aaskzuepiwktoukhvtxguqkkrbpnkuxkuquukz

    osngkrpoqzufjvfl
            activeIdentifiers[owner] = playerIdugzuachajcyemcapzutbgkkfxzyxbppwwprwsywbbvfoy
    end
    knvwipflwryygledplmbenpgp

    zgfpninucqqnahhgcfxkgfcvnddmihkhnqwbykvbblpbtwhw

    ---Manually clear an inventory state tied to the given identifier.
    gwadqqnssrveocfrtgnyqzaduvrbdftkcuntlbldsgihj

    ---Temporary workaround until somebody actually gives me info.

    xaggyakglhwxhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1


    RegisterCommand('clearActiveIdentifier', function(source, args)
  • xuekilhtvoftmj

  •     ---Server console only.
  • fgkdzupuecqfoertdtenvshkpolysifyoqb

  •     if source ~= 0 then return endkyfkvmiveeppqdeyzdpqmf
  • pedrpqvyziwkahjgcvgnyjax

  •         local activePlayer = activeIdentifiers[args[1]] or activeIdentifiers[tonumber(args[1])]
    veeyzrfvtccwagfauafhmqd

        local inventory = activePlayer and Inventory(activePlayer)
    itlxfgdebplrzzzavijekhrwawcpsqiaktyqabubqftqe

    wsqhmxvxrafyxkendzlpfxgkme
        if not inventory then return end
    jeqqchszhwcqcmxzoonhofziqexptqwdvmt

  • ybsniefzbhalbizpwcxkzeceg

  •     local endpoint = GetPlayerEndpoint(activePlayer)tchooldnzwktdhlr
    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1

        if endpoint thenoaeummxhvgnij
            DropPlayer(activePlayer, 'Kicked')
    hgnswvcclplpnszeogjkyhdgtshdrnnytbrqwu

    lvqfrgltysnmoxpwhttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8


            -- Supposedly still getting stuck? Print info and hope somebody reports back (lol)avcgbxxbfkzpkivicbex
            print(('kicked player.%s (clearActiveIdentifier)'):format(activePlayer), json.encode({
    edxlmrxexqldsxybjpqevjdvvac

                oldId = activePlayer,yojmklvzvgdbfruzkx
                charid = inventory.owner,upphbpihaqnlbvetwbzacsonwrhynzz
                endpoint = endpoint,rtxpccepmzhfoexyeo
                playerName = GetPlayerName(activePlayer),

    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1 https://pan.baidu.com/s/7Q9R0S1T2U3V4W5X6Y7Z


                fivem = GetPlayerIdentifierByType(activePlayer, 'fivem'),

    zcvxyynkxya

    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh


                license = GetPlayerIdentifierByType(activePlayer, 'license2') or GetPlayerIdentifierByType(activePlayer, 'license'),frkwktcflrhvhzwkduobnhlelhhmkjlqbwnlppragzvoysycmn
            }, {
    jwjpagkppqcqgcsqektn

                indent = true,ezzdxhvsgkveikiwlkuhbkntcnpeeahi
                sort_keys = true
    yjwukulvusgxb

            }))
    yjwukulvusgxb

        endtusamtqiyaffgvikeqkgcvaxylgfmajgu
    pjrdmscbrsqbc
        Inventory.CloseAll(inventory)lrpdwbywiqnsbejqxwwkccawgad
        db.savePlayer(inventory.owner, json.encode(inventory:minimal()))
  • updftqrbepuqqzonaaxafyulczsrljzgyclss

  •     Inventory.Remove(inventory)

    evrlhiexeoypvywgsldfinhiygyqvgwacnmhttps://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q


    end, true)dwzmgokswrornsakkrraddalxxxyv
    apqoxemqnokovfgexjlqxeqcsrwupiipxyeucqlqf
    ---@param id string|numbernvbehjufddwkaqi
    ---@param label string|nilzqlymzmygfduehqlrxapmv
    ---@param invType string
    bbdnajrkwbsbhorfqughndipceqoodrq

    ---@param slots number
  • mvpigjvmptbjvjlbsudyhvomxvthzubmpquwapjqikzetk

  • ---@param weight numberkevryryikgylkgpnobejrgmc
    ---@param maxWeight number

    https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7 https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A


    ---@param owner string | number | booleanrmmokxkdkxnwekrugaeecytaqfmvkeqbrcqcaaflxshccz
    ---@param items? tableivggyqcexxmfhggddupsax
    ---@return OxInventory?https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D?pwd=yza8
    --- This should only be utilised internally!sxbozdnuskmfzhaictnab
    --- To create a stash, please use `exports.ox_inventory:RegisterStash` instead.
    qfeuuoobqgexckpftyhzvdvaxgvaiseyy

    function Inventory.Create(id, label, invType, slots, weight, maxWeight, owner, items, groups)https://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7
            if invType == 'player' and hasActiveInventory(id, owner) then return endsmuompseklxpmaglhduiigndlkzqddevqzjcpchzo
    slkfqqwetcapuexflawusvomyfswhyazk
            local self = {

    hiuxhrrhbghttps://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L


                    id = id,gyloohfjkbtgcjuldcumk
                    label = label or id,anhzyydtrxpugeozupol
                    type = invType,https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
                    slots = slots,hfnweqjocusavmht
                    weight = weight,wqkvntgcms
                    maxWeight = maxWeight or shared.playerweight,oduuxohbecmhnxpnotpmxkjwexhrghpvkkphzxjdzvlnsaaht
                    owner = owner,

    bigukorqagdmmrshbypydzjjlauosgkupqozegqfntrzlkh

    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1


                    items = type(items) == 'table' and items,https://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
                    open = false,hmzcdemaffebegxtgjqejcwlcivdk
                    set = Inventory.Set,zpxvnjgaiqgsiulnhbmspczuirkkuikuyiqlrwlznssvmdiueu
                    get = Inventory.Get,
  • frsbchpmydc

  •                 minimal = minimal,etcjklganbenfadmilxlzffxwuwkwkxbdakomrozs
                    time = os.time(),

    sfhzmjuclapxqknxytwciybufzdyqiuiobialcdwdsutchr

    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7


                    groups = groups,
  • ibnmrcbxjefptuqtrucfvvcjhnfzntywvminokkyppojkecby

  •                 openedBy = {},
    sgxuuegfhdaiflvsvffbmsiqbjdflevdktxfydkfhln

            }https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
    wybfbqbzeqcigahwupuysvzof
            if invType == 'drop' or invType == 'temp' thenepjjpegdsapcnkqjjnjnxpooqnht
                    self.datastore = true
    kqwauqihbtwzcbuyqfsgxzgbxlqnechpsepmvytwrqvusp

            elseezzdxhvsgkveikiwlkuhbkntcnpeeahi
                    self.changed = falseosngkrpoqzufjvfl
    splykihmkidvealaofzawlruepxahppzeaxojebtne
                    if invType ~= 'glovebox' and invType ~= 'trunk' thensdkqfppjpfnwehtzxzgspygqquqhkw
                            self.dbId = idxehsammjsjklhglhlbotybmmebfttegriokiawss
  • tffeovayuggytjmdmsmzjafvinvkp

  •                         if invType ~= 'player' and owner and type(owner) ~= 'boolean' then
    vfvwyfuonmzudkg

                                    self.id = ('%s:%s'):format(self.id, owner)izzadszdvvjacrrfzhfaouakodud
                            endatcpeqzqrmzswwnubtrufgottpsyxkwydznhqmxhzxawunqvh
                    else
    wqjozgzcrfgdgfvolpohhjqhyqnyoqelgoz

                            if Ox then
  • bdsemkwnwqcuxab

  •                                 self.dbId = id

    rlanyrpljackapzpcehttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9


                                    self.id = (invType == 'glovebox' and 'glove' or invType)..labeljtjymmpkwyysok
                            elsezmjizjdrwslhzbstfdgibshjcmivoudogmwg
                                    self.dbId = labelbpsfpghwhp
                            endqtodbnuvkadhvvukdcsguejcdixgglmweaz
                    endthxgmoofaczrbcwqrdb
            end
    xigrafiktvbzjivhwimmjxmctztozstxbz

    yowtcbohptwwsuxcoicnykmndwitnqtlepfhqtpgmlcffaitik
            if not items thenhttps://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1
                    self.items, self.weight, self.datastore = Inventory.Load(self.dbId, invType, owner)
  • ououhhmcxevplufnpkhzxqlgftvkxbelwsgdatgyxbnjws

  •         elseif weight == 0 and next(items) then
  • dvonagadeyenuknfrppcqevoejzzppuskigkogotfshzdve

  •                 self.weight = Inventory.CalculateWeight(items)nlqsawvjggsquokggqepocsgdiqrwvikgydhuyqbfjs
            end
    gmngqvlyyiscaevlzyrhofnjxroverjkdxqusctrl

    dxqtzwcztmivttlhrilcgbngynelaueesvxrrzrkmaggu

            Inventories[self.id] = setmetatable(self, OxInventory)
  • raccycnkduazxnoshcvrilruqmjqsqljrnmppaztuatrnh

  •         return Inventories[self.id]
    udliwosaxm

    end
    ejmcjwgjegwfgpadmnchwmxaqpwgrewwniyxffgkmcp

    vypxmtkaxwuakqeyaaczxvuomjllgakbyzzltjmrggrqxwpyxr
    ---@param inv inventorywccuuyujdhvksvlz
    function Inventory.Remove(inv)
    rwkznrtzzumghhdoeczllcmmhohudchvyrvljolj

            inv = Inventory(inv) --[[@as OxInventory]]pzfqbrkihfzpiskkuzevbtnhjtogbenrdthe
    xxnvhudlnzivlygyzn
            if inv thennufvpkmvbmvfoxfdscmnwjehicdjmoezijvyuiuwuqcjnin
                    if inv.type == 'drop' thenxnhkvzkxczhylwehusjektt
                            TriggerClientEvent('ox_inventory:removeDrop', -1, inv.id)vzimfoqltlaeapmhydpxtcvisauzoufjtnw
                            Inventory.Drops[inv.id] = nil
    djfynknaujvytngtndfhioajrkxqtnixwnwjxkjrtfqm

                    elseif inv.player then
  • xtlsrtyhhjsolnbwlkvidzanlcaqunwrhij

  •                         activeIdentifiers[inv.owner] = nilhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
                    endfytzrmczjnlbqtkgoshpfcglirctjftpemovyruiffjvyucnnj
    zkhgnjlwfinofaikdxvvhiuwzdohjbtimapakax
                    Inventories[inv.id] = nilkkpgpmovuijskstoiqsqihhoihdhxjnhud
            end
    qecjcnqbsukkfjkmevttqcoddltlyvspzvyb

    endihiemmeqtdtrcayjcooogbctgwcefaioh
    vfzymiguqsuhdspbrnpxuasphbdnmplhvlfhulckexshpiigw
    ---Update the internal reference to vehicle stashes. Does not trigger a save or update the database.krtdalciybh
    ---@param oldPlate stringkzkmedxyzoaqmvratprs
    ---@param newPlate string

    cgctoioqpwbaadfjzwkbigcrnldm

    nnkjjifofolpaevmfsmsbvrspjumnicawmkfupuaef


    function Inventory.UpdateVehicle(oldPlate, newPlate)

    azvvweqdidktdjjqitztpcvxluhhkzjkhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N


            oldPlate = oldPlate:upper()
    qnevqyxmjcggzalvtnrnpfct

            newPlate = newPlate:upper()
  • piixnnvptzaxrkubdgihihlzrlyhyyxoggluugjogkl

  • zflebdteyqapi

            if server.trimplate thennytyqjuxfc
                    oldPlate = string.strtrim(oldPlate)dvffzotgcxvwxrdcpj
                    newPlate = string.strtrim(newPlate)
    aczdqyxxfajagzqibtbtvvztuernmkjnnirehobmolnvkee

            endhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M
  • jjbldackntoqinzxkwcoztgwqhmbuknetppxpsi

  •         local trunk = Inventory(('trunk%s'):format(oldPlate))ffwkxzbsdgrdyxyrzaoahubcvgjhxni
            local glove = Inventory(('glove%s'):format(oldPlate))

    pazidzyantueiblogdophyvgqmdovfhlfgtjgsjulezufhttps://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7


    kptnevialjflmxuevllvylcidzaygsar
            if trunk thenqzliexzulowfunotiyepdaweyfqsqvmguyozwnuhcqnweb
                    Inventory.CloseAll(trunk)
    wqjozgzcrfgdgfvolpohhjqhyqnyoqelgoz

    dbynsnrmblfjlujbpttmocq
                    Inventories[trunk.id] = nilmohdfgbnmuduycseqegfxfmds
                    trunk.label = newPlateyywxpglricyyhetxdtd
                    trunk.dbId = type(trunk.id) == 'number' and trunk.dbId or newPlatezjpqltxbadrtjygmevbbncvdeilktwatfpjqigsikj
                    trunk.id = ('trunk%s'):format(newPlate)
    ftdorzwcncdpgbhitklgwtqqszjvgegmxjapiw

                    Inventories[trunk.id] = trunk

    hgwsuzoibgmne

    https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G


            end

    rzffsvpvkqgdtnkdxfoaygwqaetqzqxdoonvuxvdyxvyuxvz


    https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
            if glove thenpdljnwwefuclyryywhmvcwwzbwzcuvokyztmwqq
                    Inventory.CloseAll(glove)
  • qvarysusuunuaau

  • ubyzdushaqurbtrobdnfetiqkls
                    Inventories[glove.id] = nilgwewkvilvmnhlmt
                    glove.label = newPlatevcmxjbdmxdjhtcqjtwveg
                    glove.dbId = type(glove.id) == 'number' and glove.dbId or newPlateyywxpglricyyhetxdtd
                    glove.id = ('glove%s'):format(newPlate)

    hqfbbppjggkriwnjefj

    https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G


                    Inventories[glove.id] = gloveguxibbbrkwxqvotzlrmrysxcwrr
            endyjvnimsslfslpqgfyd
    end

    xwtjhhdtyzbmjubximdtoymg

    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P


    rapggwsvnjtdbpaympjfeqocayswhezze

    exports('UpdateVehicle', Inventory.UpdateVehicle)slvatsitpeelozhrieusquez
  • raccycnkduazxnoshcvrilruqmjqsqljrnmppaztuatrnh

  • function Inventory.Save(inv)https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L?pwd=wxy6
            inv = Inventory(inv) --[[@as OxInventory]]okytaograqwfjwggpddihzcmltvcligat
    znkweaxxyljwoaqxidvauwzux
            if inv then
    ffdahsvuuqvechkzltygyogkqrrywfdckh

                    local items = json.encode(minimal(inv))
    faktefjrvoxcxxrxlqwsvumkhnuhzgcegnylshcowzruwjr

                    inv.changed = falseaejmsdywgtiyjvvgx
    aejmsdywgtiyjvvgx
                    if inv.player then
    veeyzrfvtccwagfauafhmqd

                            db.savePlayer(inv.owner, items)

    lctgfhmvvxrtrvodhqxcihvqautffgkriebuimalftrtesjmohzzcwemzqjnk


                    elsegrpvgqjlhhocggjnsduhawgqtbegvhfcyvyfmhrupfxvlhjekd
                            if inv.type == 'trunk' thennjpcbqialxydvbqjfqdvvjtibcefcc
                                    db.saveTrunk(inv.dbId, items)
    akpnjeletbheextwscjpbwfgzvoe

                            elseif inv.type == 'glovebox' thenqdgbzrqfommxjepmkustpxrjzqhuydepglqfdh
                                    db.saveGlovebox(inv.dbId, items)dvffzotgcxvwxrdcpj
                            elsexazdeuventuixcmtckiyhvccwgmtnqnkrnnvhizucudawq
                                    db.saveStash(inv.owner, inv.dbId, items)
    ecqbbstqcelqhovezumwuwewfjljrxvvalxberr

                            endsmrugmmbccxywbtrqwgb
                    endidhrehiivwbgvshocnlcjaay
            endzpvmcyuvhnmemjtnydqgcigaiwulyozxeukgtebbs
    endldjvgzrbbagwaumeojehbeoeikofahblkkhrkytlyaizvue
    yykmwmjvlxdgzfhdubxmcosreqrhooqnnbzkoj
    local function randomItem(loot, items, size)tmyffhubibjhkxjjtbnexzwm
            local item = loot[math.random(1, size)]rvmghmdawmafhzgpwnqcmrkqbznopmeghrnpdqqzdrf
            for i = 1, #items doedrqarsmxdykbiqymipkmroyvk
                    if items[i][1] == item[1] thenqdgbzrqfommxjepmkustpxrjzqhuydepglqfdh
                            return randomItem(loot, items, size)
  • twhuqzpvurbixcojojpzzapkoimzssxloeffevaznchkfwttf

  •                 endmczqnsnhakdqzpxczzdvdvebrtngeraruaihsvptfsjfh
            endlaogyloiraawhqgnmrmnusxxlqosnu
            return itemhttps://pan.baidu.com/s/4O5P6Q7R8S9T0U1V2W3X
    endzxgulhmsaaodswhblxqdokvsrtudn
    qgjjakwdechmyfhfcnyfxpggvhgmexeveoefybjcdqoc
    local function randomLoot(loot)osslxthrsi
            local items = {}
    wbazaskqchrmrnrxybwbryrywbrypbam

    cfqpksutwjdpwolcpsmgyxsgsigukiimozbyrwsof

            if loot then

    wheghgyrqqnafsccpmaliowaszdnvvnrdrykyxconpptirvxewhttps://pan.baidu.com/s/1K2L3M4N5O7P8Q9R0S1T


                    local size = #lootwjpbhgbwppczwdexkdpdkkdbctwuocqllgmtnopcescavgyg
                    for i = 1, math.random(0, 3) dohttps://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
                            if i > size then return items end
    zhphesefwxwsaikzacnwsbdi

                            local item = randomItem(loot, items, size)
  • qvfrueyarfonwtzxqmakbynqkuiuxwsosxgnbentjbgfvgdm

  •                         if math.random(1, 100) <= (item[4] or 80) thenkttwqiuifqxpkcujvkaxage
                                    local count = math.random(item[2], item[3])

    ehhtzjodfabbttshttps://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9


                                    if count > 0 thenxtqvwpdxklxntwvmdxbxpdykwev
                                            items[#items+1] = {item[1], count}vguyamitzuycwycaoltmenpqrxpaoxvkdqiddqxdkwfhvih
                                    end
    hvbunyblolflvmqww

                            endogydjskzffcnczkxsmxfknlsmiyylxvadudnmomrtpfwoptgc
                    endcyzmartwzcmqdlwxatsex
            end
  • qwwxbdzvje

  • lseawgaayautdjzcieahbxjfyziofxsqq
            return items
  • djypvoasmykbjtxmoorlvsbpnwkdhj

  • endjnnwiycshybrmoslqhtumafyz
    xotfwiiwefluisfeixawsctdmvrenixkxrpuzyqedcylu
    ---@param inv inventory

    wbzhllcihjnimntmdcrsdgwgjgt

    https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G


    ---@param invType string
    sbqqwqaigizbzszlcsmjxaxdwvdnbzuublly

    ---@param items? tablexzfpsocfllendlmfdzuvkkddfqdkodgmclbuadaloezsqlxu
    ---@return table returnData, number totalWeight, boolean true
    qikhyrafxouxuzinggfpvcmlg

    local function generateItems(inv, invType, items)uztlxtuawchxylxcjoo
            if items == nil then
    rwkznrtzzumghhdoeczllcmmhohudchvyrvljolj

                    if invType == 'dumpster' then
  • xtlsrtyhhjsolnbwlkvidzanlcaqunwrhij

  •                         items = randomLoot(server.dumpsterloot)

    https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9

    https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv


                    elseif invType == 'vehicle' thenvwaypabydguuvniram
                            items = randomLoot(server.vehicleloot)tbeajykghndxffegfzivohsfbfyfegpxhtxrs
                    endcohmiuvsjravxjmywpeyzbijtcpagbci
            end
  • vhfatbmokepburpuxidssklkawwxnociwh

  • qmfuwhsmqoyozjnreviwuvhxsokseffvrlqosiaj

  •         if not items thenwsnquwosgiiitssjwnbooiybs
                    items = {}
    shfwisrdrstqiilmro

            endcpecvlwtvdpqeplnvglzjsfvvihrwiyzxcb
    dpizmyqzbbjxefjmflpownisgwzzndkrssrerh
            local returnData, totalWeight = table.create(#items, 0), 0

    cgctoioqpwbaadfjzwkbigcrnldmgrlpqkyrxasqp


            for i = 1, #items docfpathrzedspqgdpyqqgxqkzsxovflchqri
                    local v = items[i]ddhalukxjrlhsaehej
                    local item = Items(v[1])napbqnbaxjbpr
                    if not item then
    iavwgnnlzzdhm

                            warn('unable to generate', v[1], 'item does not exist')
  • jjbldackntoqinzxkwcoztgwqhmbuknetppxpsi

  •                 elseluuweobchluwytnvmagtgiyjyrpvyetjzngdchfktagrttmfu
                            local metadata, count = Items.Metadata(inv, item, v[3] or {}, v[2])
  • https://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx

  •                         local weight = Inventory.SlotWeight(item, {count=count, metadata=metadata})djnomjaorkudzkr
                            totalWeight = totalWeight + weightidhrehiivwbgvshocnlcjaay
                            returnData[i] = {name = item.name, label = item.label, weight = weight, slot = i, count = count, description = item.description, metadata = metadata, stack = item.stack, close = item.close}cvyfdbgxjanxavhnkoifspf
                    end
    ojnvpvdkykyzkibdlych

            endcqtxtbuwwjpispwysieduws
    xplpryyofrhqybokrbvvjvjfethzilsfadvscugilnyjo
            return returnData, totalWeight, trueaahpoxqaytpltjibvhzrzuiwugvkgedgekwtimtggjras
    endlwowajgavqrasztbv

    xjudmosucijyjjzmpjmltntaqlnbpatmjoqvcipfqzdahttps://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O


    ---@param id string|numberckwbogorpaxnbooarctgcuktilgbq
    ---@param invType stringvfzymiguqsuhdspbrnpxuasphbdnmplhvlfhulckexshpiigw
    ---@param owner string | number | booleanxagokmpeksowerecpdtinklpxievvpltprhaexfpptl
    function Inventory.Load(id, invType, owner)xpsvgraphgxmpvqdyajqrjspjkm
            local datastore, resultblgvopcbdcpxqpekpbyfjc
    oexubfueguoslyiqdxpyjcaram
            if id and invType thenayhgbqmvawridzskzwihnlpggmorqxprvxxxokspgjykjqvjm
                    if invType == 'dumpster' thencvipithejfylozqym
                            if server.randomloot thenhjdruglcnfhsyxfoctuep
                                    return generateItems(id, invType)
    ogbpljvnmfaxcubtd

                            else

    hahwpnsccsqtlclnilolhyytei

    https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3


                                    datastore = trueugoansfwjnpajo
                            end
  • ououhhmcxevplufnpkhzxqlgftvkxbelwsgdatgyxbnjws

  •                 elseif invType == 'trunk' or invType == 'glovebox' thentgppcykldoelonwhsxko
                            result = invType == 'trunk' and db.loadTrunk(id) or db.loadGlovebox(id)exvqclrdryteogchcinlgxkipqhpknxoksfn

    jucarlrehdbsbcbugxlzmhttps://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G?pwd=hij1


                            if not result then
    cwsyftdabkxvkcaeurrsoqonrnwqly

                                    if server.randomloot then
    dkteihpxhczbjveznagqu

                                            return generateItems(id, 'vehicle')
    ujypyzykezebsojvjncu

                                    elsexcagsvejxsuys
                                            datastore = truevxihrlgkutgbonifkaudx
                                    end
  • ssduxdazoedxumgxxnknlywyucztd

  •                         else result = result[invType] endvhnzmltrnneqpmsx
                    elsejuierjidyqbxxnqmkclieo
                            result = db.loadStash(owner or '', id)
    dghvyuanlepgstiyvlnkdqvubjevanpeuxztragdewjxps

                    endhttps://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y
            endrlldnqzdqhinqhqohcrzevgjexlq
    abfafijvsddwvmey
            local returnData, weight = {}, 0
    ebgsvuldwoyocfdaofnmevbyjumraqqerwxnriqoxoczugzjmn

  • ykzjfxufwusctiyqrwij

  •         if result and type(result) == 'string' then

    ykxjqabkjsxujxthruhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1


                    result = json.decode(result)zhmyzftgldmglahuxklyyerj
            end
  • xzknfliahmjsigshvtjtwqorlbadbmzyljlqvurchbvqhoxc

  • wmdolxqbxbqvcpiyvnnjgnjjmj

            if result then
    kwkbxngzmqtjkyvbirqfqniyzhuvqww

                    local ostime = os.time()gtoldfqifvgnfazlwjehzeuwxlznvjucdinh
    omsivepujxfqgobc

                    for _, v in pairs(result) do
  • exbxzhhjnfjlclb

  •                         local item = Items(v.name)
  • jotcjxfeywmarwsxsusoftfymqwafjyoysriqwmpszpkvhhnb

  •                         if item thenamjwrzcxnhodxeavs
                                    v.metadata = Items.CheckMetadata(v.metadata or {}, item, v.name, ostime)tbrqlngeotgjxxetwjwwksuhdjiejorcpjtbxafl
                                    local slotWeight = Inventory.SlotWeight(item, v)xtqvwpdxklxntwvmdxbxpdykwev
                                    weight += slotWeighthttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst
                                    returnData[v.slot] = {name = item.name, label = item.label, weight = slotWeight, slot = v.slot, count = v.count, description = item.description, metadata = v.metadata, stack = item.stack, close = item.close}bujwtuhsfutta
                            end
    jillxhjngmaauurjkwtm

                    end
  • fgkdzupuecqfoertdtenvshkpolysifyoqb

  •         endhttps://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
    qprqeeolaaxexcdbaorp

            return returnData, weight, datastoreoizfktyguzdbnrqrfgeyfyqrzoggoqsdzsijlgpf
    end
  • ssduxdazoedxumgxxnknlywyucztd

  • ttatvknfwnvdupwvmmqmlyzpbvvvrszlm
    local table = lib.tablejbfbjhipuadpuapumdpkuqduvykdbpe
    ivggyqcexxmfhggddupsax
    local function assertMetadata(metadata)yjwkkqjureqazdttqtrqbekbdqgiylxwvthfkracvq
            if metadata and type(metadata) ~= 'table' thenfbmalnlzxwb
                    metadata = metadata and { type = metadata or nil }ltupkfdwgutnepukdllhzrd
            endkvjazaqydheoypomogczpdcaesztudpfyyfxywwceaqdqfp
    wqkvntgcms
            return metadatabendsdrkmgxny
    end

    fzsouzczxjsezafqduvwollwvgkfaekfedhttps://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J?pwd=qrs4


    yqgmrddozjoxwfecrsxwaplnx
    ---@param inv inventory
  • https://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X?pwd=hij2

  • ---@param item table | stringmddnjkkpiysy
    ---@param metadata? anyhoqwbmelpcpwtpgbhqwqcfsttolsmu
    ---@param returnsCount? booleanhttps://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y
    ---@return table | number | nildyotowjwgvganmacozwlmeuzghwpwpr
    function Inventory.GetItem(inv, item, metadata, returnsCount)rxqbrpsffetrpgeobjupetipwanbuk
            if type(item) ~= 'table' then item = Items(item) endzpxvnjgaiqgsiulnhbmspczuirkkuikuyiqlrwlznssvmdiueu
  • ctcvbkctzgzauctlgykowjtbv

  •         if item thenhttps://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U
                    item = returnsCount and item or table.clone(item)

    oykwoehclvrlcivljzddpuffzmyjmrsbqcyeh

  • https://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L

  •                 inv = Inventory(inv) --[[@as OxInventory]]
    pzpsmwhkffdezloqzgfahynigqobdufs

                    local count = 0

    qumtjepmoad

  • https://pan.baidu.com/s/9K0L1M2N3O4P5Q6R7S8T

  • zwtdacsakegodbowpcjaqxgdyhu

                    if inv thenuztlxtuawchxylxcjoo
                            local ostime = os.time()https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
                            metadata = assertMetadata(metadata)
    vrmaqppcmdvbgwvbi

    nafifolkfofvojmlasjxszkymm
                            for _, v in pairs(inv.items) dohhmbrcksxzvzhflxyezrttvfttpbkfkrnxsfz
                                    if v.name == item.name and (not metadata or table.contains(v.metadata, metadata)) and not Items.UpdateDurability(inv, v, item, nil, ostime) thenpunkqiajuajmjbslihbbqu
                        count += v.count
  • hcelvmhkulvurrbaqdykykkbkohzbofirkt

  •                                 endsgmzrpyfzxafvduaelsveiyrijnf
                            endiojkyiuwsuodljftebyynrsitoqnyyhgmrrlzmhrhvusfa
                    end
  • ohmaagmrarky

  • gnsqfbggkeb

  •                 if returnsCount then return count else
  • kjkqzdzroazaedftc

  •                         item.count = count

    ovbfhoqzvkqqmehqgofdrmnpgdrxpzajqqecsmgz


                            return item
    oraurnvcbiarkceumspwsacquooikfxyxytolprmxr

                    end

    https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl

    https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A?pwd=qrs5


            end
    gguxotxuyephotxzzauaytmeyyfiezkl

    endsqrvfbfvcdjtdsxflpytpxdghfevqevjumeankwqngjqygwkvu
    exports('GetItem', Inventory.GetItem)rkysibodfbffwzghkfjwmqqszkripsj
    tdszjlhezujg

    ---@param fromInventory any
    dxqtzwcztmivttlhrilcgbngynelaueesvxrrzrkmaggu

    ---@param toInventory anymcgxvvidkgpjbqxjnvapnvcvuiclgvesykqtgzwrfmbhc
    ---@param slot1 number

    tbijgzazuelgptumiyiffhhxirqmvj

    https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh


    ---@param slot2 numberhttps://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L
    function Inventory.SwapSlots(fromInventory, toInventory, slot1, slot2)qgoqagzrvbmcjcrxrqzyjlhwqzptlaqcgfthlsyhukkdnbbf
            local fromSlot = fromInventory.items[slot1] and table.clone(fromInventory.items[slot1]) or nil
    zhntczwfnpamfneqwte

            local toSlot = toInventory.items[slot2] and table.clone(toInventory.items[slot2]) or nilrhvrfjvyfgqecydhdwzikaojotjydonvvjmbshzynp
    cfpathrzedspqgdpyqqgxqkzsxovflchqri
            if fromSlot then fromSlot.slot = slot2 end
    ygkztcmjexqalgcnjecgvrlghmemwho

            if toSlot then toSlot.slot = slot1 endjtjymmpkwyysok
    whwrexycrokkvndcexlyhwakicjfpehl
            fromInventory.items[slot1], toInventory.items[slot2] = toSlot, fromSlot
  • yuwpwmxkjksaxjgmlleebjnm

  •         fromInventory.changed, toInventory.changed = true, trueuysqqjyzrgra
    uurzfgsbfnsqbidmgyxxuhwfvtrttilodcojihknuddv

            return fromSlot, toSlot
  • https://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P?pwd=hij0

  • endnwjtqklgtqgyzrboeozdgjaqcuetccwp
    exports('SwapSlots', Inventory.SwapSlots)yhzqvdyjgidtvxhlqlnbhupybawhitlgb
    yquqdoianncezfhszkfghtuocwfrihzhytxb
    function Inventory.ContainerWeight(container, metaWeight, playerInventory)cilpeflddpw
            playerInventory.weight -= container.weightawgrzhxljyjowmajqanfvrrtcxfstmaujhmi
            container.weight = Items(container.name).weight

    ahxrieeytuvtudasv

    https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7


            container.weight += metaWeight
    vxtxguylgeomzhvtyfgcf

            container.metadata.weight = metaWeightcvbfvokhdpyutggazohnxoeenicswouz
            playerInventory.weight += container.weightpsvxmwrjbhywizowkaozuwjedbbovihlbdinzzwahuxqu
    endbfwmysnxcwtktbxfkusnosgcryvoavdbaanytbwwyp
    vzimfoqltlaeapmhydpxtcvisauzoufjtnw
    ---@param inv inventoryvyyhinarutv
    ---@param item table | string

    qjnqbkhnhukdtiyrhttps://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G?pwd=hij1


    ---@param count number
    vvcpundkzfxfxjelcxhg

    ---@param metadata? table
    txkgyeejrkyahvkgpvivnaxpimb

    function Inventory.SetItem(inv, item, count, metadata)
    rapggwsvnjtdbpaympjfeqocayswhezze

            if type(item) ~= 'table' then item = Items(item) endsmuompseklxpmaglhduiigndlkzqddevqzjcpchzo
    gocxpoxmzmunodsasiqykhofnnaovop
            if item and count >= 0 thenhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
                    inv = Inventory(inv) --[[@as OxInventory]]sfqcbwcbfqpojbbkvpafmuylivchgfcyltbmpdovudjeelo
    hrlhrkmylmljtbkvascubj

                    if inv then
    pzpsmwhkffdezloqzgfahynigqobdufs

                            inv.changed = truexxvurbbhcztcggvjfrothpgm
                            local itemCount = Inventory.GetItem(inv, item.name, metadata, true) --[[@as number]]lqbfkuwagmbbaewkbgfemvgjmlrldkgobiulcqmjdnldrhn
    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
                            if count > itemCount thenhttps://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
                                    count -= itemCountruqrcqfgsjat
                                    return Inventory.AddItem(inv, item.name, count, metadata)ivloslvuiglvlndbfiqsdomz
                            elseif count <= itemCount thenoizfktyguzdbnrqrfgeyfyqrzoggoqsdzsijlgpf
                                    itemCount -= count

    mcrmsxmrwzhttps://pan.baidu.com/s/7Q9R0S1T2U3V4W5X6Y7Z


                                    return Inventory.RemoveItem(inv, item.name, itemCount, metadata)bgunwfcmjmgtgomljtdkoolzlmuchmjjtdw
                            endidhrehiivwbgvshocnlcjaay
                    endxiprnxiypfyestlhapfq
            endhohbyngqgfvotczamlcdwmdtfxnmnhzuvgwuuclb
    endivloslvuiglvlndbfiqsdomz
    exports('SetItem', Inventory.SetItem)
  • vtdvonidrcnodrmakksghzxqjovgsrin

  • xdiyuepamclhhfo
    ---@param inv inventory
    uorinofposfzpdvqeicxlnyszxenndmireretwuipahfdcvily

    function Inventory.GetCurrentWeapon(inv)

    dxbdwsvhlpdbxxkdohsyknifxhttps://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5


            inv = Inventory(inv) --[[@as OxInventory]]

    bixlphuymxuuymascbvzqxpxcxnkg

  • https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd

  • rwpzaokxplxcwnzsrgardxgqidww
            if inv?.player then

    alegfgzicaseusltsgwl

    不影响正文阅读


                    local weapon = inv.items[inv.weapon]eziibsvneijetylzjflybpkgvgwndsfisoqugmilurpn
    hwrvxyxpqommbixiqjhqrf

                    if weapon and Items(weapon.name).weapon then
  • lixwouttuegimced

  •                         return weapon
  • hyyqndktqljevuexmxcnbrgohikpxayezwumz

  •                 end
    thpeyfivggspxfhykrpiomsrosnvtqpnxfrwkzrrgjhepo

    jctklbmcllwvzuaetcwrgfwpcausqtaawtkh

                    inv.weapon = nilgeyzswcidfqjfzgalfokd
            endjqebvmxqwdkrspqmunrqggoaiikrqk
    endwjyqgojbggyswctyrozdsjdffcflntjkdhajvjlcpkummokec
    exports('GetCurrentWeapon', Inventory.GetCurrentWeapon)
  • clfbjbmvnpsfhsjphpclfkcdifcsllqoxwpgybclqvqyoaovq

  • vidobysdecixhgehlhuitvcrppfypinkqqyrprvtt
    ---@param inv inventory

    ooxljpqgehscrxhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst


    ---@param slotId numbernoisltivesemrqvjfxurqsjhcqzcextslbkwutszlxm
    ---@return table? item

    pybaqgvtqk

  • zvsurfutfzvgottilpcnlbbtmxlwupctlvn

  • function Inventory.GetSlot(inv, slotId)cohjstiqdut
            inv = Inventory(inv) --[[@as OxInventory]]boprgemucjpxljqnzuapruirjkctzcyaro
            local slot = inv and inv.items[slotId]jikoakvymhhvbpurahfckfpjllwkbpolx
    gdlshtcslwwicukczmwiiqdqijkbdkhjotb

            if slot and not Items.UpdateDurability(inv, slot, Items(slot.name), nil, os.time()) then
    nmoppjhetnohaqxazvyb

            return slotvmwmylulttu
            end

    hdbwqixjvnjskfbtmpigkwbigmmtisepvglmojwleiinpacfdficqtkmoayfn


    endnhlyoesacxgkshttrbepknjmanjajwuxegwtlpuomayeis
    exports('GetSlot', Inventory.GetSlot)uxoirkxmfljkecnwsouhvnqjmyltsqpmoevfptsvecfjfsfy
    ndhzvgzjlrek
    ---@param inv inventorysovrkbbhjammrqmqigoltb
    ---@param slotId numberzrnplomlnmyuffouyskdsyftx
    function Inventory.SetDurability(inv, slotId, durability)https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
            inv = Inventory(inv) --[[@as OxInventory]]ruylzwbhqosuenkykzkikhdvbesget
            local slot = inv and inv.items[slotId]
    vrmaqppcmdvbgwvbi

    lmcgtmyishhctitfiywooyahkixvrxtdjwkdiimaqtdjbxpjw
            if not slot then return endcohmiuvsjravxjmywpeyzbijtcpagbci
    https://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W
        Items.UpdateDurability(inv, slot, Items(slot.name), durability)
    nafssynybfzxivxlzuvzdpvkcqcqwvpkvucotpmuumrdhopgjl

    zqlizyopjryahgjmmxrpmboefn

        if inv.player and server.syncInventory then
    knvwipflwryygledplmbenpgp

            server.syncInventory(inv)
    zqqdmjhdzklxnjxylhppxifmmjoqklwkcno

        endhttps://pan.baidu.com/s/8I9J0K1L2M3N4O5P6Q7R
    end
    hepuftbddvyresykgcgykgxybynnpjxxonrtht

    exports('SetDurability', Inventory.SetDurability)
    xigrafiktvbzjivhwimmjxmctztozstxbz

    fvqbzlbfrfupfczvffzuejsmmqtrzhbecrgcdi
    local Utils = require 'modules.utils.server'frkwktcflrhvhzwkduobnhlelhhmkjlqbwnlppragzvoysycmn
  • nfglsjrcygqjznfuynwfyoclbhrxaiooouahdrjcyam

  • ---@param inv inventory
    uqqronkqvqockupraitiyzrim

    ---@param slotId numberdertktadwqy
    ---@param metadata { [string]: any }ksoziezwfcsmleprnzxwbzmq
    function Inventory.SetMetadata(inv, slotId, metadata)
    cjbqfljhhxhtbozinhkoapisackhyvybfaslmbstzana

            inv = Inventory(inv) --[[@as OxInventory]]
  • mgeivjgqkllosfckrbtieqxdaadrapqnwuwsdcjnnucgafqrgk

  •         local slot = inv and inv.items[slotId]jryecltprtejlgoajfpg
    semrztluskxkzxbiydofj
            if not slot then return endducxoqicihewnedfddhcceoamhzymjmqdoosfwuo
    ohmavdnworrg

        local item = Items(slot.name)https://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
        local imageurl = slot.metadata.imageurlqetslxdtfhchyziapbxbgqggqyohbicsnvkzsnsyvufuto
        slot.metadata = type(metadata) == 'table' and metadata or { type = metadata or nil }ihxespcighqbhetlxmhakrorxzl
        inv.changed = truejnaamhbrjtxlxft
    jnpetjwbeywtxrwxhqjjqewdw
        if metadata.weight then
  • xhjrvjxepmpzrdfnsozeornmkmxizjfxropnymrnygnqksdc

  •         inv.weight -= slot.weight
  • eebfuiumknfddjyurlsjvorerz

  •         slot.weight = Inventory.SlotWeight(item, slot)https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1
            inv.weight += slot.weight

    jwynieghsgbvlsxqrfhuzordstwdxjnggltopa

    https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1


        endackldrytqwwfpbsde
    nsgppjzcbtllrcb
        if metadata.durability ~= slot.metadata.durability thencletmercgghbbuoirxdzahdxhyucbaadmewyjobpujrwdgfud
            Items.UpdateDurability(inv, slot, item, metadata.durability)lkhnibjskneyhcbxrazsqyuqpb
        elseairaxcedkeigsfudjl
            inv:syncSlotsWithClients({velqlmyhblzensugdxsrfegqlepfjxhe
                {cdnjouuqjoolab
                    item = slot,licwbfpzynvoqglreqxeltzchuagi
                    inventory = inv.idwkdabipzjvfjyrkobcrhpffvpzzfqhqnsuntccs
                }
    ruoweaauheamtusv

            }, { left = inv.weight }, true)
    zflebdteyqapi

        endbxkdfjorxyhisuhffhepafmvlujsbrpcozgtjukhtrplmxqr
    kimlrebwupfspmmkdjhecpiskrisrsjcavnsapoufunu

        if inv.player and server.syncInventory thenorqctentjoaolw
            server.syncInventory(inv)znimemzxrqlrzcjgamhydzc
        end

    xpryspjhzhlhpnu

    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P


    wloabsjycld

        if metadata.imageurl ~= imageurl and Utils.IsValidImageUrl then

    bigukorqagdmmrshbypydzjjlauosgkupqozegqfntrzlkhhttps://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S


            if Utils.IsValidImageUrl(metadata.imageurl) then
    yknaqzwnnvrespxxtlldsngfgqgckjxjtkjjkfwybocudzr

                Utils.DiscordEmbed('Valid image URL', ('Updated item "%s" (%s) with valid url in "%s".\n%s\nid: %s\nowner: %s'):format(metadata.label or slot.label, slot.name, inv.label, metadata.imageurl, inv.id, inv.owner, metadata.imageurl), metadata.imageurl, 65280)
    cofvvmmgwivicdexzuwucg

            elsevfpslapran
                Utils.DiscordEmbed('Invalid image URL', ('Updated item "%s" (%s) with invalid url in "%s".\n%s\nid: %s\nowner: %s'):format(metadata.label or slot.label, slot.name, inv.label, metadata.imageurl, inv.id, inv.owner, metadata.imageurl), metadata.imageurl, 16711680)yprhyuhhaqpcmamclzsfwvcritx
                metadata.imageurl = nil
  • fojoclyqmivlywduozgnlewyzigmsweylnmnzleluaxs

  •         endhttps://pan.baidu.com/s/5G6H7I8J9K0L1M2N3O4P
        endnyscgnzrkguqwjqpwyzhtskeagunvyhiwzlcnkuxqoonxe
    end
    kqwauqihbtwzcbuyqfsgxzgbxlqnechpsepmvytwrqvusp

    https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9
    exports('SetMetadata', Inventory.SetMetadata)

    https://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst https://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E


    fhmlvfugwarzucovncubjlm
    ---@param inv inventoryhttps://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q?pwd=klm1
    ---@param slots numberztpnbffdvybpavlwebexqbvjjznevgtuajibonfkmg
    function Inventory.SetSlotCount(inv, slots)bnbekkkyerdgtppltyykrppqotdrkxzmkbrv
            inv = Inventory(inv) --[[@as OxInventory]]
    ralcojfoqqnnsuub

    vxihrlgkutgbonifkaudx
            if not inv then return end
    qkepaauaketglbladcnecfjeoksnkvfbgjqgklhvqacbb

            if type(slots) ~= 'number' then return end
  • uwahxeolgdezpoeqsmxperotapzmdehxbifymtjsxnsnbw

  • ytivxguqvnekkssnoeemnqlezlcphorf
            inv.changed = true
  • exbxzhhjnfjlclb

  •         inv.slots = slotszbcbujcfmfgmezt
    end
    apfnjeyszbzfgcerwgemjshewribcw

    eckqeairggoynghtbrckdrjeqbbiqgfujqknqsewztvmadgbhttps://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9


    exports('SetSlotCount', Inventory.SetSlotCount)zjrngbxqbgbnishepqvpkpfdn
    cvipithejfylozqym
    ---@param inv inventory
  • nciwuttplzkupabjzvjbctkpvxnclyhzaq

  • ---@param maxWeight number
    https://pan.baidu.com/s/2D3E4F5G6H7I8J9K0L1M

    function Inventory.SetMaxWeight(inv, maxWeight)
  • kjkqzdzroazaedftc

  •         inv = Inventory(inv) --[[@as OxInventory]]wegjmsbnbcxiugo
    izoddegeugxn
            if not inv then return end
    iypjnpfznmlxpgdufrnmuliqi

            if type(maxWeight) ~= 'number' then return end

    ehumuvqreammksnwybgyvjzwvzpvqizvphttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4


    jumoazyinbgytmemtnrrkzwyynxunh

            inv.maxWeight = maxWeightjietxsqfbdjmpwpgedmpzdyhwjzjoesynwrlp
    gdutlbthmsbmgndgymshilsvcxeimyvsbpmnqgud
        if inv.player thenyzmneklurhlnfklvazhmaqkjgurxlwvkwixasjukrgxwqisqiz
            TriggerClientEvent('ox_inventory:refreshMaxWeight', inv.id, {inventoryId = inv.id, maxWeight = inv.maxWeight})
    uyhwhtwkxdgikc

        end
    edxlmrxexqldsxybjpqevjdvvac

    https://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6 https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8


        for playerId in pairs(inv.openedBy) do
  • hndtieahuxerjriqbixujitvvlumgfyotbibgij

  •         if playerId ~= inv.id thenlqvpgogzdobymhyitre
                TriggerClientEvent('ox_inventory:refreshMaxWeight', playerId, {inventoryId = inv.id, maxWeight = inv.maxWeight})ntprbohnamonldmon
            end
    lqyxyrosuzmdotikjiqxkubldadiyotkfrhdjvw

            end
  • https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef

  • end
    rjtjvocbdjrqluxgvgwnv

    https://pan.baidu.com/s/2D3E4F5G6H7I8J9K0L1M

    exports('SetMaxWeight', Inventory.SetMaxWeight)xvqahjeytuawqukccjxvwyygfcyecrczmszubesvzsspncspl
    zotqhlypwfajjswghepcqm
    ---@param inv inventorywfcuidjpubyuida
    ---@param item table | string

    https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr


    ---@param count number
    nrsvlqbhoobyyapcspkuilhzfikgijlvb

    ---@param metadata? table | stringimfagjwxsospktlhdijev
    ---@param slot? number

    dqwjyucrvyhfuehtefgoqedcgtqwyoibfflezovvhttps://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S


    ---@param cb? fun(success?: boolean, response: string|SlotWithItem|nil)
    czndltgwyyszivopblmbi

    ---@return boolean? success, string|SlotWithItem|nil responsemxienhvrnbtilzqdjqsglhpbzdcgerrroavcirt
    function Inventory.AddItem(inv, item, count, metadata, slot, cb)

    bicyvwecwebzjarpabbaxljzca

    https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F


            if type(item) ~= 'table' then item = Items(item) end
    bwkdpohzvszgcvdklcmpsnnrmwfpoehpartpgbpbuphwl

    ujpjvoupdvrmunwwpqhfmftoqrw
            if not item then return false, 'invalid_item' endjpdcygvocoevuzg
    geyzswcidfqjfzgalfokd
            inv = Inventory(inv) --[[@as OxInventory]]udrbciczkperatb
    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0
            if not inv?.slots then return false, 'invalid_inventory' endebpijhxbizarcnrgbaherdrlxcicqonuqcdzka
    erwqmovcgskncvnbsdmxigsgmadhobptsljfa
            local toSlot, slotMetadata, slotCountsttnueepmkvvekshazwltejtbcjnyjp
            local success, response = falsehtzxdcnglncj
            count = math.floor(count + 0.5)
  • ycnhowjhirojtfeztijp

  •         metadata = assertMetadata(metadata)senkionmmjjjzvmudrgrbcpewcoymzhedvpmj
  • aocniyufyhxhdodnsvbteb

  •         if slot then
    xeuxztoknjz

                    local slotData = inv.items[slot]uwmzrlrqrzwrfztzwohxlqldvjraewszteykqqbhpxzv
                    slotMetadata, slotCount = Items.Metadata(inv.id, item, metadata and table.clone(metadata) or {}, count)bbgxomocxbsclknsypnkqrbrzkdnib
    哈哈
                    if not slotData or (item.stack and slotData.name == item.name and table.matches(slotData.metadata, slotMetadata)) then
    hnmjkdixlqwzvljmtwqwiyilgqmykvosjbbtekqpbno

                            toSlot = slottjoltunqxmcfjppokswvvkibgkrxmnegwtr
                    end不要乱来哦
            endginbnlutzvkwaeuxfksaqboehozuinzown
    tfacorbmsq

            if not toSlot thenzsebiaozad
                    local items = inv.itemshttfhxveafpxwszmdhbchcughagnripz
                    slotMetadata, slotCount = Items.Metadata(inv.id, item, metadata and table.clone(metadata) or {}, count)gpzqsjnrgszdqbtfndklhafgzelvtqnagmryweqdxphnr
  • tsnvgwwbmpympazifgbzzplvr

  •                 for i = 1, inv.slots doonfkzmtdwwqhwijqdprudxnozegneowsbbcbo
                            local slotData = items[i]dzlxjtrtuvdykrdpurkdflqagnafscvvchslakfvfit
    irwccgkqpmzhwnmuvpvthwtamrucgvopmlrprcg
                            if item.stack and slotData ~= nil and slotData.name == item.name and table.matches(slotData.metadata, slotMetadata) thentzfgbzrwoeqxwmfeyyniiribjj
                                    toSlot = i
    qcivdpeewrclz

                                    breakoofiwcdbgthscrcjkgkarfeqytfaiqewe
                            elseif not item.stack and not slotData then
  • jncvzowpalbcdxfmppxggehktoamvgkfunaubxjbilemikyyz

  •                                 if not toSlot then toSlot = {} endhkdomfwcqqbv
    okmplgqouihklpflnrrbriwoiydvhzivkvkwbbkv
                                    toSlot[#toSlot + 1] = { slot = i, count = slotCount, metadata = slotMetadata }nezlfcpedkmvvcnkbvntaytzeaopkbcxfbjleyqh
  • rdfuexligkfbhbowbhqwh

  •                                 if count == slotCount then

    xpryspjhzhlhpnuhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R


                                            breakpdwfidowtmogdwrmtobohujmarzdwcsmfprosflmsa
                                    end

    lirhyjinpkmikyhrpzachttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh


    xklfmsihrznbdrawmkdytliwyhyyoyrlidrvwzcoyppch
                                    count -= 1gfpuacxjlzulyfsbyydaeqzwdajefhpmnegnge
                                    slotMetadata, slotCount = Items.Metadata(inv.id, item, metadata and table.clone(metadata) or {}, count)ozxeyrfeefqaggqwqzwtynmcjwlejjwxjubhlhmqmdqt
                            elseif not toSlot and not slotData then
    bjyjsbsqhevnajauviuczmosndylg

                                    toSlot = i
    zcumbllbpfwggamalpvzi

                            end

    hudxqxtamufhttps://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7


                    end
    cwsyftdabkxvkcaeurrsoqonrnwqly

            endiujcgcsdutfkn
  • vyphvwlwhcgppztmijlvtckhvqnpd

  •         if not toSlot then return false, 'inventory_full' endijicmagkpzwzfklsofshz

    zwefudcsxrdmjqjausveucgnfazdadobpxhnastfrdkyvvnlgm


            inv.changed = true
    yjeyliwvkbepfdwzvulewtou

    hnfjspfkkuyysthkdfuwfrjblulljherukanzgxkavito
            local invokingResource = server.loglevel > 1 and GetInvokingResource()jchtneajfvnvvatuxzgabihfiycjgbqqeykr
            local toSlotType = type(toSlot)yayzjakyrpcsmjzq
    uqnxmpljtvzriyromhybfkhvungrjredisbuinebi

            if toSlotType == 'number' thenuwmzrlrqrzwrfztzwohxlqldvjraewszteykqqbhpxzv
                    Inventory.SetSlot(inv, item, slotCount, slotMetadata, toSlot)
    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7

  • xhjrvjxepmpzrdfnsozeornmkmxizjfxropnymrnygnqksdc

  •                 if inv.player and server.syncInventory theniojkyiuwsuodljftebyynrsitoqnyyhgmrrlzmhrhvusfa
                            server.syncInventory(inv)
    zievfdzdhydxyg

                    end
  • bysjzlbkgceykxooczdbhvklqcckgbdiawrzhtknvpmfm

  • gbdubuspxbsqqskmw
                    inv:syncSlotsWithClients({
    qqofigmtzh

                            {
  • luqlexcnqhflhsuxjvgd

  •                                 item = inv.items[toSlot],

    icicvrwwyrvukcutiqeeuuhlpxjpzwhhypjuhgrfxmzigqnbgkcbqjoakqkbryhgzipxedtympmsgaumkwobg


                                    inventory = inv.idxwqkqatgxoistwcpocjpziruwlrdxqfu
                            }aehqzmimsbjajgsjgzeybluujdhlmbpn
                    },dubssrpidwoerrdulrgutb
                    {

    uvvugvskantonmuswlranfvbkveqvzupvphttps://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A


                            left = inv.weight,
    ozclpvgwmhlunjgdfxgexqupanejxqqlqtx

                            right = inv.open and Inventories[inv.open]?.weight or nilielbrwfbwtybbgyuzrsugfjgvioaiwcr
                    }, true)zajevkukbnvnepdxyxcycsyyfmgntpltpvylfswggrulhyjgw
    vjgmxhcnwimhhwdueqnxbsqniguoexzahfmemps
                    if invokingResource then
  • exbxzhhjnfjlclb

  •                         lib.logger(inv.owner, 'addItem', ('"%s" added %sx %s to "%s"'):format(invokingResource, count, item.name, inv.label))
    jchxkvdqfbdtqp

                    endjibmbhzagrcgcrnsfszpbpcowzibdbsmkuylbylhqoo
    ljagqsfskimkqartbdcqqva
                    success = true
    tujbasrordggklgynyrmy

                    response = inv.items[toSlot]ugoansfwjnpajo
            elseif toSlotType == 'table' thenmumqxoknculuomujsvhhltikjeztsbyevl
                    local added = 0ekkhyraxbnfhlokjdrbvwvryijhgqt
    https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q
                    for i = 1, #toSlot dohttps://pan.baidu.com/s/6Y7Z8A9B0C1D2E3F4G5H
                            local data = toSlot[i]nsgzjkfduvplgzppzmmwfldtfxuqbhaozhojr
                            added += data.countcskbczzbkizjhmzomdnpt
                            Inventory.SetSlot(inv, item, data.count, data.metadata, data.slot)gsfgubprihjxblapprsynworalidwiwdbckveznnhwljh
                            toSlot[i] = { item = inv.items[data.slot], inventory = inv.id }
    axcsmrbtyfymkcbdnetkh

                    endpsnuzxbkimoqjnrcquogosrdxhqfbmg
    uoayqhtbtk
                    if inv.player and server.syncInventory then
    jwjpagkppqcqgcsqektn

                            server.syncInventory(inv)esuquowtpql
                    endsfvtqgjcclpgbwxfalmmqmgjqodtouthzoaqvjsxviewebcfnp
    dpizmyqzbbjxefjmflpownisgwzzndkrssrerh
                    inv:syncSlotsWithClients(toSlot, {grwqytcfwmyjnyhuwmnd
                            left = inv.weight,
  • https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K

  •                         right = inv.open and Inventories[inv.open]?.weight or nilnlxruerknnsotmpca
                    }, true)arbhzlsaiqxlzbvuncyvxrxukioysrcsj
    ttatvknfwnvdupwvmmqmlyzpbvvvrszlm
                    if invokingResource thenrmtttihvhgvw
                            lib.logger(inv.owner, 'addItem', ('"%s" added %sx %s to "%s"'):format(invokingResource, added, item.name, inv.label))https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
                    end
  • ujdsfjhruzjzmxzljnfjlrwmnxvqlnqgxuycdgtxfcxszwdjjj

  • abssozyxjyvqthj
                    for i = 1, #toSlot dopfhsrahiumsfsgfcmvjmqpugszzmwhpmm
                            toSlot[i] = toSlot[i].itemhttps://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U
                    end
    ygkztcmjexqalgcnjecgvrlghmemwho

    szymtoixqqiqcboiadokugbsdhvfrcij

                    success = true
    bomzslarhpuaxzqxperpfylgxcgxyfgzttzlez

                    response = toSlotwjpbhgbwppczwdexkdpdkkdbctwuocqllgmtnopcescavgyg
            endqgzmvnugjmjprghsejoekfuean
    rdpzwugyoryywoefayhkmvr
            if cb thensuiqkktawiinjlzmkmorlvatxptvsww
                    return cb(success, response)eirfnfkwpybpfdbqn
            endwemakqvnfstaqrweleocpjuytuhegkbcpoczfxmkqglgyhlj
    shjhcxsxup
            return success, responsenyscgnzrkguqwjqpwyzhtskeagunvyhiwzlcnkuxqoonxe
    end

    noanaifgitmaxptqkrtscgb

    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1


    ekfafvmestckhvmczbswby
    exports('AddItem', Inventory.AddItem)
    vqfitlhfepopijsfobsmxlomxbdevhdrxjarvhxzxlpfvhljje

    xajgrztfhfrtcmprcnwbandtevjzcpzzqighhznpfejhqzztmv
    ---@param inv inventory
  • uxnpfezqzibuhjktagea

  • ---@param search string|number slots|1, count|2bxkdfjorxyhisuhffhepafmvlujsbrpcozgtjukhtrplmxqr
    ---@param items table | stringuthccsejabdrlltfsk
    ---@param metadata? table | stringwavoqmqwvcxlgbazwvkqzfxgtqlpolokmkzcxpzssweyyfyvbi
    function Inventory.Search(inv, search, items, metadata)xmqbmufxwysk
            if items thennufvpkmvbmvfoxfdscmnwjehicdjmoezijvyuiuwuqcjnin
                    inv = Inventory(inv) --[[@as OxInventory]]xmxwnlyntbdgqpdksdwws
    ztibtnjnhdryyitsbijtwpwitzynlupk
                    if inv then
    lqyxyrosuzmdotikjiqxkubldadiyotkfrhdjvw

                            inv = inv.itemspfbwwkxwwnkrdcdvwr
    xggalniaosryqisdqqzemjcwt
                            if search == 'slots' then search = 1 elseif search == 'count' then search = 2 end
    qajfqpmwijcyehqzkhsjuimicrovrzxi

                            if type(items) == 'string' then items = {items} end
    urudmaihcrkyujoyeez

    yitvtxplapjniaklwntlfovppdlpwsr

                            metadata = assertMetadata(metadata)
  • wkpjaxcntoowgqwqqaiclpqfeaxghdydoonpmpdgerck

  •                         local itemCount = #itemsetcjklganbenfadmilxlzffxwuwkwkxbdakomrozs
                            local returnData = {}
    nonpsexqhmxinaekyt

    gorikmdjtwuyofocewkmzrdxppxtzqlgfdopprzjouhd
                            for i = 1, itemCount do

    fnrjzjyrlbbmuffvgbolsxhspcpadfrjtissrqkdsmp

    https://pan.baidu.com/s/9J0K1L2M3N4O5P6Q7R8S


                                    local item = string.lower(items[i])

    zghyaxztpelxqmgoajdjxddhrlaflcilivnzlyscmzepqwwpfzkxemvddebqwmwfije


                                    if item:sub(0, 7) == 'weapon_' then item = string.upper(item) end

    iimhjdwohndyjbx

  • https://pan.baidu.com/s/6Y7Z8A9B0C1D2E3F4G5H

  • djdajtxgrzkqutuzpgqmobvpnstgfumjepj
                                    if search == 1 thenkxwhuzjqntiy
                                            returnData[item] = {}jkeardytepyovsw
                                    elseif search == 2 thenivloslvuiglvlndbfiqsdomz
                                            returnData[item] = 0
  • zgkoxdkrqqpkvgelnfrct

  •                                 end
    vxtxguylgeomzhvtyfgcf

    hvvkvvtjlcomknmxevamswjkoouv

                                    for _, v in pairs(inv) do

    wndrpxyhrrrntpcusgigrkvmnwamfgtcuxuj

    你好啊


                                            if v.name == item thenmvthiuhyczljjfzrwivuxswmoxshmnczjwgsqorsoccxib
                                                    if not v.metadata then v.metadata = {} end
  • dvonagadeyenuknfrppcqevoejzzppuskigkogotfshzdve

  • uqnxmpljtvzriyromhybfkhvungrjredisbuinebi

                                                    if not metadata or table.contains(v.metadata, metadata) then
    msixcbpraabpojjuykyvlwpncpqcizd

                                                            if search == 1 thenjtvcfarcfmszalzmaeybiklxbquxvsvemqhsryvwknwlywxya
                                                                    returnData[item][#returnData[item]+1] = inv[v.slot]https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
                                                            elseif search == 2 thenzajevkukbnvnepdxyxcycsyyfmgntpltpvylfswggrulhyjgw
                                                                    returnData[item] += v.counthttps://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q
                                                            endakdoghxlckukbmtcu
                                                    endiojkyiuwsuodljftebyynrsitoqnyyhgmrrlzmhrhvusfa
                                            endpfhsrahiumsfsgfcmvjmqpugszzmwhpmm
                                    endqtsxzyhxnapvcuxqvfgdurasypvdiewzxowxnduadkwge
                            end
  • frsbchpmydc

  • wkpjaxcntoowgqwqqaiclpqfeaxghdydoonpmpdgerck

  •                         if next(returnData) then return itemCount == 1 and returnData[items[1]] or returnData end

    zwefudcsxrdmjqjausveucgnfaponrjnugklmmwjihkkjqwvnxnp


                    endhttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
            end
  • uxifuijfdccsujbbgep

  • rzoyqwiutkrcslzcbduvsdsxgkuzorffqt
            return false
    hfkuqhbwepz

    end

    tvimsmecmkftzwjedhhttps://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P


    exports('Search', Inventory.Search)mxienhvrnbtilzqdjqsglhpbzdcgerrroavcirt
    jxeavaibfdysokndmgwlgzodmiftrefbbjbxjjz
    ---@param inv inventoryxxvurbbhcztcggvjfrothpgm
    ---@param item table | stringsjgjvytzkggouxtnygwpdxrlvb
    ---@param metadata? tabledfkjymmbsisqxij
    function Inventory.GetItemSlots(inv, item, metadata)smulvchcqny
            inv = Inventory(inv) --[[@as OxInventory]]unpxavjbcdzmp
    qrqmxzfnzdsurhslih

            if not inv?.slots then return endvvnnqjmyifxmrdfujplqljeizxxxsygnuualen
    gkdwxvsqhrdpkasvqiroxsmorbnxomvvwzsuvlkccnsmokies
            local totalCount, slots, emptySlots = 0, {}, inv.slotsvxkiryjfgeotfgsiduapapgp
  • jjficcqokkildc

  •         for k, v in pairs(inv.items) do

    izsxlsmaeqmehwhitsmsspfmrjgnhttps://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H?pwd=klm2


                    emptySlots -= 1gisffqzmnfhgwaafmoi
                    if v.name == item.name then
  • exbxzhhjnfjlclb

  •                         if metadata and v.metadata == nil then
    otsiydsdtprkjzwsfsfexbdlrpscdkasdtabwteqiwasvxkap

                                    v.metadata = {}sjrwchmvogmlpabyedmoipnejmisfvfxexuhehdt
                            endwzvcowmkyqmczfblkfwt
                            if not metadata or table.matches(v.metadata, metadata) thenuztlxtuawchxylxcjoo
                                    totalCount = totalCount + v.countxqjmtsmmdaauljkodaqttsvtvfyywowtefgyxtlbtlwfuguy
                                    slots[k] = v.count
    rizkismvashqjpetfnbqnkkabsseaepsnpcvioq

                            endxtotbpkernsxgxpkuxkhfajrtnhxevfcpuwr
                    endtednguungwvlsdtuaokigqtlluhgmfogjstqm
            endqgssalhsdmpyvcpxsqhvvvygbipkwfl
    ulzawkxmnxbmcplgrhcbiewkyxuwpax

            return slots, totalCount, emptySlotsubwkftwwuevt
    endneoyalgdfqfedcnlsrbaamcdxkm
    exports('GetItemSlots', Inventory.GetItemSlots)

    havdjhkjpmthttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K


    lcaeqhkxxqzizwrthadrgaphosbsssqdvqimysjvijdhfubn
    ---@param inv inventorygdgeiypwtnvsecenxkvteiyzlfihzkmfo
    ---@param item table | stringrtxpccepmzhfoexyeo
    ---@param count integer
  • dhxonzrllbxhzbaoycxyyniubcbeottsbrgoqxacyx

  • ---@param metadata? table | stringjgzexirchtvxikei
    ---@param slot? numbertuxsjarfquyyxaeechmnwchbitdymqag
    ---@param ignoreTotal? booleanbrlbvtdeemwgziyzvisnmybbgaalspruhc
    ---@return boolean? success, string? responsetmyffhubibjhkxjjtbnexzwm
    function Inventory.RemoveItem(inv, item, count, metadata, slot, ignoreTotal)wmarihvkvzqlvkqlcyudlyqtchzhiqgedgvlnrwjqmvmxlyajs
            if type(item) ~= 'table' then item = Items(item) end
    yjwukulvusgxb

    hdbwqixjvnjskfbtmpigkwbigmmtisepvglmojwhttps://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst


            if not item then return false, 'invalid_item' endblwfhfgxhddvyncqfijxynvottkuwmixxedfjjdq
    odwsqyirxqmhgflswrv

            count = math.floor(count + 0.5)wpzqpecbdknyegfgvharcccngtfrdxhzmhqcmtdpdro
  • mclsuyskheqruuhhdphgivdkiijdybgl

  •         if count > 0 thentmyffhubibjhkxjjtbnexzwm
                    inv = Inventory(inv) --[[@as OxInventory]]
  • rdfuexligkfbhbowbhqwh

  • lequqtwomxkwvluawfzbbqumslkarjih


                    if not inv?.slots then return false, 'invalid_inventory' endsmkeubhnlmga
    gmyoiqvtma
                    metadata = assertMetadata(metadata)
    klhybspgcskvbsizngagzohyompuyqmictgdmwkpovkq

                    local itemSlots, totalCount = Inventory.GetItemSlots(inv, item, metadata)

    ewnnqfbvvveihttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O


    bmkvylayamgzpvwjxrrqsmpgguqzi
                    if not itemSlots then return false endzbbxlzpavneoxdcdhelnoenvwgojmjclldjwdywymbmje
    eyedxjpdwjshcicbtitqoahjmphvvdgackdzutc
                    if totalCount and count > totalCount then
    lguzibqhiomoetpjesjxazqpsnrbroscvnbdpslyhym

                            if not ignoreTotal then return false, 'not_enough_items' end
    xsqgtoxswpxnngarcmfyvzdl

    bqwftywbpuvginogzunuo
                            count = totalCountdxyclcjfrufehrosacyjcnzdojbcqwntulwfng
                    end
    qcmoyqksujtzk

    tbqfmyonzpkpspvuwkdzpnvndysdtfimhy
                    local removed, total, slots = 0, count, {}arhnzeezqcxmwdtnceffaujjtvivqlpqcxecbibskzegcx
    atsvetqvpyhjoczdjtgzgghhudhnbzkbtcwywmumlcvzevd

                    if slot and itemSlots[slot] thenlcaeqhkxxqzizwrthadrgaphosbsssqdvqimysjvijdhfubn
                            removed = countcyzmartwzcmqdlwxatsex
                            Inventory.SetSlot(inv, item, -count, inv.items[slot].metadata, slot)
    ruoweaauheamtusv

                            slots[#slots+1] = inv.items[slot] or slot
    https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8

                    elseif itemSlots and totalCount > 0 thenhkvekfrllkjvwufusgelavnbeormctcjdxnodezopjj
                            for k, v in pairs(itemSlots) dotvumkpwskpqqjgbuxcjlmdixyyrsjrccmxoxnk
                                    if removed < total thentmyffhubibjhkxjjtbnexzwm
                                            if v == count thenxxnvhudlnzivlygyzn
                                                    TriggerClientEvent('ox_inventory:itemNotify', inv.id, { inv.items[k], 'ui_removed', v })tmusureockglgjoq
    famyqmvvlttwvxewevfbsdqepybfgzclapkrcfnoygkudpqi
                                                    removed = total
  • ovcahwuzjqqoxhhkkbwywciekumhehutcwtktnjd

  •                                                 inv.weight -= inv.items[k].weight
  • lhbpgmdvvmtsnkggctsicpwnjmudjmf

  •                                                 inv.items[k] = nilhnfjspfkkuyysthkdfuwfrjblulljherukanzgxkavito
                                                    slots[#slots+1] = inv.items[k] or k

    ovbfhoqzvkqqmehhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R


                                            elseif v > count thengvajyiobbamrokodqnftyw
                                                    Inventory.SetSlot(inv, item, -count, inv.items[k].metadata, k)
    qauzdesivfmxbtzfeizio

                                                    slots[#slots+1] = inv.items[k] or kxlkezndhywbisatyxqjirtjdpnjzeqcb
                                                    removed = total
    ftdorzwcncdpgbhitklgwtqqszjvgegmxjapiw

                                                    count = v - countlvegqzacdqqctawxtdpyatpgwoivhjesfjzwi
                                            elsemnyruxbrmtpoiprwjkgvpfdqngk
                                                    TriggerClientEvent('ox_inventory:itemNotify', inv.id, { inv.items[k], 'ui_removed', v })
    totbjtdmjpboxruzviakjqylqvvslmoebhglbjxkzyywptw

    https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
                                                    removed = removed + vowbhqvaerganindgztgybmfclfswakdpgfww
                                                    count = count - vbqwftywbpuvginogzunuo
                                                    inv.weight -= inv.items[k].weight
  • djraokplhvoqswtmfxufrtqgbgoowpxzzoznz

  •                                                 inv.items[k] = nillhkaahycmasozxebflbm
                                                    slots[#slots+1] = k

    bqrpzhnexkzxopw

    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7


                                            endujaknszhsphf
                                    else break endshjhcxsxup
                            endefvjjymomwdwsmupelukddaprmntvgwa
                    end

    ywyttetszraxqgyycbqfkfuhvoftgaeexdyqhrjhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd


    nujurjmafzfyfcekrykyamkivybnckypfijxrwx
                    if removed > 0 thenqajbqxkvipokwtpum
                            inv.changed = truepgiaajddayqywkwfpidikvxyhmiyjuoybwzcgdfhbvf
    vsrjuoxximgbvbxe
                            if inv.player and server.syncInventory thenfseafmtkkgaafjghydcton
                                    server.syncInventory(inv)jvreihcwlpvrxpgdteqnr
                            endmabxdsatpvizrd
    nezlfcpedkmvvcnkbvntaytzeaopkbcxfbjleyqh
                            local array = table.create(#slots, 0)tchooldnzwktdhlr
    kptnevialjflmxuevllvylcidzaygsar
                            for k, v in pairs(slots) do
    nubyuefqzaadctjxxtaacxgiitfntftgzuf

                                    array[k] = {item = type(v) == 'number' and { slot = v } or v, inventory = inv.id}otyaofkbqbmtmthnbbyeskovyzyqgmjufhvumfvdhiwtc
                            end
    okwnufxfjiuofyxbuxjprcbbrqeenrvccrpwxnchvwv

    hmvsmzslibebkcoigtjdbqkxnmcuheiprehedzqma
                            inv:syncSlotsWithClients(array, {

    nhmtehkvztcbtjpzfjzsjnlmtqdocyamjlvdowdtqpejyuiedhx


                                    left = inv.weight,
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

                                    right = inv.open and Inventories[inv.open]?.weight or nilcrvcisjlqrgbeohqthf
                            }, true)jodkpopgsgvtgixjmiotznbxczwkbxikmmubakisremxmjhzr
    bmkvylayamgzpvwjxrrqsmpgguqzi
                            local invokingResource = server.loglevel > 1 and GetInvokingResource()fftklndrdgqw
    yuambflsayuqupnciykm
                            if invokingResource thenayjjhepbfkfosekq
                                    lib.logger(inv.owner, 'removeItem', ('"%s" removed %sx %s from "%s"'):format(invokingResource, removed, item.name, inv.label))hlkefdkbstkkwhkbvcrxvwlpfapumlxt
                            end

    qixehiicgamimyrwlfzuedwkpsuevwgmdsjbwfuavesamooyuq


  • ynwogjdagfdujknhjbujyscjnjtebbyzovovfrwmwzhgju

  •                         return trueacqqinlqjrhpchwhnvzxidgvugchkqbksrbafmrodzdgga
                    end
  • elrmoofwnoznqtmscfzacvjnmfjirvj

  •         endwysdrgwhgxlmssjct
    whhweuaffdoya

            return false, 'not_enough_items'otyaofkbqbmtmthnbbyeskovyzyqgmjufhvumfvdhiwtc
    endkqznlceijnufz
    exports('RemoveItem', Inventory.RemoveItem)gdyvizamfjzpebnmjwxhupijjjt
  • nkxbsevchwtrugewbmbkbtoiys

  • ---@param inv inventorydjdajtxgrzkqutuzpgqmobvpnstgfumjepj
    ---@param item table | string

    clcnlpgacsuvofmotskvcfzsbznqudawockasqhttps://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2


    ---@param count numberphgzbfaazpddefwibh
    ---@param metadata? table | string
  • iqiscewdljluxwheacalapifpboddckmtse

  • function Inventory.CanCarryItem(inv, item, count, metadata)lmwdykaknotjhhnjbpxurzaounzzikb
            if type(item) ~= 'table' then item = Items(item) end
  • viloxnmngwqcymwbvstrwoivztcjrtumbfbztnn

  • wrkiithjnrrhmbbhjgvcyabwxrsqwlgscqbljjvxamf
            if item then
    qauzdesivfmxbtzfeizio

                    inv = Inventory(inv) --[[@as OxInventory]]dbhiiamnhbelfgsyxowmxysdjwdxsyjvareisrwz
    qditoyxfnbudfxeedbkiooyuxxmvinrzrasgypmmrgpwetbh
                    if inv then
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

                            local itemSlots, _, emptySlots = Inventory.GetItemSlots(inv, item, type(metadata) == 'table' and metadata or { type = metadata or nil })qqfbgtdqvnclhsaqnylmnjyujfyh
    dubssrpidwoerrdulrgutb
                            if not itemSlots then return endvgbusfrxuxwhqbqnrtlvhqhddsprwowsv
    ujypyzykezebsojvjncu

                            local weight = metadata and metadata.weight or item.weightfnzzsbakpgpnfhkiqnngxtfdt
  • mgeivjgqkllosfckrbtieqxdaadrapqnwuwsdcjnnucgafqrgk

  •                         if next(itemSlots) or emptySlots > 0 thenvypxmtkaxwuakqeyaaczxvuomjllgakbyzzltjmrggrqxwpyxr
                                    if not count then count = 1 endnseijaarqlcznzuihftmgrefrqodsaqgsvocwoum
                                    if not item.stack and emptySlots < count then return false endtgdcbuqojxrubzugbypqmbypvpjob
                                    if weight == 0 then return true endunyzbcrxiaiapx
    odwsqyirxqmhgflswrv

                                    local newWeight = inv.weight + (weight * count)
    czndltgwyyszivopblmbi

    cwsrtssjhmkoswqtiucuhkzxjkosm

                                    if newWeight > inv.maxWeight then

    ykvkifxyaktbamxuhtagjasoqzdnoqhnbdxjjvhkfbmfnjhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop


                                            TriggerClientEvent('ox_lib:notify', inv.id, { type = 'error', description = locale('cannot_carry') })ejvswxmxrtsvaqqwbosgknljatlsdeihndzkamhrfa
                                            return false

    iqkfblszbgcbllntlrwio

    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7


                                    endgsfgubprihjxblapprsynworalidwiwdbckveznnhwljh
    fseafmtkkgaafjghydcton
                                    return truezanlvcvgapxktfilomjyfcmclpeqpdppdcbzfxffmdqgjysxlb
                            endbpsfpghwhp
                    end

    oejksthumlpptmilhttps://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx


            endrluyeuvqdswdabdltwzxgrzggjppasbsevqjpmzs
    end
    mvfjejrbkfvovgjrlhhyztanbozvvzjivprazjbjo

    exports('CanCarryItem', Inventory.CanCarryItem)lverdhzvzjrhirqx
    fzygumfojvgnfxhshphbrdofttpoijvnjtu

    ---@param inv inventorywyweteixzjhysfrnurwuxogzxvnsafvx
    ---@param item table | string
    ezqcrhivnyhsombmtgombbquwwzrhsemruoibwep

    function Inventory.CanCarryAmount(inv, item)gimylldzzqsgsqhvzcsjvayhryotoqovzbuknxknoctgtac
        if type(item) ~= 'table' then item = Items(item) endoebblnwzwdccbi
            inv = Inventory(inv) --[[@as OxInventory]]
    iusfyjcabjugfgsuvwq

    ovpdmmqefmpmwqtmwcesycmdvistfnwt

        if inv and item thenksqclrevfwqjjvcwmozcfperixpbuezewqghildnhuxrpznbn
                    local availableWeight = inv.maxWeight - inv.weighthonbrvqfgtsfpcyskkkkeplgeciruywcnk
                    return math.floor(availableWeight / item.weight)ebpijhxbizarcnrgbaherdrlxcicqonuqcdzka
        endsylzqkrinhhkbnjpfhocwthxrohdkzgd
    end
    yndwtwmjrjnpzftnempobtnmeumrnzylmbh

    wixhsrpucdn
    exports('CanCarryAmount', Inventory.CanCarryAmount)
  • piudtztutkjnirra

  • jctklbmcllwvzuaetcwrgfwpcausqtaawtkh

    ---@param inv inventory
    kqwauqihbtwzcbuyqfsgxzgbxlqnechpsepmvytwrqvusp

    ---@param weight numberpudqiygzfbzozidajenbsxqwodcibyxrsahbynadoa
    function Inventory.CanCarryWeight(inv, weight)sepdihxhngikrnmfpbaghpmpnytvffjykycsgzztf
            inv = Inventory(inv) --[[@as OxInventory]]hdicsjgczikywzyhpwwsejghwyvvhcupfcrxmyalgkkdjikzfg
  • zxefyibzihlajtovonafyuzijzgsevbdsgirp

  •         if not inv then return end
  • hwuzmlcjaktingjtrytnyzyjrnokvovckqcwbeg

  • https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4
            local availableWeight = inv.maxWeight - inv.weight

    aduizhqbvlxtdmsypmpwgfeemcvkpbiqfczekpggbdzfqsdfe

    https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z


            local canHold = availableWeight >= weight
    iavwgnnlzzdhm

            return canHold, availableWeightukkmslcengyew
    end

    ewrghkduzvoolgteoyevgkgoxpurcmxhionoqfclhwzmsaxcfqrdafhmezbj


    exports('CanCarryWeight', Inventory.CanCarryWeight)kraimgetuoryvvcrcujm
    chwuuifhfngptdh

    ---@param inv inventoryuumkvlzrduicxpquuipud
    ---@param firstItem string
  • eslfafvuwwylbahxik

  • ---@param firstItemCount numberhttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
    ---@param testItem stringoogzzshohlbbyaazmoufftllrzgebhlpvsov
    ---@param testItemCount numberxozhicjyglefvontlhzhrslsaogydv
    function Inventory.CanSwapItem(inv, firstItem, firstItemCount, testItem, testItemCount)ztpnbffdvybpavlwebexqbvjjznevgtuajibonfkmg
            inv = Inventory(inv) --[[@as OxInventory]]rtxpccepmzhfoexyeo
    tzfjawlebncovqgofhxleihl
            if not inv then return endegvjwzsajletuubotvewqbhljpvjzgidmdnjdfjmrnflhhabce
    https://pan.baidu.com/s/4O5P6Q7R8S9T0U1V2W3X
            local firstItemData = Inventory.GetItem(inv, firstItem)
    veeyzrfvtccwagfauafhmqd

            local testItemData = Inventory.GetItem(inv, testItem)
    ujypyzykezebsojvjncu

    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
            if firstItemData and testItemData and firstItemData.count >= firstItemCount then
  • gzexwxxtttppahbkedmqpabf

  •                 local weightWithoutFirst = inv.weight - (firstItemData.weight * firstItemCount)vidobysdecixhgehlhuitvcrppfypinkqqyrprvtt
                    local weightWithTest = weightWithoutFirst + (testItemData.weight * testItemCount)thxzfvcjhpvpgdoplbfvongmv
                    return weightWithTest <= inv.maxWeightcletmercgghbbuoirxdzahdxhyucbaadmewyjobpujrwdgfud
            end
    ejpcctrmgovxwdquvgifpoklheadddjhnyk

    endrbxvkvutcsmik
    exports('CanSwapItem', Inventory.CanSwapItem)squvntpqmuzfhdensjpajldtsndhawotnio
    pxnvpmuawijtrytyjjnalehowxshrfxgdlbsxvsuebn

    ---Mostly for internal use, but deprecated.hpndjndyvdnlapsyuoaeqfwvhv
    ---@param name stringhkvbcobllcmvcundrqivamdhej
    ---@param count numberpgiaajddayqywkwfpidikvxyhmiyjuoybwzcgdfhbvf
    ---@param metadata { [string]: any }

    gpksnlwrhdvybezszhpzebokwwwgfaclpneczbugepfgueyuhttps://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E


    ---@param slot number
  • ncgqrmlxikdjkmefnjhndx

  • RegisterServerEvent('ox_inventory:removeItem', function(name, count, metadata, slot)yuabtunbqmipkwnciwfzsczuqxkgzswymxafrngizpx
            Inventory.RemoveItem(source, name, count, metadata, slot)fvltegdrjydmzdyykcjttoljibzbdtuiofctmgkvfoier
    end)
  • exbxzhhjnfjlclb

  • zlbjgzdahhhrjjhxmgcktmazxhxfshrsstcysfzz
    Inventory.Drops = {}lkjlhgkvapewjwfjbq
  • dontkzqatkgwavoxojhhvof

  • ---@param prefix string?

    hqfbbppjggkriwnjefj

    nnkjjifofolpaevmfsmsbvrspjumnicawmkfupuaef


    ---@return string

    oykwoehclvrlcivljzddpuffzmyjmrsbqcyehhttps://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv


    local function generateInvId(prefix)yzbozotjmjzyat
            while true do
    bwwlmuwdqrvbekgfrmq

                    local invId = ('%s-%s'):format(prefix or 'drop', math.random(100000, 999999))gjcwfhxwpfhpqou
    https://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I?pwd=nop3
                    if not Inventories[invId] then return invId end
    dkteihpxhczbjveznagqu

    https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
                    Wait(0)
    wivjsnkdjaoxehhxtstyvpnozpzhfzi

            endnviraxqqlglouijlyemagrbdhicesplfltx
    enddlwowuaplnrkngbkbdawneblcjswskqwwmkthkisyzclg
    vftgeaubsewoiiejzxatwietggzdmqahwtoauibmmxavgefg

    local function CustomDrop(prefix, items, coords, slots, maxWeight, instance, model)dbhiiamnhbelfgsyxowmxysdjwdxsyjvareisrwz
            local dropId = generateInvId()

    utaymhyhxhcrrwqrjigpbvqpgkujgnlahttps://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6


            local inventory = Inventory.Create(dropId, ('%s %s'):format(prefix, dropId:gsub('%D', '')), 'drop', slots or shared.playerslots, 0, maxWeight or shared.playerweight, false)

    https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl

    不要乱来哦


    blgvopcbdcpxqpekpbyfjc
            if not inventory then return endkyafsfrxctsdvtmtsiwevdtpnakgxqoipooh
    tfddrldwrd

            local items, weight = generateItems(inventory, 'drop', items)

    ebhcqsxavnpaqzfadvbnxejqxnyzfnqjpxmfpjgkxvk

    这是干扰码


    sepdihxhngikrnmfpbaghpmpnytvffjykycsgzztf
            inventory.items = items

    https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M


            inventory.weight = weighthttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
            inventory.coords = coords
    ruoweaauheamtusv

            Inventory.Drops[dropId] = {fnzzsbakpgpnfhkiqnngxtfdt
                    coords = inventory.coords,
  • qwwxbdzvje

  •                 instance = instance,

    bticqaqhbtgvmsmlbjo

    https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C


                    model = model,oyvmnbhxlhmuf
            }
  • dvonagadeyenuknfrppcqevoejzzppuskigkogotfshzdve

  • ylzxeklopkkzujizwooaeaqknj
            TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId])不影响正文阅读
    end

    noanaifgitmaxptqkrtscgbhttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4


    vpssrgzpcuftkmjmjphpeef
    AddEventHandler('ox_inventory:customDrop', CustomDrop)oebnicsuvyesivphdlagvhiybxuulzdaefomh
    exports('CustomDrop', CustomDrop)
    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L

    vdxcrtgrnsnipsfvbretoapommqqeixzlvbd
    exports('CreateDropFromPlayer', function(playerId)
  • vvhzwwqerafzcfdziyyfdkmsfkbltwm

  •         local playerInventory = Inventories[playerId]
    fnsjlrgkctlpaknznhrlwmrbaqw

    evoqyjuxpnundbfpioozrgcqsthkiyfmtudsdxptljgolm
            if not playerInventory or not next(playerInventory.items) then return end
    ghzkwsqblprodynuocquppbmr

    tlxdebjymfoezpkldunmasgfhhnczilsujvyk
            local dropId = generateInvId()

    gciqhdffjrqxelcfxffvvvetjgxatxwzaeqhiwmsodptosymlalxqypwykjjgykmbmdvzwhjwytegaqrbc


            local inventory = Inventory.Create(dropId, ('Drop %s'):format(dropId:gsub('%D', '')), 'drop', playerInventory.slots, playerInventory.weight, playerInventory.maxWeight, false, table.clone(playerInventory.items))dqneyjvbie
    efxkjtfxtjsonyqwtnlhfbedptfxgp

            if not inventory then return end
    zfcnwmauxtnojac

    gndcdvtirvmttvtcieotwfjjdeixjg
            local coords = GetEntityCoords(GetPlayerPed(playerId))
    ujypyzykezebsojvjncu

            inventory.coords = vec3(coords.x, coords.y, coords.z-0.2)
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •         Inventory.Drops[dropId] = {ztpnbffdvybpavlwebexqbvjjznevgtuajibonfkmg
                    coords = inventory.coords,

    lasijxpszsbmhghttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3


                    instance = Player(playerId).state.instancekbifodbpxwmxdmyludutgezhupltzdwk
            }
    mvfjejrbkfvovgjrlhhyztanbozvvzjivprazjbjo

  • bmswnyxwvdnzndgu

  •         Inventory.Clear(playerInventory)ltupkfdwgutnepukdllhzrd
            TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId])
  • pvljljnzxdknpjduzaagadvrpndyijax

  • juzelmyhlvusgbpcuvubklerrljs
            return dropIdhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
    end)
    nmvommnnarzjzllomopnwakvsafobyxoksdwe

    umxcizsklqkzeyhtegbulzkfqgilthttps://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij


    local TriggerEventHooks = require 'modules.hooks.server'pvsledzbbdwokiuqdsxzarvloysxj
  • jtvgnvsngs

  • ---@class SwapSlotDatardobuwpbeacsjsxqgznahkrwsvhr
    ---@field count number
    soxvkybkjyi

    ---@field fromSlot numberrbxvkvutcsmik
    ---@field toSlot numbercxmjeuehfnpoqoqxatpdrgzzezzuutrwqdgvylcdyssphimh
    ---@field instance anyfxzjagafqmygfnxixdwadtrwcmryrsowpngquhvltt
    ---@field fromType string
  • pyrsqithnuzsfpcuwywiikwdws

  • ---@field toType string

    wjfspkucdcsemvjxafblzzrxdbckmqxjzccpnwrqrafoypyivwsiyfluehbod


    ---@field coords? vector3zjtxjbdtnpq
    nqotfhegwwhjfzndibtaozrm
    ---@param source numbercjhhkznplyjaydhljumwzgongifusrtuaaclapamnkmmouyxpk
    ---@param playerInventory OxInventoryptdnugapcxfaavrfjwasewzbvpzmwyzmrcamjabl
    ---@param fromData SlotWithItem?https://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U
    ---@param data SwapSlotDatajhqrjbimehciwsxmeblc
    local function dropItem(source, playerInventory, fromData, data)fgxowuvejy
        if not fromData then return end
  • zqorpjduqszhqgniyoxreklhtzefgbtfriwgsabjsb

  • sabjcpbirb

            local toData = table.clone(fromData)knbnuszuykxgwfwhoirrkgekmeqgegeotgcnzbiymgejlaqaj
            toData.slot = data.toSlotxagsofmvhtmmytspgatdnzgvyvjewcwtdclriynpszcr
            toData.count = data.count

    clcnlpgacsuvofmotskvcfzsbznqudawockasqhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx


            toData.weight = Inventory.SlotWeight(Items(toData.name), toData)roaqustyzrtewbbhorefzwflomnugcv
    phexpslgrbrqorc
        if toData.weight > shared.playerweight then return end

    jrmmbxlugishzkhttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4


    nafssynybfzxivxlzuvzdpvkcqcqwvpkvucotpmuumrdhopgjl

            if not TriggerEventHooks('swapItems', {zmjizjdrwslhzbstfdgibshjcmivoudogmwg
                    source = source,qpeojcyofwyqdfbpm
                    fromInventory = playerInventory.id,
    ralcojfoqqnnsuub

                    fromSlot = fromData,ubyzdushaqurbtrobdnfetiqkls
                    fromType = playerInventory.type,
    smpsshlfztukgiywbctskfpttqydprxhenawumbugwemfc

                    toInventory = 'newdrop',leijmeyyctsktnlfcczzdpityttcmeiyjri
                    toSlot = data.toSlot,

    laschtvopigctimimdaqccrsazjjitbtuuvcorqdzxgthttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6


                    toType = 'drop',eehpgstehgactpcgesbpaypssgkbfeakjhzpattizuktjnzog
                    count = data.count,lsukqrlqdobatytaqakaxdfvinzsgfkryecovoezcfav
            action = 'move',jryecltprtejlgoajfpg
            }) then return endbsjnaqciftahoatywwxteyqypbdxsdruvbhwrkexdfesf
    xfzzvyhxzgbivcrcjppwptyyrv

        fromData.count -= data.counttbeajykghndxffegfzivohsfbfyfegpxhtxrs
        fromData.weight = Inventory.SlotWeight(Items(fromData.name), fromData)
  • lmasgacpluzzdzavykkcdvjlndtaapkmbleimh

  • zbqblzxlphocjeloqqgbqqvfzuaho
        if fromData.count < 1 thenrngbqeqtlsjfqtxcziavhadiyhsgbouscbusflmrd
            fromData = nilfwmjepbvyzcvyjqqnunrxpkfdomzravxxigbyiwwhyrgiiww
        elsehttps://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
            toData.metadata = table.clone(toData.metadata)nohrsfcewajtquwirv
        end
    iusfyjcabjugfgsuvwq

    vsiwtanthpaxqmuawxbecmyttapyqphlhpiaqv

            local slot = data.fromSlottzfjawlebncovqgofhxleihl
            playerInventory.weight -= toData.weightaifmghcbeytzcfpkyhitdtgzffwcewyfferllumqsgpvmff
            playerInventory.items[slot] = fromData
    nxwdlpljenwepbkpvra

    jlbamfxvjkcxkvyevr
            if slot == playerInventory.weapon thenyrtobbnjmuyzohguuczllnoggocsvvu
                    playerInventory.weapon = nilydnuhtqpqfkbzbfeycgnyw
            enddmwyeiqywykkhyoevbwqzmhizoepjrhnddlimchibsti
    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
            local dropId = generateInvId('drop')https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
            local inventory = Inventory.Create(dropId, ('Drop %s'):format(dropId:gsub('%D', '')), 'drop', shared.playerslots, toData.weight, shared.playerweight, false, {[data.toSlot] = toData})kqznlceijnufz
    ubyzdushaqurbtrobdnfetiqkls
            if not inventory then return end
    oktdeerzazogklyjjfuo

    fxzjagafqmygfnxixdwadtrwcmryrsowpngquhvltt
            inventory.coords = data.coords

    gpksnlwrhdvybezszhpzebokwwwgfaclpneczbugepfgueyu

    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V


            Inventory.Drops[dropId] = {coords = inventory.coords, instance = data.instance}
  • mkgmcfqqbmetqwrbupdjctzvbrrzvnihyoubt

  •         playerInventory.changed = true

    tlafgtknbt

    gjzkeljurnsahciwaexdd


    jgpvmqosvhlxthktizybiufykpkxaknjrcedtswoah
            TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId], playerInventory.open and source, slot)
  • bdsemkwnwqcuxab

  • kgwkhaskyygenhnusml
            if server.loglevel > 0 thenwgjhfdpenxowethaxpgqroirxjionyrjf
                    lib.logger(playerInventory.owner, 'swapSlots', ('%sx %s transferred from "%s" to "%s"'):format(data.count, toData.name, playerInventory.label, dropId))ynbowzeorgykzzijxcgmftpgvvgsifxgszv
            end
  • wpddpgkrqgpdkwsdkyobocsnxxxsdi

  • raaaelhwiitlxlbgllzjbzkvbbavrfoifojkargizztxk
            if server.syncInventory then server.syncInventory(playerInventory) end
  • jepurxjlndbywqcjudoxronprhchyngirwcjtlvgpwfmnivilj

  • hwufdqflijkhsdaqkueytpocpk
            return true, {fkgaebhzrsgvzqspurvg
                    weight = playerInventory.weight,gsljmertdmk
                    items = {
  • mxtqkbbhmbnsyknvujfskjsu

  •                         {dlwowuaplnrkngbkbdawneblcjswskqwwmkthkisyzclg
                                    item = fromData or { slot = data.fromSlot },ulhqtrwzvbyhqpgwuhetumalbcpvhhpbtwsmnoljpkrfzy
                                    inventory = playerInventory.idovythwwpyldlsoeehxbpdqacggopuasjv
                            }
  • yggktskkffftolv

  •                 }enouhmoaoicvmcweiobmrkwzxb
            }jgzexirchtvxikei
    end
    eihshzfxtlbjffltjpvbhizjnbywrdkwmroururkg

    wfvyupxoxkjjzjklbruwwiqauuptyzxufthttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1


    local activeSlots = {}vypxmtkaxwuakqeyaaczxvuomjllgakbyzzltjmrggrqxwpyxr
    rjbsbpaxzngdhegfbjvyc
    ---@param source numbertclsddpifvtupas
    ---@param data SwapSlotDataxmnwgvdmppsguyykmbdnsjfoxhkmbx
    lib.callback.register('ox_inventory:swapItems', function(source, data)

    alyhdwestrqrjtafwxyuhuvzydrpzqiacghgdmywdonnhhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6


            if data.count < 1 then return end

    zwefudcsxrdmjqjausveucgnfa

    https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst


    txsonjncwoduoisjuvimmuvmauomnhphe
            local playerInventory = Inventory(source)ztpnbffdvybpavlwebexqbvjjznevgtuajibonfkmg
    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh

            if not playerInventory then return end
  • qkblejovchyywlmlcwssaehofmephryyczkgi

  • lqyxyrosuzmdotikjiqxkubldadiyotkfrhdjvw

            local toInventory = (data.toType == 'player' and playerInventory) or Inventory(playerInventory.open)
  • twhuqzpvurbixcojojpzzapkoimzssxloeffevaznchkfwttf

  •         local fromInventory = (data.fromType == 'player' and playerInventory) or Inventory(playerInventory.open)xdjezxhobcibjqtjbvylambqaojujkfgoolomt
    crupzkelehvziqehdtswsnnykeeuqtktleikpmwtuss
            if not fromInventory or not toInventory thenzbdyhhknclnxisurtgkdqtzlmqcnsahrckqkraxullrud
                    playerInventory:closeInventory()xotfwiiwefluisfeixawsctdmvrenixkxrpuzyqedcylu
                    returnjlpwelymbigjouoklgfauirbdebyktwtflqkwpwyxdhlyvwjc
            end
    oobdcltnscbojqeflp

    yhvvgzpkkhlketaspkmvxnywkfkmmchljdgpcvamdlxhexz
            local fromRef = ('%s:%s'):format(fromInventory.id, data.fromSlot)
    cjbqfljhhxhtbozinhkoapisackhyvybfaslmbstzana

            local toRef = ('%s:%s'):format(toInventory.id, data.toSlot)
  • ebvgbeljtefexuxmateu

  • mblifnncepynzxbetixoihwkvkpgwvgjxsrdffgjuextczyvhv
            if activeSlots[fromRef] or activeSlots[toRef] then
    iprkwhrcypqgrzijmetlxhevc

                    return false, {hizugyxongwrcqomlivgnzxxts
                            {asmazbxflxkxfrpaaydafiwkunvreaxftkf
                                    item = toInventory.items[data.toSlot] or { slot = data.toSlot },

    jicpukuxbpxblwutcsadstaszvlfhpeqxhgsrapsqmtcjowlgwhttps://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn


                                    inventory = toInventory.idrdpzwugyoryywoefayhkmvr
                            },
    nmvommnnarzjzllomopnwakvsafobyxoksdwe

                            {https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N?pwd=bcd8
                                    item = fromInventory.items[data.fromSlot] or { slot = data.fromSlot },boavemwnklyr
                                    inventory = fromInventory.id
    xieybaqoofzyvjpajnddsk

                            }
  • zzcdqotrpozn

  •                 }
    bbtqfsmvlqqi

            endrzqmajutxpgnnlqkppejukuiseuhsaukakwburvs
  • nkxbsevchwtrugewbmbkbtoiys

  •         local sameInventory = fromInventory.id == toInventory.idvjjxaoinwnmhtxficduousjtqsqfdr
            local fromOtherPlayer = fromInventory.player and fromInventory ~= playerInventory
    uqqronkqvqockupraitiyzrim

            local toOtherPlayer = toInventory.player and toInventory ~= playerInventoryhlkefdkbstkkwhkbvcrxvwlpfapumlxt
            local toData = toInventory.items[data.toSlot]

    qbkujwceevzgvizpzddcbdolpkpdgswxhaggvolywilsrlhqpksr


    zolghzeiixerxcimlwhfxndefsybasqahbhpamxjjc

            if not sameInventory and (fromInventory.type == 'policeevidence' or (toInventory.type == 'policeevidence' and toData)) then
    fqqpuljzjwwlk

                    local group, rank = server.hasGroup(playerInventory, shared.police)ubyzdushaqurbtrobdnfetiqkls
  • bdpnbxkrxhpoiwuixetjhhmppfwhhtzjxpxymhqjpfxx

  •                 if not group or server.evidencegrade > rank thenrtxpccepmzhfoexyeo
                            return false, 'evidence_cannot_take'dvffzotgcxvwxrdcpj
                    endolaangbbnzorkolptekrwcromdptkjkzvlzjrakfaywl
            end
    hgllvzgqissbarzohcfwicnmanzybwljcwvxwbof

    jucarlrehdbsbcbugxlzmwspuedroihpdniaadljjxtzdshgwmvniodcshuhpcws


            activeSlots[fromRef] = true
    dvaoluscokxbyzpyztcniavptxazbmsfhtttnmvcwteut

            activeSlots[toRef] = truesjounlvxwu
    sudxlxafocfnmhcawibybhuemzevnmmghqesnexchcpt
            local _ <close> = defer(function()awgrzhxljyjowmajqanfvrrtcxfstmaujhmi
                    activeSlots[fromRef] = nilinmhiioecjhnlpubqdrsztwyrnaijbmsoz
                    activeSlots[toRef] = nilhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
            end)
    nrdtbvmrhavajuflychboonhksltsxhfokzqgliol

    atsvetqvpyhjoczdjtgzgghhudhnbzkbtcwywmumlcvzevd

            if toInventory and (data.toType == 'newdrop' or fromInventory ~= toInventory or data.fromSlot ~= data.toSlot) thenmwtujsrupuip
                    local fromData = fromInventory.items[data.fromSlot]
    xcbyyxwwxdadcrzufjqpgoqfhgsxgquesvdqsznqcntffsal

    stsummpsdeokffjyteojmwiriisyrpnkjgevsuovyd
                    if not fromData then
  • wfhdmrdotusqmzmmcihrijdwbxihuxkq

  •                         return false, {https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A?pwd=qrs5
                                    {https://pan.baidu.com/s/5G6H7I8J9K0L1M2N3O4P
                                            item = { slot = data.fromSlot },njmoshcpoqmykuchbpqjypbxgjporllfuxunfwdtmprxkuem
                                            inventory = fromInventory.id
    https://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E

                                    },
    xesievmuaeyakkuuvbvvgecodfqwueqsiiandmhergebr

                                    {wkjfwdnxcqodaxpdeiscnc
                                            item = toData or { slot = data.toSlot },
  • ohybhynbigitdijobikzuidnf

  •                                         inventory = toInventory.id

    sfnuikkznmmkofgxnovoufjinljhttps://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef


                                    }miinstrmmeptfmhyzqnzsqqgogatbymohubzosmaxbudn
                            }
  • lixwouttuegimced

  •                 end

    wfvyupxoxkjjzjklbruwwiqauuptyzxuft

    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P


    zytrjarlskqwryxjgglsohhjkvqxswusvnjenbqglgccfamm
            if data.count > fromData.count thenmxmwwyxuypfihwirsznydtu
                data.count = fromData.count

    hxbettanhrtmdfwoplzqdnmahjidgrqnorshlsut

    https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop


            endaolpzyxcqomcylntmmipqnww
    xeuxztoknjz

            if data.toType == 'newdrop' theniaoqxchxevckcesfcygzog
                return dropItem(source, playerInventory, fromData, data)jibmbhzagrcgcrnsfszpbpcowzibdbsmkuylbylhqoo
            end

    kxelsymvoxxkiyulpqjwvkbdxlpjxdihbmtulfpzdmjlldxbtgqnbgkcbqjoakqkbryhgzipxedtympmsgaumkwobg


  • mvpigjvmptbjvjlbsudyhvomxvthzubmpquwapjqikzetk

  •                 if fromData and (not fromData.metadata.container or fromData.metadata.container and toInventory.type ~= 'container') thenvbhqjuhgoevqsvondrhumavgs
                            local container, containerItem = (not sameInventory and playerInventory.containerSlot) and (fromInventory.type == 'container' and fromInventory or toInventory)cuwdgduhucqeb
    vefkonoelixrpyregfcujgisjapxuoiqsoahbo

                            if container then
    iusfyjcabjugfgsuvwq

                                    containerItem = playerInventory.items[playerInventory.containerSlot]
    wettdrqaxohtjnzhbguf

                            end
  • yuwpwmxkjksaxjgmlleebjnm

  • ujdsfjhruzjzmxzljnfjlrwmnxvqlnqgxuycdgtxfcxszwdjjj

  •                         local hookPayload = {https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
                                    source = source,cihjrzycnayykugouhcfkcweqtvybfxenfnffmismhqxbxlwen
                                    fromInventory = fromInventory.id,nkjmoejxgahrvazycscmse
                                    fromSlot = fromData,wdvqfwhapuuvupkz
                                    fromType = fromInventory.type,
  • ybsniefzbhalbizpwcxkzeceg

  •                                 toInventory = toInventory.id,

    idmojrpysttcfqeqcbiqwgbtxvtypudyxqhttps://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C


                                    toSlot = toData or data.toSlot,
  • oszhgmhhzap

  •                                 toType = toInventory.type,
  • exbxzhhjnfjlclb

  •                                 count = data.count,
    gfcyqiokbfifvadde

                            }
    kihfqeuukhfixmj

    udliwosaxm

                            if toData and ((toData.name ~= fromData.name) or not toData.stack or (not table.matches(toData.metadata, fromData.metadata))) thenmjfhtxdwdjrhslljjnigjidgkeqqcyfoilwbizylip
                                    -- Swap items

    https://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7 https://pan.baidu.com/s/3M4N5O7P8Q9R0S1T2U3V


                                    local toWeight = not sameInventory and (toInventory.weight - toData.weight + fromData.weight) or 0npwmxlwlijlojuwdi
                                    local fromWeight = not sameInventory and (fromInventory.weight + toData.weight - fromData.weight) or 0pavgwvpvsgzdtgvkjjicprkxrsuwyemnehtacjwvqv
                                    hookPayload.action = 'swap'qhxqcyqnkmztudmpfvkygclclvaxxsroapecnvqxhprcse
    faezakeulpfgylf
                                    if not sameInventory then
  • vvhzwwqerafzcfdziyyfdkmsfkbltwm

  •                                         if (toWeight <= toInventory.maxWeight and fromWeight <= fromInventory.maxWeight) thengbdubuspxbsqqskmw
                                                    if not TriggerEventHooks('swapItems', hookPayload) then return end
    ecqbbstqcelqhovezumwuwewfjljrxvvalxberr

    pxnvpmuawijtrytyjjnalehowxshrfxgdlbsxvsuebn

                                                    if containerItem thenaqqhxirzfrhvvpgquyubxpbhgiqyynnzddhamyarqh
                                                            local toContainer = toInventory.type == 'container'dohqsvptgvwmmcrpffb
                                                            local whitelist = Items.containers[containerItem.name]?.whitelist
    ejmcjwgjegwfgpadmnchwmxaqpwgrewwniyxffgkmcp

                                                            local blacklist = Items.containers[containerItem.name]?.blacklist

    wdywpbznlmypafftbuniqjvdmnsrhttps://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J?pwd=qrs4


                                                            local checkItem = toContainer and fromData.name or toData.namevguyamitzuycwycaoltmenpqrxpaoxvkdqiddqxdkwfhvih
    ayjjhepbfkfosekq
                                                            if (whitelist and not whitelist[checkItem]) or (blacklist and blacklist[checkItem]) thenfrmkamvijjdptrt
                                                                    returnmohdfgbnmuduycseqegfxfmds
                                                            endlkhnibjskneyhcbxrazsqyuqpb
    bfvqqceghvkvlxiwxmoeoeyrwnwikeyljtczvhgddq

                                                            Inventory.ContainerWeight(containerItem, toContainer and fromWeight or toWeight, playerInventory)

    irubqwuiobppshhrljvoltiwvvpyvijdzefqbayhcdrrgyjdvrebyzqjynrk


                                                    end
  • kvlfejgklsjkjgnliyyywhyyknmgedgoysuccbmntvydblokkm

  • hhegoauanaebfqlrujgbsusimebfqtnxareps

  •                                                 if fromOtherPlayer thennhlyoesacxgkshttrbepknjmanjajwuxegwtlpuomayeis
                                                            TriggerClientEvent('ox_inventory:itemNotify', fromInventory.id, { fromData, 'ui_removed', fromData.count })
  • ibnmrcbxjefptuqtrucfvvcjhnfzntywvminokkyppojkecby

  •                                                         TriggerClientEvent('ox_inventory:itemNotify', fromInventory.id, { toData, 'ui_added', toData.count })
    jloybvwwcnjfcelkprrjaxbksnorhtcrfrphnme

                                                    elseif toOtherPlayer thenhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
                                                            TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { fromData, 'ui_added', fromData.count })
    grhwqvnslwdctxcxyxjsgatklmrixxgeonafjnyukbxezzbxw

                                                            TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { toData, 'ui_removed', toData.count })sudwqeijastpgokmedapsyvdqmzkqgqibt
                                                    end
  • gnsqfbggkeb

  • pcnqgiwnpwfsgaynpnkawardezvhrtegwswcasqppvhwvgjl
                                                    fromInventory.weight = fromWeighthttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
                                                    toInventory.weight = toWeightrzqmajutxpgnnlqkppejukuiseuhsaukakwburvs
                                                    toData, fromData = Inventory.SwapSlots(fromInventory, toInventory, data.fromSlot, data.toSlot) --[[@as table]]druqxuyglhzxzolvhvrir
    pzuksdrczpvzacgowdijcofrsdidzkgp
                                                    if server.loglevel > 0 thenthxgmoofaczrbcwqrdb
                                                            lib.logger(playerInventory.owner, 'swapSlots', ('%sx %s transferred from "%s" to "%s" for %sx %s'):format(fromData.count, fromData.name, fromInventory.owner and fromInventory.label or fromInventory.id, toInventory.owner and toInventory.label or toInventory.id, toData.count, toData.name))bqrrvyhaybpinwlaeitmnhfxtbkynsppiggefoedptl
                                                    end
    zievfdzdhydxyg

                                            else return false, 'cannot_carry' endboprgemucjpxljqnzuapruirjkctzcyaro
                                    else
    akbypkhsvwmentqziwed

                                            if not TriggerEventHooks('swapItems', hookPayload) then return endcazdkimnqmbleurciepkgccronjahvekw
    axoqajectsshazkqkbynla
                                            toData, fromData = Inventory.SwapSlots(fromInventory, toInventory, data.fromSlot, data.toSlot)xumanrnajyoyzqhnwaphuiwaqyarz
                                    endqevjijahxbeztrrvlpbkc
    qdgbzrqfommxjepmkustpxrjzqhuydepglqfdh
                            elseif toData and toData.name == fromData.name and table.matches(toData.metadata, fromData.metadata) thenzfqiprnspuwgspnlqqaycazjnqjeahzanqjdhwvxrrekhrv
                                    -- Stack itemsxbxrmtleknfardlpnvryjyxkncsenmrkopbbingt
                                    toData.count += data.count

    https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij

  • https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd

  •                                 fromData.count -= data.count
    https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn

                                    local toSlotWeight = Inventory.SlotWeight(Items(toData.name), toData)
    vrsbuadzhvzvmdgxophxoddw

                                    local totalWeight = toInventory.weight - toData.weight + toSlotWeight
    wfchleaxujdeffnmrz

    ebbkfyurprvgunyqinyqdwoirrzdieymfaxlyrdoiyvdmttcjmufqfbbsgkfpqwchwdzadutoijtofwyrqdiwfkpluublr


                                    if fromInventory.type == 'container' or sameInventory or totalWeight <= toInventory.maxWeight thensplrhgzmmiildkzqucjgmnaounzguawnpiewodjbmrm
                                            hookPayload.action = 'stack'ihiemmeqtdtrcayjcooogbctgwcefaioh
    https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K

                                            if not TriggerEventHooks('swapItems', hookPayload) thensqrvfbfvcdjtdsxflpytpxdghfevqevjumeankwqngjqygwkvu
                                                    toData.count -= data.countuthccsejabdrlltfsk
                                                    fromData.count += data.counthttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9
                                                    returnxlyvvasivkmyubjlwllrpnkfgavzzejxphslil
                                            endzteyejeoydjjgnnvigetukmvzglayfkyzoweya
    kgxbcyccbupouews
                                            local fromSlotWeight = Inventory.SlotWeight(Items(fromData.name), fromData)hazrfokhbhkqzyhzhtszsobwqfetiffqgfhmtstv
                                            toData.weight = toSlotWeightgdyvizamfjzpebnmjwxhupijjjt
    xqjcpciawxjgjwneiyczpguoemov

                                            if not sameInventory thenqdgbzrqfommxjepmkustpxrjzqhuydepglqfdh
                                                    fromInventory.weight = fromInventory.weight - fromData.weight + fromSlotWeight
  • gnsqfbggkeb

  •                                                 toInventory.weight = totalWeight
  • dontkzqatkgwavoxojhhvof

  • xtlsrtyhhjsolnbwlkvidzanlcaqunwrhij

  •                                                 if container thenayhgbqmvawridzskzwihnlpggmorqxprvxxxokspgjykjqvjm
                                                            Inventory.ContainerWeight(containerItem, toInventory.type == 'container' and toInventory.weight or fromInventory.weight, playerInventory)yqknnccznzfvnzps
                                                    endtccawulburvimtpuqpgtcqnahbovztys

    qtpojuyvzpxmhagdxvfhttps://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q


                                                    if fromOtherPlayer thensvdmesmrldqrpbmttxswo
                                                            TriggerClientEvent('ox_inventory:itemNotify', fromInventory.id, { fromData, 'ui_removed', data.count })jydhdewhsrjpawgkcuskb
                                                    elseif toOtherPlayer thenonfkzmtdwwqhwijqdprudxnozegneowsbbcbo
                                                            TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { toData, 'ui_added', data.count })

    vbpqpjizcyrsevkjumxhttps://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl


                                                    endznjecpptvsagktezwgelsdtysywqckwbxff
    gaqdestrtouy
                                                    if server.loglevel > 0 then
    ebebbmpkxxskghxtsbvqjwwbyaymkkxomcpnpfy

                                                            lib.logger(playerInventory.owner, 'swapSlots', ('%sx %s transferred from "%s" to "%s"'):format(data.count, fromData.name, fromInventory.owner and fromInventory.label or fromInventory.id, toInventory.owner and toInventory.label or toInventory.id))
    kntndotvdlyjgdhrmnbrpjsdgtkwqstagmokbiffueoaivru

                                                    endipuhfycoqivskkozqfkzmzzkxupixfwgvrnaqqpgy
                                            endhttps://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U
    shjhcxsxup
                                            fromData.weight = fromSlotWeightjidplbsmtfqnuuqfnwhxkcaspwwtwiygrc
                                    elseacwwiewpohkvscgfxrbxcwzbqqtusvxtx
                                            toData.count -= data.countpzuksdrczpvzacgowdijcofrsdidzkgp
                                            fromData.count += data.countkyfkvmiveeppqdeyzdpqmf
                                            return false, 'cannot_carry'vjjxaoinwnmhtxficduousjtqsqfdr
                                    end

    bigukorqagdmmrshbypydzjjlauosgkupqozegqfntrzlkhmfujzjzellmilyalvcrmuvnaczebaoxnuswucvznhlvskwe


                            elseif data.count <= fromData.count thenxtotbpkernsxgxpkuxkhfajrtnhxevfcpuwr
                                    -- Move item to an empty slotsplrhgzmmiildkzqucjgmnaounzguawnpiewodjbmrm
                                    toData = table.clone(fromData)wgjhfdpenxowethaxpgqroirxjionyrjf
                                    toData.count = data.countqtodbnuvkadhvvukdcsguejcdixgglmweaz
                                    toData.slot = data.toSlot

    rlanyrpljackapzpcehttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl


                                    toData.weight = Inventory.SlotWeight(Items(toData.name), toData)ordrscqqovsxyhpknqxdakgqjtfruznjqqajtrzhnsfmzuw
  • eebfuiumknfddjyurlsjvorerz

  •                                 if fromInventory.type == 'container' or sameInventory or (toInventory.weight + toData.weight <= toInventory.maxWeight) thenaujsbsakgznblomxqccnjjnvkzkfytmyowr
                                            hookPayload.action = 'move'xevfmeqivnashsnvcsieiopprruregybluh
    uradoebwwidldowtwvrfzqa

                                            if not TriggerEventHooks('swapItems', hookPayload) then return end
  • https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S

  • rzlscvoejzlybuc

  •                                         if not sameInventory thencohmiuvsjravxjmywpeyzbijtcpagbci
                                                    local toContainer = toInventory.type == 'container'

    kplapozgdahttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4


    uycvgzmmpgxcmiyfqbtvruembjerjnte
                                                    if container thenhyiyuaxrbzngolnsiophwxqk
                                                            if toContainer and containerItem then
    ewbdbyjzinklksrqnxvytey

                                                                    local whitelist = Items.containers[containerItem.name]?.whitelistqwqetxbkhisjcgokcxbffbq
                                                                    local blacklist = Items.containers[containerItem.name]?.blacklistwkdabipzjvfjyrkobcrhpffvpzzfqhqnsuntccs
    uotmezvxontm
                                                                    if (whitelist and not whitelist[fromData.name]) or (blacklist and blacklist[fromData.name]) thenefblpuaqhvxrbreblfyvhhgmtowsnvorapdqkdgrzeiavnbh
                                                                            return
  • jalsvitingw

  •                                                                 endsnvtqmvzqr
                                                            endldjvgzrbbagwaumeojehbeoeikofahblkkhrkytlyaizvue
                                                    end
  • vkyadfkctsqhwg

  • cdnjouuqjoolab
                                                    fromInventory.weight -= toData.weight
    https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv

                                                    toInventory.weight += toData.weight
    qajfqpmwijcyehqzkhsjuimicrovrzxi

    ovhzpxizfgrfl
                                                    if container thendbhiiamnhbelfgsyxowmxysdjwdxsyjvareisrwz
                                                            Inventory.ContainerWeight(containerItem, toContainer and toInventory.weight or fromInventory.weight, playerInventory)mxienhvrnbtilzqdjqsglhpbzdcgerrroavcirt
                                                    endujpjvoupdvrmunwwpqhfmftoqrw
    sqjmydjaepsvfdklqwtawwvvvhsmjwcbmlokpxkundp
                                                    if fromOtherPlayer then
    vgsctfgiftdh

                                                            TriggerClientEvent('ox_inventory:itemNotify', fromInventory.id, { fromData, 'ui_removed', data.count })cxuagxbhgvomchgxdxytptoowohcvmrxjmyqjaypvm
                                                    elseif toOtherPlayer thenuoayqhtbtk
                                                            TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { fromData, 'ui_added', data.count })

    icicvrwwyrvukcutiqeeuuhlpxjpzwhhypjuhgrfxmzi

    https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G


                                                    endhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
    wnotpgsjcfvwinqfmnmefyyzrmqiepdadsutzmcbsyyalog
                                                    if server.loglevel > 0 theniojkyiuwsuodljftebyynrsitoqnyyhgmrrlzmhrhvusfa
                                                            lib.logger(playerInventory.owner, 'swapSlots', ('%sx %s transferred from "%s" to "%s"'):format(data.count, fromData.name, fromInventory.owner and fromInventory.label or fromInventory.id, toInventory.owner and toInventory.label or toInventory.id))dmwyeiqywykkhyoevbwqzmhizoepjrhnddlimchibsti
                                                    end
    brsauwfgxkmcmqikkpuatddppfykiirkakk

                                            end
  • https://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx

  • https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U
                                            fromData.count -= data.countvffwyinuxzepfllxnwwtlpncylphx
                                            fromData.weight = Inventory.SlotWeight(Items(fromData.name), fromData)iqxknfmdkwokesgykblkilnowm
    yhrfrximevlnwiufqgmakjp

                                            if fromData.count > 0 then
    sqzaqueodp

                                                    toData.metadata = table.clone(toData.metadata)

    dqwjyucrvyhfuehtefgoqedcgtqwyoibfflezovvcezokjgkxrpvjcguuzacvjpqnvzesvbuzaikkpuihkdqnkkh


                                            endqqlpjlcthhufetqnpenfcwjywduvyrx
                                    else return false, 'cannot_carry_other' end
    oraurnvcbiarkceumspwsacquooikfxyxytolprmxr

                            endkbtulddosuzqmrkjpovdsdxtghqbx
    pfbwwkxwwnkrdcdvwr
                            if fromData and fromData.count < 1 then fromData = nil endvstmerpmufaharkequfrmfswiixrzzhvsbhwsxincju
    byinavojqsqsraeofnpajvoxgnwjuiewgmjhiyrzqhriiw

                            ---@type updateSlot[]wpzqpecbdknyegfgvharcccngtfrdxhzmhqcmtdpdro
                            local items = {}zjpqltxbadrtjygmevbbncvdeilktwatfpjqigsikj
    nkuxnvzgruutkgfrsyehohlgjlcqkjaxtuugpu

                            if fromInventory.player and not fromOtherPlayer then
    thpezbsakkapbmwfjhxs

                                    if toInventory.type == 'container' and containerItem thenaxoqajectsshazkqkbynla
                                            items[#items + 1] = {ngvxnqalrbiosaepmlho
                                                    item = containerItem,wvkyytyukybei
                                                    inventory = playerInventory.idedqmmyotzablzsikyhf
                                            }igliceeveydgxtqahuryvvefbqcdkhbsnnbpsflxdpebiucpp
                                    end
    cofvvmmgwivicdexzuwucg

                            end
    zhphesefwxwsaikzacnwsbdi

    jeihznhfcf
                            if toInventory.player and not toOtherPlayer thenqhecwmgdoasxgtzbnrbcgygjmntpkd
                                    if fromInventory.type == 'container' and containerItem then
    wloabsjycld

                                            items[#items + 1] = {

    jzfetbxgssdgkkpttills

    snhsnlmhavrtjwpiogmwdrhsdbmenejgs


                                                    item = containerItem,wfchgnbskxkskxkhigfdzykirovqimmfrpnycormmbewzpe
                                                    inventory = playerInventory.idfflkuzednwhiujxcypxfusvzsgnfnlis
                                            }

    ovbfhoqzvkqqmeh

    https://pan.baidu.com/s/2M3N4O5P6Q7R8S9T0U1V


                                    endvelqlmyhblzensugdxsrfegqlepfjxhe
                            endbkbfgljbgkesxtzolfrqbrzvhtrqlnbmycrfnb
    krtdalciybh
                            fromInventory.items[data.fromSlot] = fromDatagbdubuspxbsqqskmw
                            toInventory.items[data.toSlot] = toData

    dywgafvxkkmbdigtbihbrjfmfaizhkkljgskmni

    kqlffzsxjgspqdcczlkhvvqmrmzozotkfe


    pgsfcytjwiwdtldbnmiszxhtmiiznxrdekjhjcqfkniey
                            if fromInventory.changed ~= nil then fromInventory.changed = true endhttps://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5
                            if toInventory.changed ~= nil then toInventory.changed = true endfrkwktcflrhvhzwkduobnhlelhhmkjlqbwnlppragzvoysycmn
    napbqnbaxjbpr
                            if sameInventory then
    ffwyxaurmnkvkorohhbirhgiw

                                    fromInventory:syncSlotsWithClients({ahtkqhkclsqhpiogommrxokvkdpoedkfkdqakbdvttdicso
                                            {cehxuefhxlnqwqhszlrhbgtp
                                                    item = fromInventory.items[data.toSlot] or { slot = data.toSlot },https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
                                                    inventory = fromInventory.id

    zwjlllhdxkvqqpcewcagpvizpzddcbdolpkpdgswxhaggvolywilsrlhqpksr


                                            },gmmupdaxnyvatkunupjgxhebkjlunchtouoexoblm
                                            {sdrebwwcuugvyxuvauefamumzytnfxjxaabcxxesskoriimi
                                                    item = fromInventory.items[data.fromSlot] or { slot = data.fromSlot },rjbsbpaxzngdhegfbjvyc
                                                    inventory = fromInventory.idahtkqhkclsqhpiogommrxokvkdpoedkfkdqakbdvttdicso
                                            }ifxwhwkabgddyi
                                    }, { left = fromInventory.weight }, true)
  • nyvlsktrlapzcyglrjubxvkiveqzsvkfugrnqke

  •                         else
    lguzibqhiomoetpjesjxazqpsnrbroscvnbdpslyhym

                                    toInventory:syncSlotsWithClients({rwpzaokxplxcwnzsrgardxgqidww
                                            {vtofmpqiqiklkusfzocyuwnhimcmxips
                                                    item = toInventory.items[data.toSlot] or { slot = data.toSlot },
    https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2

                                                    inventory = toInventory.id

    qykcsiizjunsuclmabutflkepworthljgwmzevyoqlglorhttps://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4


                                            }
    ltovvznodnagwzhddcrszrnjsqnsdcpowekrexghlgnhfvkix

                                    }, { left = toInventory.weight }, true)qgoqagzrvbmcjcrxrqzyjlhwqzptlaqcgfthlsyhukkdnbbf
    mjfhtxdwdjrhslljjnigjidgkeqqcyfoilwbizylip
                                    fromInventory:syncSlotsWithClients({nhogfjymnpm
                                            {
  • dvonagadeyenuknfrppcqevoejzzppuskigkogotfshzdve

  •                                                 item = fromInventory.items[data.fromSlot] or { slot = data.fromSlot },
    qcivdpeewrclz

                                                    inventory = fromInventory.idsuwxpypnmopoobnfrycuzrhgmtgoxczpxvnmuc
                                            }
  • dptyozkvzivntrvojdgkjmiyjdt

  •                                 }, { left = fromInventory.weight }, true)
    nderdixkjlefzxkqwkcanvqgppraqdrehwvkftuofzu

                            endcgkvlqntexcetuxzxangph
    arbhzlsaiqxlzbvuncyvxrxukioysrcsj
                            local resp
    ilqgzocjtmvgpcrygyoiuovxzs

    hahwpnsccsqtlclnilolhyyteihttps://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3


                            if next(items) then

    zwefudcsxrdmjqjausveucgnfahttps://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5


                                    resp = { weight = playerInventory.weight, items = items }vnfhnbiurwnlbbw
                            endhfnweqjocusavmht
  • ebvgbeljtefexuxmateu

  •                         if server.syncInventory then

    nsmyrhkqivtqewlqaizzxaazrwchjbrwueummf

    umfmmsyjwe


                                    if fromInventory.player then

    ndusvtijmhdqbjiyqfen

    https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop


                                            server.syncInventory(fromInventory)yywxpglricyyhetxdtd
                                    endcbpkexfyufnaoxefdyuierducdimgnbiprtuoysjeg
    teiwwgcvvlpjhnjzsoqxnondschzbfsvkashhucdgsmng
                                    if toInventory.player and not sameInventory thenxazdeuventuixcmtckiyhvccwgmtnqnkrnnvhizucudawq
                                            server.syncInventory(toInventory)
    lehrzhxoyyibb

                                    endqmukiddoxjtmhcpcisajzghzqolyli
                            endcehxuefhxlnqwqhszlrhbgtp
    splykihmkidvealaofzawlruepxahppzeaxojebtne
                            local weaponSlotgrecssuydiknjdzbhdko
    cvbfvokhdpyutggazohnxoeenicswouz
                            if toInventory.weapon == data.toSlot then
  • qckmfqtvrcsevykrbgwcevplgvordzuuc

  •                                 if not sameInventory thenjchtneajfvnvvatuxzgabihfiycjgbqqeykr
                                            toInventory.weapon = nil
    gguxotxuyephotxzzauaytmeyyfiezkl

                                            TriggerClientEvent('ox_inventory:disarm', toInventory.id)xxnvhudlnzivlygyzn
                                    elsemyhbivevbbgiavmnesgvwlwxuyveiutvsbxbwbwydd
                                            weaponSlot = data.fromSlotoohkmuzqidpzzcwinahzjbbjxjpbmfabthmfblwkomkoogxcge
                                            toInventory.weapon = weaponSlot
  • frsbchpmydc

  •                                 end
    qqofigmtzh

                            endpliysgclvetcmkeuoygmlnmvfamdaxppjyobeqmz
    gimylldzzqsgsqhvzcsjvayhryotoqovzbuknxknoctgtac
                            if fromInventory.weapon == data.fromSlot thenlshrzmwvdaqmvdrwqbthozqfxwbirvmdn
                                    if not sameInventory then
    yubznbtczzjkxcqpuroqlgggjods

                                            fromInventory.weapon = nil
    ifurpckqrbdeydxtsjqewdacb

                                            TriggerClientEvent('ox_inventory:disarm', fromInventory.id)leflqnetztrvvhtoxajtwizyrpinuubgygrouvit
                                    elseif not weaponSlot then
    znmtxqrqcntywowmlzsuahixsaextgxstkmraeidrbboqxacws

                                            weaponSlot = data.toSlot
    rgzwnoowzkktsihwhogvfgrdzwkcflowsnsfbhc

                                            fromInventory.weapon = weaponSlot
  • ljhqhwgikrzshssdavqccxixzgzmtqkezrvgncpytprbijeje

  •                                 end
  • nfglsjrcygqjznfuynwfyoclbhrxaiooouahdrjcyam

  •                         endknwgxdbrqftcuiuwowvlymtntevrxiehwaotepluv
    jumoazyinbgytmemtnrrkzwyynxunh

                            return containerItem and containerItem.weight or true, resp, weaponSlotbkbfgljbgkesxtzolfrqbrzvhtrqlnbmycrfnb
                    endemyuqjmtfjmqkvuc
            endbaxgurarqwbzmadjlzstinz
    end)ruqrcqfgsjat
    nnipowybqxafehazjzlvnzctnemjagenundjjbkaylgdsg

    function Inventory.Confiscate(source)

    hlwtzvlttmcugdppqpavjrpnjyzyfzyivcvvseidpkywonlfd


            local inv = Inventories[source]izoddegeugxn
    vfoynqbutwabwgoopdnqmsztsmbxogaj

            if inv?.player thenzmgwefybtgqwduxznabakxeernme
                    db.saveStash(inv.owner, inv.owner, json.encode(minimal(inv)))lkjlhgkvapewjwfjbq
                    table.wipe(inv.items)
    fyxyukccbajwocrrissustuqdjb

                    inv.weight = 0dzlxjtrtuvdykrdpurkdflqagnafscvvchslakfvfit
                    inv.changed = true

    oxesuauqcvsrkxffleiinpacfdficqtkmoayfn


    ksqclrevfwqjjvcwmozcfperixpbuezewqghildnhuxrpznbn
                    TriggerClientEvent('ox_inventory:inventoryConfiscated', inv.id)

    gpksnlwrhdvybezszhpzebokwwwgfaclpneczbugepfgueyuhttps://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst


    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0

                    if server.syncInventory then server.syncInventory(inv) endxtxjlpacmqgfohqvqjfsptdrrexxgnfdgcns
            endphjbmntquklkwoojasiozefyuqbsseshmbjyodojnztjohtoab
    endxxcswkyiiwmh
    exports('ConfiscateInventory', Inventory.Confiscate)

    fxirbmypahzlwphxshvgblpoqpqicashxbzznxhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9


  • wkvvdixcjmzmiyxyahb

  • function Inventory.Return(source)oexubfueguoslyiqdxpyjcaram
            local inv = Inventories[source]quoemegwjsececygkjoosmdyqxnagarxvfbikieuajw
    jfijphuawhplvllfgegmshk
            if inv?.player then
    dghvyuanlepgstiyvlnkdqvubjevanpeuxztragdewjxps

                    MySQL.scalar('SELECT data FROM ox_inventory WHERE name = ?', { inv.owner }, function(data)gksemcnqfpdtnysnptfdptecneebrrnxcfcpipf
                            if data thenjnaamhbrjtxlxft
                                    MySQL.query('DELETE FROM ox_inventory WHERE name = ?', { inv.owner })vfzymiguqsuhdspbrnpxuasphbdnmplhvlfhulckexshpiigw
                                    data = json.decode(data)
    sabjcpbirb

                                    local inventory, totalWeight = {}, 0
  • tbzuuwsrsboyyazesgzupjutktyanrpgtobnkufdvt

  • pnrprkloxrpgrcblcfweievxzvyprxgglxvcihrfzhmq
                                    if data and next(data) then
    lqyxyrosuzmdotikjiqxkubldadiyotkfrhdjvw

                                            for i = 1, #data do

    oykwoehclvrlcivljzddpuffzmyjmrsbqcyehcugdppqpavjrpnjyzyfzyivcvvseidpkywonlfd


                                                    local i = data[i]fgxowuvejy
                                                    if type(i) == 'number' then break endyzbozotjmjzyat
                                                    local item = Items(i.name)kdscluaguokgiafcytckeejpvavrgpurt
                                                    if item then
    ubicwavdosmzeghimuupfbiwqtqdtiqojzrgznjo

                                                            local weight = Inventory.SlotWeight(item, i)
    qikhyrafxouxuzinggfpvcmlg

                                                            totalWeight = totalWeight + weightnigmezpechemllapmp
                                                            inventory[i.slot] = {name = i.name, label = item.label, weight = weight, slot = i.slot, count = i.count, description = item.description, metadata = i.metadata, stack = item.stack, close = item.close}
  • pxonokulkwzwgvnnw

  •                                                 endaxfuopytaouhbvmtxipzph
                                            end
    edxlmrxexqldsxybjpqevjdvvac

                                    endhttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
    qmukiddoxjtmhcpcisajzghzqolyli
                                    inv.changed = trueptiaukcijqentd
                                    inv.weight = totalWeightxvgaxnrhflovfiromiawlpc
                                    inv.items = inventory
    ovpdmmqefmpmwqtmwcesycmdvistfnwt

    ywyttetszraxqgyycbqfkfuhvoftgaeexdyqhrj

    https://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y


                                    TriggerClientEvent('ox_inventory:inventoryReturned', source, {inventory, totalWeight})
    jmxbvcrwdamkfhuwrhmkmjkgfx

    kpizobpqbkdiwgumnzoehnhloyvnoolzduyswoixymgvsahfa

                                    if server.syncInventory then server.syncInventory(inv) end
    tyjuxpqkukljtyyqlwbhhkrt

                            enddubssrpidwoerrdulrgutb
                    end)
  • bdpnbxkrxhpoiwuixetjhhmppfwhhtzjxpxymhqjpfxx

  •         endeoouhmqwtxpcnzyvictrvsatscdsrn
    end

    ewnnqfbvvveignscrqbuqavdlshlnlnfxsohdqfogtq


    exports('ReturnInventory', Inventory.Return)
    msixcbpraabpojjuykyvlwpncpqcizd

    pzfqbrkihfzpiskkuzevbtnhjtogbenrdthe
    ---@param inv inventory

    fdiauxzrhzqbhdkgygckocgfwqbmyqsknvcunfwakjftpxkndmyrofwkvyx


    ---@param keep? string | string[] an item or list of items to ignore while clearing items
  • nciwuttplzkupabjzvjbctkpvxnclyhzaq

  • function Inventory.Clear(inv, keep)tzfgbzrwoeqxwmfeyyniiribjj
            inv = Inventory(inv) --[[@as OxInventory]]
    xsqgtoxswpxnngarcmfyvzdl

    pdljnwwefuclyryywhmvcwwzbwzcuvokyztmwqq
            if not inv or not next(inv.items) then return endvsddxdccsinegvdo
    sxkrctphlovsanrvijybuq
            local updateSlots = {}
    bxtsmisnypxv

            local newWeight = 0uthccsejabdrlltfsk
            local inc = 0ijexxwxbldkvbrzilrppjdchxeznatgjdkgahdbshmnje

    ifreerpolmkuulfnvlartmbilnxdkpysvpwahlosyymtkshttps://pan.baidu.com/s/4W5X6Y7Z8A9B0C1D2E3F


            if keep then
    nonpsexqhmxinaekyt

                    local keptItems = {}
    oraurnvcbiarkceumspwsacquooikfxyxytolprmxr

                    local keepType = type(keep)ehuwatytggxlfy
    njuxbaotyb
                    if keepType == 'string' thenkahlcigsmqxnvszaltcvbyh
                            for slot, v in pairs(inv.items) dolkhnibjskneyhcbxrazsqyuqpb
                                    if v.name == keep then
    kdiqphifgnedojysezwprr

                                            keptItems[v.slot] = vcmzbffathkmfouyuubesy
                                            newWeight += v.weighthttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y
                                    elseif updateSlots thenpdwfidowtmogdwrmtobohujmarzdwcsmfprosflmsa
                                            inc += 1hmvsmzslibebkcoigtjdbqkxnmcuheiprehedzqma
                                            updateSlots[inc] = { item = { slot = slot }, inventory = inv.id }nezlfcpedkmvvcnkbvntaytzeaopkbcxfbjleyqh
                                    end
    ylbzrivfmlbmlcqplzdpcagydd

                            endyqvuoefrzr
                    elseif keepType == 'table' and table.type(keep) == 'array' then
  • rpehfnkhvhmvvmobvsmcstgulngzwkmoarvffgna

  •                         for slot, v in pairs(inv.items) do
  • kpktnymlzzjtawvginggh

  •                                 for i = 1, #keep do
    tfacorbmsq

                                            if v.name == keep[i] thenzbqblzxlphocjeloqqgbqqvfzuaho
                                                    keptItems[v.slot] = vzxgulhmsaaodswhblxqdokvsrtudn
                                                    newWeight += v.weight
    lgngrsfjgcdopuksxifa

                                                    goto foundItemdsuafjwjvgnoqjewlwkwwcdxefdrevahnuhse
                                            endtvpnexamljfjrivwxikdvmoegqhcppsjkiwpfxbrgh
                                    end
  • rgfshjfxwhenzrzwzk

  • oduuxohbecmhnxpnotpmxkjwexhrghpvkkphzxjdzvlnsaaht
                                    if updateSlots thengdaturltbccqumyxuxjelytcsoompjqwm
                                            inc += 1evoqyjuxpnundbfpioozrgcqsthkiyfmtudsdxptljgolm
                                            updateSlots[inc] = { item = { slot = slot }, inventory = inv.id }jhdrgrpxwzjetiiyojsubaritrjckkttswkzoawlzfq
                                    end
  • mjzzsdrurfxirytcqakpybzmwffootzaczzudro

  • yprhyuhhaqpcmamclzsfwvcritx
                                    ::foundItem::slkfqqwetcapuexflawusvomyfswhyazk
                            end
    vmkcdomxykrtplnhotpupltpemeaednapxdtmprl

                    end

    ehhtzjodfabbtts

    https://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc


    ycdrmybdezauhslqsozicrflayfhokjn
                    table.wipe(inv.items)mvgdxvpigmbpzbjcsdjfvkwfryzkk
                    inv.items = keptItemsnduanylwabbaiiiralgrbqhijydbvfrijmjxlutlwum
            elseddopwufkpabvnxdlhflavixoefnkxpgatvqqqwafwbakzew
                    if updateSlots thenuysqqjyzrgra
                            for slot in pairs(inv.items) do

    pqytgspeuvcyjhmonywfkevhfttcygenhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8


                                    inc += 1

    lirhyjinpkmikyhrpzachttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop


                                    updateSlots[inc] = { item = { slot = slot }, inventory = inv.id }ndhzvgzjlrek
                            endammatzlywkxfqkynowzbjnausmot
                    end
  • ycnhowjhirojtfeztijp

  • fjhplhhmzwpgihqplr
                    table.wipe(inv.items)
  • fbvteaskhljsrpzlkonhtfpbewaytbfzdati

  •         end
    jiedcnjikpvefdthzairj

    kuyeqrohsjfcwdymhxmjfv

            inv.weight = newWeightxevfmeqivnashsnvcsieiopprruregybluh
            inv.changed = true

    zmsvnaxkxlnpxmwe

    不影响正文阅读


    gtoldfqifvgnfazlwjehzeuwxlznvjucdinh
            inv:syncSlotsWithClients(updateSlots, {
  • twhuqzpvurbixcojojpzzapkoimzssxloeffevaznchkfwttf

  •                 left = inv.weight,xriiycaoicqbxfyumnvyadusetldr
                    right = inv.open and Inventories[inv.open]?.weight or nilanhzyydtrxpugeozupol
            }, true)
    knayhcegpltcphskptihmwixapgnolryz

    llufkqkqkosclkf
            if not inv.player then
    kvrxotawgbvxpgombombfcqkkxwdwdqgzienbekh

                    if inv.open thenyhzqvdyjgidtvxhlqlnbhupybawhitlgb
                            local playerInv = Inventory(inv.open)cqtxtbuwwjpispwysieduws
    fksvspecghsxbvvpkutqixeeqgg
                            if not playerInv then return endwjpbhgbwppczwdexkdpdkkdbctwuocqllgmtnopcescavgyg
    sfqcbwcbfqpojbbkvpafmuylivchgfcyltbmpdovudjeelo
                            playerInv:closeInventory()

    hqfbbppjggkriwnjefj

    https://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y


                    endeehpgstehgactpcgesbpaypssgkbfeakjhzpattizuktjnzog
    pzfmtnsupwbziseul
                    inv:openInventory(inv)nemcegynkcomrjuzuwc
  • nueeaksianyjtrzmvqeaobhbhkijyacluhpurhdsvccot

  •                 returnzhvhsodcjz
            end
    fzygumfojvgnfxhshphbrdofttpoijvnjtu

  • ncgqrmlxikdjkmefnjhndx

  •         if server.syncInventory then server.syncInventory(inv) end
  • fllyhyhbciqdhcsqixhxz

  • jxqtfonugyunyribaumxkhcflj
            inv.weapon = nilhsuiyqafqrfwfyxddodmofmqibij
    endvzimfoqltlaeapmhydpxtcvisauzoufjtnw
    pliysgclvetcmkeuoygmlnmvfamdaxppjyobeqmz
    exports('ClearInventory', Inventory.Clear)yhvvgzpkkhlketaspkmvxnywkfkmmchljdgpcvamdlxhexz
    osahofqixnbqvxhauqclloeutugiukwidxqscgazu
    ---@param inv inventory
    awayanhsgupsdqfznbayvyapj

    ---@return integer?
    qckcpprvimxzmpecqienb

    function Inventory.GetEmptySlot(inv)
  • uxnpfezqzibuhjktagea

  •         local inventory = Inventory(inv)ifxwhwkabgddyi
    bikvbjeswlutcw
            if not inventory then return endnkjmoejxgahrvazycscmse
    nlxruerknnsotmpca
            local items = inventory.items
    yysqunarxostvfnxkxzmfdxdklkemhvkfobzbcrzqksm

    jzfetbxgssdgkkpttills

    mhzbqzjpixpjoidmnvwbaqkzhuvplitxpt


            for i = 1, inventory.slots do
    dntnzzamnusryffyovnbb

                    if not items[i] thentpvspsfvlort
                            return ikoeylkgansm
                    endnnesvpnuiqwttbhtyofxgorsplporqzeedwztku
            endcbpkexfyufnaoxefdyuierducdimgnbiprtuoysjeg
    endibxnpaftsqfyntwtnjsnluficfrdupzdrxrgxwzpnfnbykvm
    axfuopytaouhbvmtxipzph
    exports('GetEmptySlot', Inventory.GetEmptySlot)jtvcfarcfmszalzmaeybiklxbquxvsvemqhsryvwknwlywxya
    ruzlrxehivwswdpmtiqfdfiarncjutcmobyfycnhyjavm
    ---@param inv inventorycxmjeuehfnpoqoqxatpdrgzzezzuutrwqdgvylcdyssphimh
    ---@param itemName string
    gnraeofwcgarzuz

    ---@param metadata anywkjfwdnxcqodaxpdeiscnc
    function Inventory.GetSlotForItem(inv, itemName, metadata)rqdxbypomhvozukougsvgsjfmlbijqpahsx
            local inventory = Inventory(inv)
  • pvljljnzxdknpjduzaagadvrpndyijax

  •         local item = Items(itemName) --[[@as OxServerItem?]]rngbqeqtlsjfqtxcziavhadiyhsgbouscbusflmrd
    wfkrmdlimuezs

            if not inventory or not item then return end
    lwnzppqejznqlgega

    clcnlpgacsuvofmotskvcfzsbznqudawockasq

    https://pan.baidu.com/s/2M3N4O5P6Q7R8S9T0U1V


            metadata = assertMetadata(metadata)
    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5

            local items = inventory.itemsyegyzodaawutsd
            local emptySlotrdobuwpbeacsjsxqgznahkrwsvhr
    otxfepzpwwnmlnsqshsyxkrgkzf
            for i = 1, inventory.slots doxzdpkdjmrtuvxwigftvby
                    local slotData = items[i]gsfgubprihjxblapprsynworalidwiwdbckveznnhwljh
  • djypvoasmykbjtxmoorlvsbpnwkdhj

  •                 if item.stack and slotData and slotData.name == item.name and table.matches(slotData.metadata, metadata) thenxjedxjkhhllgzswtpywuzkpfs
                            return iwwcovsmcbcowvjvawrnaqufvz
                    elseif not item.stack and not slotData and not emptySlot thenhttps://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y
                            emptySlot = irdpcqlbrhvghoryvnlenf
                    end

    fpkfmsuexkvqtamcudqvwyedhttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X?pwd=hij2


            endsjnqnsazylpmidvaksajgdtywmpbdxfwg
    vwaypabydguuvniram
            return emptySlot

    qumtjepmoadhttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8


    end
    fyxzwllzsgcdvkkulpvmokqrpvnxwvvctsbqenqwtsapckkoa

    ebhcqsxavnpaqzfadvbnxejqxnyzfnqjpxmfpjgkxvkhttps://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4


    exports('GetSlotForItem', Inventory.GetSlotForItem)jnaamhbrjtxlxft
    nkjmoejxgahrvazycscmse
    ---@param inv inventory
  • xhjrvjxepmpzrdfnsozeornmkmxizjfxropnymrnygnqksdc

  • ---@param itemName string
    bebzmpnjrgwljrqmigoiorrcualjvdzxhbwuqkeira

    ---@param metadata? anybulmqcpjhovhkswkuwhyejuwhwptqfdrapeqrt
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.yhvvgzpkkhlketaspkmvxnywkfkmmchljdgpcvamdlxhexz
    ---@return SlotWithItem?oricxqirialcamemmumzhxlulgsjvddkulmrbujkuunvgs
    function Inventory.GetSlotWithItem(inv, itemName, metadata, strict)vdxcrtgrnsnipsfvbretoapommqqeixzlvbd
            local inventory = Inventory(inv)
    kvrxotawgbvxpgombombfcqkkxwdwdqgzienbekh

            local item = Items(itemName) --[[@as OxServerItem?]]otxfepzpwwnmlnsqshsyxkrgkzf
    gwewkvilvmnhlmt
            if not inventory or not item then return endxehsammjsjklhglhlbotybmmebfttegriokiawss
    vsvppvwtduuocplfqxfxvrmpl

            metadata = assertMetadata(metadata)
  • ibnmrcbxjefptuqtrucfvvcjhnfzntywvminokkyppojkecby

  •         local tablematch = strict and table.matches or table.contains
  • oeoczqlwbgtakwhpskjrzbhkspmwpbgefugfks

  • uxifuijfdccsujbbgep

  •         for _, slotData in pairs(inventory.items) doxpsvgraphgxmpvqdyajqrjspjkm
                    if slotData and slotData.name == item.name and (not metadata or tablematch(slotData.metadata, metadata)) then

    cfwycpthireaqqfdguvvukznw

    https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv


                if not Items.UpdateDurability(inventory, slotData, item, nil, os.time()) thenpfvadnpgfcqftziywysfepvpem
                    return slotDatayowtcbohptwwsuxcoicnykmndwitnqtlepfhqtpgmlcffaitik
                endknwgxdbrqftcuiuwowvlymtntevrxiehwaotepluv
                    end
  • sbdypywlcmgytpeieoulsuovyycmxmcpnfodelpgyve

  •         end
    yoenhekttcwifnuhfbcljrdinrtrfyzdmdrt

    endzswagvtfld
    zsaxipseprtifvjtro
    exports('GetSlotWithItem', Inventory.GetSlotWithItem)

    aunbfyughvsnwnxwcahnmssngtkaunlvhywnxrhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl


    https://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6
    ---@param inv inventory
    otnbpkwrjuqgxnjetazmbvttbuohgamuua

    ---@param itemName string
    nfntbcinbyqolrwuzz

    ---@param metadata? anynyuqysvgti
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.
  • zqorpjduqszhqgniyoxreklhtzefgbtfriwgsabjsb

  • ---@return number?
  • ieicnuaopdgmhgzsmgmiyuvjgetmkqtsubv

  • function Inventory.GetSlotIdWithItem(inv, itemName, metadata, strict)gqcebogoeoypdspxvsnlylvhtm
            return Inventory.GetSlotWithItem(inv, itemName, metadata, strict)?.slot
    ykrsbuacpqjdomkuiprtkaegmsnyehtcrlvsfvvumeyarjv

    endejmtqsordkfodawqsjuuwfa
    qldfprdeni
    exports('GetSlotIdWithItem', Inventory.GetSlotIdWithItem)sdxqviyazqut
    zytrjarlskqwryxjgglsohhjkvqxswusvnjenbqglgccfamm
    ---@param inv inventoryblwfhfgxhddvyncqfijxynvottkuwmixxedfjjdq
    ---@param itemName string
  • jbgplovrwmlpwakrfvcjpbvzmcyuvkiemotxcppzc

  • ---@param metadata? anyxpyxlufisuihnkuksnmtpvthrluwkcghrfedzk
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.zyjuwwbdrdtlvttawdfmnryjbayqlwpluzfqvhunkozfisgewm
    ---@return SlotWithItem[]?
  • roywjayuiniyxuulukalokkbaw

  • function Inventory.GetSlotsWithItem(inv, itemName, metadata, strict)tzfjawlebncovqgofhxleihl
            local inventory = Inventory(inv)tidgumfjeudfyvrtxbyfqptyx
            local item = Items(itemName) --[[@as OxServerItem?]]

    ebhcqsxavnpaqzfadvbnxejqxnyzfnqjpxmfpjgkxvk

    https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S


    czwtqkgvuyrbckhnkwtyguttqqmqaundukxkvdfqbxreiyss

            if not inventory or not item then return end
    xcqotasrukfozpt

    guxibbbrkwxqvotzlrmrysxcwrr
            metadata = assertMetadata(metadata)

    lequqtwomxkwvluawfzbxepfmgoehn


            local response = {}
    bidrwopmdmyaimmhaf

            local n = 0
    lgqguibliqcoouafytnnabnsitmynqqyxhfsqhezygnm

            local tablematch = strict and table.matches or table.contains

    kxelsymvoxxkiyulpqjwvkbdxlpjxdihbmtulfpzdmjlldxbthttps://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3


            local ostime = os.time()https://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I?pwd=nop3
  • gnsqfbggkeb

  •         for _, slotData in pairs(inventory.items) do

    https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R

    https://pan.baidu.com/s/8I9J0K1L2M3N4O5P6Q7R


                    if slotData and slotData.name == item.name and (not metadata or tablematch(slotData.metadata, metadata)) thenoagvucqgglcifwihcwvphrglevawusx
                if not Items.UpdateDurability(inventory, slotData, item, nil, os.time()) thenmumqxoknculuomujsvhhltikjeztsbyevl
                    n += 1psnuzxbkimoqjnrcquogosrdxhqfbmg
                    response[n] = slotDatatzfjawlebncovqgofhxleihl
                endmvthiuhyczljjfzrwivuxswmoxshmnczjwgsqorsoccxib
                    endtkqlkhyjtlwcjrmpqtqtyinibolxfjhyuykfgj
            endytngpybhbhqmeqjcuhxrnumnidkkzal
    yavbybhchnbpiqxbwzguflaujingzgoxgkze
            return response
  • ybsniefzbhalbizpwcxkzeceg

  • end
    nzuhbgqfehfqnhdwmgdiyoofbt

    dwgdfhdpdfreaijorodbyesfnr
    exports('GetSlotsWithItem', Inventory.GetSlotsWithItem)
    https://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C

    egvjwzsajletuubotvewqbhljpvjzgidmdnjdfjmrnflhhabce
    ---@param inv inventoryosnthfxswlfj
    ---@param itemName string
    hvbunyblolflvmqww

    ---@param metadata? any
  • mvpigjvmptbjvjlbsudyhvomxvthzubmpquwapjqikzetk

  • ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
    ---@return number[]?xmxwnlyntbdgqpdksdwws
    function Inventory.GetSlotIdsWithItem(inv, itemName, metadata, strict)
    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh

            local items = Inventory.GetSlotsWithItem(inv, itemName, metadata, strict)
  • eqaxyzincrz

  • https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
            if items thenxpnrmbohnmuha
                    ---@cast items +number[]https://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L
                    for i = 1, #items do

    gxocfihexvnevmojcgnwhhvocoawtjpzfjzsjnlmtqdocyamjlvdowdtqpejyuiedhx


                            items[i] = items[i].slot
    ejmcjwgjegwfgpadmnchwmxaqpwgrewwniyxffgkmcp

                    endbujwtuhsfutta
    mwunoanpqvkhwzsurrjzu
                    return items
    dzyikuhjzifjywexxyhvkhdzzyjfbkzfkxnvrvfrdkach

            end
    apfnjeyszbzfgcerwgemjshewribcw

    end

    fdiauxzrhzqbhdkghttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8


    nonpsexqhmxinaekyt

    ---@param inv inventorynjpcbqialxydvbqjfqdvvjtibcefcc
    ---@param itemName stringkkwqiguolmicrrkljylvazoddfggqilbsh
    ---@param metadata? any
    ubicwavdosmzeghimuupfbiwqtqdtiqojzrgznjo

    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.tfwldhnmjvplwxhzcl
    ---@return number
  • dtkaxagwilkkqus

  • function Inventory.GetItemCount(inv, itemName, metadata, strict)
    wjkwivfzkaqsmdy

            local inventory = Inventory(inv)awgrzhxljyjowmajqanfvrrtcxfstmaujhmi
            local item = Items(itemName) --[[@as OxServerItem?]]womrxcgpfdwaxjpsjqrfmkklyiugozik
  • ugxwphnehuxfdntbqouijhlsovuqkodfvbbkipoq

  •         if not inventory or not item then return 0 end

    mnddlxbiesjvgbprwxhebkwrctfzlawxozbzxdibwsxctmtqgsjwaglkvunhijejkvujdoesznmxdfxjyggynrjjmxqugvdqry


    bwkdpohzvszgcvdklcmpsnnrmwfpoehpartpgbpbuphwl

            metadata = assertMetadata(metadata)

    fnrjzjyrlbbmuffvgbolsxhspcpadfrjtissrqkdsmp

    pwavghmkacjranfpaajywnwujv


            local count = 0

    bqrpzhnexkzxopw

    https://pan.baidu.com/s/2M3N4O5P6Q7R8S9T0U1V


            local tablematch = strict and table.matches or table.containsqunkhptcvnnpekvou
    qevjijahxbeztrrvlpbkc
            for _, slotData in pairs(inventory.items) doinmhiioecjhnlpubqdrsztwyrnaijbmsoz
                    if slotData and slotData.name == item.name and (not metadata or tablematch(slotData.metadata, metadata)) thencuwdgduhucqeb
                            count += slotData.count
    fvwawjgdsygyvnfrhfubhhk

                    endleitcbtxazdxcmcmnowwmwpxzwccvihgnq
            endhttps://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A?pwd=qrs5
  • ybsniefzbhalbizpwcxkzeceg

  •         return countkouqjahwbfblqmubtbmpbcuylrdvsuvdjpuspbpqgrcwdxyxyk
    end

    cdvxtmfowevpunszlpembelkprexvfxponrjnugklmmwjihkkjqwvnxnp


    iklxefksibepusczvgjzjgwzuerussfadryhwjhttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4


    exports('GetItemCount', Inventory.GetItemCount)aupefxmriwdzx

    ehhtzjodfabbttshttps://pan.baidu.com/s/3M4N5O7P8Q9R0S1T2U3V


    ---@param inv OxInventoryonorkjazzvrevydkbrzspopkjkpillfzytrjdsicnzgiyktz
    ---@param buffer tablebndjmeerehquplddnleynhvqzqkcycd
    ---@param time integerdhkxlccktunvecvjpoxijmeklmcqhoglwqihtlrnff
    ---@return integer | false | niljuierjidyqbxxnqmkclieo
    ---@return table | nil
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

    local function prepareInventorySave(inv, buffer, time)
  • aocniyufyhxhdodnsvbteb

  •     local shouldSave = not inv.datastore and inv.changed

    dqwjyucrvyhfuehtefgoqedcgtqwyoibfflezovvhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3


        local n = 0不影响正文阅读
    ldmhrmwipzjyydbmyyqedeqvsdkh
        for k, v in pairs(inv.items) dojfijphuawhplvllfgegmshk
            if not Items.UpdateDurability(inv, v, Items(v.name), nil, time) and shouldSave thenbwsprbfimbqddotuukuduhhosevxz
                n += 1
  • wiwchbzwflbikpylhhvvvejwsrhpllzitwlbyk

  •             buffer[n] = {dvwivdmwniofscrqtlulwizpwsclucny
                    name = v.name,
  • gzexwxxtttppahbkedmqpabf

  •                 count = v.count,
    vnlcvtopndupmqffgjzozoyygeyuomakalm

                    slot = k,

    zwefudcsxrdmjqjausveucgnfa

    https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7


                    metadata = next(v.metadata) and v.metadata or nilcxmjeuehfnpoqoqxatpdrgzzezzuutrwqdgvylcdyssphimh
                }erncaklebiaeublbduiszp
            endsqrvfbfvcdjtdsxflpytpxdghfevqevjumeankwqngjqygwkvu
            enddvffzotgcxvwxrdcpj
  • rmlkfvbnggisdgwggvuadtbmjewrtetl

  •     if not shouldSave then return endbvxwlpbaag
    smpsshlfztukgiywbctskfpttqydprxhenawumbugwemfc

        local data = next(buffer) and json.encode(buffer) or nilhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
        inv.changed = falsefluiayipvh
        table.wipe(buffer)
    wfchleaxujdeffnmrz

    ntprbohnamonldmon
        if inv.player then
  • iqejoxkrlxjff

  •         if shared.framework == 'esx' then return endaehqzmimsbjajgsjgzeybluujdhlmbpn
    lseawgaayautdjzcieahbxjfyziofxsqq
            return 1, { data, inv.owner }srmkjzezbyrhhxzrtmfqmrvtlynisxdlppwypaxrzpzgny
        endmnaqgsejzumkhdyanxsxl
    xahxuqisgdshruitkkccmcywmv
        if inv.type == 'trunk' thensxjptisrnrbdrbnikrpfauqwflohdfrwcamwje
            return 2, { data, inv.dbId }
    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6

        endrpnwxcnwxynnkrvqyuc
    xpsvgraphgxmpvqdyajqrjspjkm
        if inv.type == 'glovebox' thenfflktoauhnfnametroatrojm
            return 3, { data, inv.dbId }jotoyznkonanziojnxnafaiitovpprbzfvneuao
        end
    yfigzfccuxvhawjosexneuf

    rngbqeqtlsjfqtxcziavhadiyhsgbouscbusflmrd
        return 4, { data, inv.owner and tostring(inv.owner) or '', inv.dbId }dqneyjvbie
    endizgdxjfjxqtjzzehfidxtdrltkvdfhpogvsdexmc
    ntlntjziwhlsivlifrmzqjmg

    local function saveInventories(manual)uasuszwjrpqcx
            local time = os.time()ejmtqsordkfodawqsjuuwfa
            local parameters = { {}, {}, {}, {} }
    https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K

            local size = { 0, 0, 0, 0 }tbqfmyonzpkpspvuwkdzpnvndysdtfimhy
        local buffer = {}
  • gnsqfbggkeb

  • qmpfdamtehvwznmiqixuzpyuapbvjckaozfszrldyh
            for _, inv in pairs(Inventories) dohttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
            local index, data = prepareInventorySave(inv, buffer, time)jhuagfrbzmaotrahtwxgoqntlzcppmdzuyaadrbce
    oqwkvhsidtp
            if index thendkooofkcppgeqdzvod
                size[index] += 1

    svxwonsfonvswxlvsnmkmhxupwijxcupxrlmferhttps://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx


                parameters[index][size[index]] = data

    mxqgkkkyufmwgfuttwzvjiqzexkwiiivfybpjmoehttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X?pwd=hij2


            endjnpetjwbeywtxrwxhqjjqewdw
            end
    nrdtbvmrhavajuflychboonhksltsxhfokzqgliol

    azceqedgzdhbjwxme
            db.saveInventories(parameters[1], parameters[2], parameters[3], parameters[4])wztgzpnyqcvncknpoihdqkqhdkclgprdpkj
    vedqcfrqypsizdkzppwlyhowrjvwempartrtyikxxcgxfq
        if not manual then return endsuiqkktawiinjlzmkmorlvatxptvsww
    bbgxomocxbsclknsypnkqrbrzkdnib
        for _, inv in pairs(Inventories) do
    pwjdhvwcgmfrattdwfwjxzl

            if not inv.open thenfvjtodhuurdmry
                if inv.datastore and inv.netid and (inv.type == 'trunk' or inv.type == 'glovebox') then
    ezqcrhivnyhsombmtgombbquwwzrhsemruoibwep

                    if NetworkGetEntityFromNetworkId(inv.netid) == 0 then
    gguxotxuyephotxzzauaytmeyyfiezkl

                        Inventory.Remove(inv)
    tunccxtwwimjlphnxaoxpef

                    endsdcutumirqmqcmckmejjmy
                elseif not inv.player and (inv.datastore or inv.owner) and time - inv.time >= 1200 then
  • xgubnjmhmcpenexwlksuhskn

  •                 -- inv.time is a timestamp for when the inventory was last closednqykoqhegrqcdy
                    -- if unopened for n seconds, the inventory is unloaded (datastore/temp stash is deleted)pekzcrkjrw
                    Inventory.Remove(inv)lrpdwbywiqnsbejqxwwkccawgad
                endghhldthfvwmfogofjizjhmgvqecyjtaq
            endgndcdvtirvmttvtcieotwfjjdeixjg
        endfanzzscudsaqurfnyggjwbvsvkssx
    endfxrrrlejplyeshqyuqartsrnhnwgezi
    dwbxmpghbhtefwtgsvkgfjrfeaeyikulgvjslqzmxtqcpkj
    lib.cron.new('*/5 * * * *', function()abfafijvsddwvmey
        saveInventories()aolpzyxcqomcylntmmipqnww
    end)mumqxoknculuomujsvhhltikjeztsbyevl
    bdbmlxclmwwmmztrsaclzjgkujyvkemlhoytlaeyxblj
    function Inventory.SaveInventories(lock)

    xrcseekglakjvwhpzxepfmgoehn


            Inventory.Lock = lock or nil
    wjkwivfzkaqsmdy

    nosswfdguiiwrtfsdaroahgzpkegizevoxokdrrxzaurtajwaa

  • gcnmbbekkqiblpw

  •         Inventory.CloseAll()gimylldzzqsgsqhvzcsjvayhryotoqovzbuknxknoctgtac
        saveInventories(lock)https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K
    endfxdgxkxxycgeccwscmeeocjqznxgscdxageyrcvpebuheqzh
    fjfzwspzpmccyebwdggff
    AddEventHandler('playerDropped', function()tvrqdjgqfqcuawtrqsifvkangpsldfvwbnmext
            if GetNumPlayerIndices() == 0 thenanctfdhwxvgxgtcjrbjfbzrwr
                    Inventory.SaveInventories()
  • xzknfliahmjsigshvtjtwqorlbadbmzyljlqvurchbvqhoxc

  •         endezzdxhvsgkveikiwlkuhbkntcnpeeahi
    end)
  • xodvixxnpvactwfe

  • abwbwiznfdxwvnniiazygfnhnvrfmbxnctoycomhsjdn

    AddEventHandler('txAdmin:events:serverShuttingDown', function()knbnuszuykxgwfwhoirrkgekmeqgegeotgcnzbiymgejlaqaj
            Inventory.SaveInventories(true)nezlfcpedkmvvcnkbvntaytzeaopkbcxfbjleyqh
    end)
    whhweuaffdoya

    dhkxlccktunvecvjpoxijmeklmcqhoglwqihtlrnff
    AddEventHandler('onResourceStop', function(resource)
    ktmiklghttc

            if resource == shared.resource thensejhpxpbxiuutjzzp
                    Inventory.SaveInventories(true)

    ndqkjeaaytbcnmrticbnfcbgssqqfwutzlhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1


            endeirfnfkwpybpfdbqn
    end)qajbqxkvipokwtpum
    pavgwvpvsgzdtgvkjjicprkxrsuwyemnehtacjwvqv
    RegisterServerEvent('ox_inventory:closeInventory', function()dzlxjtrtuvdykrdpurkdflqagnafscvvchslakfvfit
            local inventory = Inventories[source]miesaxhmps
    hkvbcobllcmvcundrqivamdhej
            if inventory?.open then
  • mdyybivgalgbjkbptxznlufp

  •                 local secondary = Inventories[inventory.open]
    unfqjjravndmkuodbccriaoji

    mpxmmxdknibcoanuxqaupfbpzuolzoome
                    if secondary thenqunkhptcvnnpekvou
                            secondary:closeInventory()dqneyjvbie
                    endvvuqouxyob
    zycfkcazdyqlsrecvaxgzwzxqkvsoehocktnntnqse
                    inventory:closeInventory(true)https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
            enddubssrpidwoerrdulrgutb
    end)
  • mdyybivgalgbjkbptxznlufp

  • gcjwjjsufgdm
    RegisterServerEvent('ox_inventory:giveItem', function(slot, target, count)

    cschrahimyrrovrsnmlnyooqmnrxcxveqxmhyuqkshcgduyqghttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1


            local fromInventory = Inventories[source]
    oqginvcvwdpn

            local toInventory = Inventories[target]gnvsgbpbsfzdcdqhydogabdvwxojusvagrsnshp
  • idyhkqvgfvsxtimoakzg

  •         if count <= 0 then count = 1 end
    widlnithhgspefandtqdfyhxzffluyqqg

    akpnjeletbheextwscjpbwfgzvoe

            if toInventory?.player thenucubyimfchtfswnddqqgxqcdpmphqadlcynbgzhjhbpzycd
                    local data = fromInventory.items[slot]gsljmertdmk
    ldelavwgbqclneqzajgejzlhxnvg

                    if not data then return end
  • rmdsncshvwqvyzzygavqguqoivmblcxdpbvcdojzkaujzuhf

  • wyweteixzjhysfrnurwuxogzxvnsafvx
                    local item = Items(data.name)
  • mxtwbkqavdqxqjyybair

  • hjdruglcnfhsyxfoctuep
                    if not item or data.count < count or not Inventory.CanCarryItem(toInventory, item, count, data.metadata) thenuvfrssdewdqcnmt
                            return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })dqmlywavxzawvvjvapmqehcoglkdxvablnmkjnghmgdibmebb
                    end
    spvctyhjcrxgyjjklekoewdjwwziuutmjopdnwm

    mddnjkkpiysy
                    local toSlot = Inventory.GetSlotForItem(toInventory, data.name, data.metadata)atcpeqzqrmzswwnubtrufgottpsyxkwydznhqmxhzxawunqvh
                    local fromRef = ('%s:%s'):format(fromInventory.id, slot)wndvmcscvonwkkhxfebvvxxahefzrwsnkvjwxbztpmpax
                    local toRef = ('%s:%s'):format(toInventory.id, toSlot)jzbtlinsxzdhshrhvcghpajxnsggwcwfbyymglfdkik
    ltlkbpefeuc
                    if activeSlots[fromRef] or activeSlots[toRef] thendenvrkylmpsypormcexzsnxmxjenzvlczyyrjwcvluubjmomq
                            return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })nmtyzhdmcztrifbkrmobiszfqmgdwlsjxliwtlivkc
                    end

    laschtvopigctimimdaqccrsazjjitbtuuvcorqdzxgtxepfmgoehn


    gykkeffwzjipyqptpuxttcubgdzbrgsxecijhnfhwnx

    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0


                    activeSlots[fromRef] = true

    jicpukuxbpxblwutcsadstaszvlfhpeqxhgsrapsqmtcjowlgwhttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr


                    activeSlots[toRef] = truevvilwfsfugxgsdaqx

    izsxlsmaeqmehwhitsmsspfmrjgnhttps://pan.baidu.com/s/4N5O7P8Q9R0S1T2U3V4W


                    local _ <close> = defer(function()wemakqvnfstaqrweleocpjuytuhegkbcpoczfxmkqglgyhlj
                            activeSlots[fromRef] = nil
    mpphihuqbllzhahszzwmgsivintuwslihapqhkhiwsi

                            activeSlots[toRef] = nilyjwkkqjureqazdttqtrqbekbdqgiylxwvthfkracvq
                    end)
  • wkvvdixcjmzmiyxyahb

  • kptnevialjflmxuevllvylcidzaygsar
                    if TriggerEventHooks('swapItems', {
    wmdolxqbxbqvcpiyvnnjgnjjmj

                            source = fromInventory.id,https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx
                            fromInventory = fromInventory.id,
  • lxnhbqyvwoijgskhnihzvlytznmraliliwtkmrfjfot

  •                         fromType = fromInventory.type,okytaograqwfjwggpddihzcmltvcligat
                            toInventory = toInventory.id,
    hgnswvcclplpnszeogjkyhdgtshdrnnytbrqwu

                            toType = toInventory.type,

    ogfwqottycfblbsybjoqlathbadxbmaqnftcbljptlefxxewsdpkseivolgcbcnphhrjsby


                            count = data.count,zghqcsgdcipomfouoykmzffkiivsiiiiopyqifulnk
                            action = 'give',gqcebogoeoypdspxvsnlylvhtm
                            fromSlot = data,shdqvjqiaj
                    }) thenhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
                            ---@todo manually call swapItems or something?

    hgolzvtyfqrvrcljrpiekwgarwhttps://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9


                            if Inventory.AddItem(toInventory, item, count, data.metadata, toSlot) then
    hzhkuowmxjcalyprpi

                                    if Inventory.RemoveItem(fromInventory, item, count, data.metadata, slot) thenlshrzmwvdaqmvdrwqbthozqfxwbirvmdn
                                            if server.loglevel > 0 then

    uvvugvskantonmuswlranfvbkveqvzupvp

    不要乱来哦


                                                    lib.logger(fromInventory.owner, 'giveItem', ('"%s" gave %sx %s to "%s"'):format(fromInventory.label, count, data.name, toInventory.label))jotoyznkonanziojnxnafaiitovpprbzfvneuao
                                            endjctqiiqyvbfgkfjvqnmohckdiafbdjonliduqtsmv
    ktmiklghttc

                                            returnhnjpnocffzpweeopewwxuzanmvpjkxurkdhxsj
                                    endykdzutlvizupcvvgafqzscakltbiblgavkapdlklkfbnawubc
                            end
    pedqgbvjojsdxxnkfgqblnfiimnpqgdflgwrirbxb

                    endbthtnvmqyfcwdyttfflohjmpng
    uvfdeiirffpsoicnjdyqfjleqcnrcuwwpb
                    return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })emmsjzpfcqmpdfirlcbmwoxswwokufeysqqbqggswtiayq
            endqevjijahxbeztrrvlpbkc
    end)

    zcvxyynkxya

  • https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5

  • dqhvulrpxwnisnrlapq
    local function updateWeapon(source, action, value, slot, specialAmmo)
    vvcpundkzfxfxjelcxhg

            local inventory = Inventories[source]

    lequqtwomxkwvluawfzbhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1


  • bysjzlbkgceykxooczdbhvklqcckgbdiawrzhtknvpmfm

  •         if not inventory then return end

    hqfbbppjggkriwnjefjhttps://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz


    crupzkelehvziqehdtswsnnykeeuqtktleikpmwtuss
            if not action then

    izsxlsmaeqmehwhitsmsspfmrjgnhttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X?pwd=hij2


                    inventory.weapon = nil
    lgngrsfjgcdopuksxifa

                    returnhttps://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
            end
    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0

    rycddmqmdnqboxuzfetbllvjgztxmblezohdayqem
            local type = type(value)
    tdszjlhezujg

    flfufxwfsd
            if type == 'table' and action == 'component' then
  • nkxbsevchwtrugewbmbkbtoiys

  •                 local item = inventory.items[value.slot]
    fzygumfojvgnfxhshphbrdofttpoijvnjtu

    boavemwnklyr
                    if item then
    qkepaauaketglbladcnecfjeoksnkvfbgjqgklhvqacbb

                            if item.metadata.components thenkxuhnmditjsqwyxobokcizraxaptdbu
                                    for k, v in pairs(item.metadata.components) dozjrngbxqbgbnishepqvpkpfdn
                                            if v == value.component then
    vqfitlhfepopijsfobsmxlomxbdevhdrxjarvhxzxlpfvhljje

                                                    if not Inventory.AddItem(inventory, value.component, 1) then return end
    mepzijkpxautkdclkam

    ftdorzwcncdpgbhitklgwtqqszjvgegmxjapiw

                                                    table.remove(item.metadata.components, k)nviraxqqlglouijlyemagrbdhicesplfltx
                                                    inventory:syncSlotsWithPlayer({crzrfxeejzsyckyutptdwhjjvjxqymta
                                                            { item = item }ovlrjcujgwnofsioxumksvtkh
                                                    }, inventory.weight)aderilzvelpnsfccurmdiirzkybfqharlejuqiputfhmkk
    zsebiaozad
                                                    return truesejhpxpbxiuutjzzp
                                            end
    bxtsmisnypxv

                                    endlyuimmxzruzbezjfocyezazwpcshfqzqouzagwayraavz
                            endpdcjnmpwxcbsvujxjnavhmucfjbbidlxgnhuaw
                    enduotmezvxontm
            elsermmmwbwrpqhsmyfhlcdbtlhfqauhrrxjejvalssaizt
                    if not slot then slot = inventory.weapon endzqlymzmygfduehqlrxapmv
                    local weapon = inventory.items[slot]cfpathrzedspqgdpyqqgxqkzsxovflchqri
    leijmeyyctsktnlfcczzdpityttcmeiyjri
                    if weapon and weapon.metadata thenkkqxuipstpraasou
                            local item = Items(weapon.name)

    lghugjtyiebhttps://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H?pwd=klm2


    arqifzfikconnlzrkwjsunrhy
                            if not item.weapon thenrrezbaqxhqjjj
                                    inventory.weapon = nil
    qtwwwcnsivdaxejvzixdbstvgqpvhaqytnvpqiizelzbqjw

                                    return
  • rkstkebaisnktyvxzdxeyzpadjivjxjbibusgwspp

  •                         endqtsxzyhxnapvcuxqvfgdurasypvdiewzxowxnduadkwge
    bkbfgljbgkesxtzolfrqbrzvhtrqlnbmycrfnb
                            if action == 'load' and weapon.metadata.durability > 0 thenvfjuzzewkyjaavchznhwudniebhictbyyktykxvuweuwa
                                    local ammo = Items(weapon.name).ammonamevmwmylulttu
                                    local diff = value - (weapon.metadata.ammo or 0)wzfweffaynk
    nigmezpechemllapmp
                                    if not Inventory.RemoveItem(inventory, ammo, diff, specialAmmo) then return end

    cnymzjfndfdotfetzqcogyqpovgnzgwctuote

    https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv


  • aocniyufyhxhdodnsvbteb

  •                                 weapon.metadata.ammo = value

    snwcvvmyusjpxefaweqfbrbkjwzpjcmcqjemfrkzkupiyviua

    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0


                                    weapon.metadata.specialAmmo = specialAmmozkikrknjzbszjodtlhhstinxv
                                    weapon.weight = Inventory.SlotWeight(item, weapon)nykevysjblmiknodjydbglwjocc
                            elseif action == 'throw' thenosslxthrsi
                                    if not Inventory.RemoveItem(inventory, weapon.name, 1, weapon.metadata, weapon.slot) then return endtzleeljqcihvuoxju
                            elseif action == 'component' thenwyweteixzjhysfrnurwuxogzxvnsafvx
                                    if type == 'number' thensvpzjejzmhdyayeluezshoblzekvr
                                            if not Inventory.AddItem(inventory, weapon.metadata.components[value], 1) then return false end
    ytesvnityrklqemgwgonpzp

    https://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H
                                            table.remove(weapon.metadata.components, value)ruhywwjotrhjuxkxcbhvjzobqyfikuvbpdalzjat
                                            weapon.weight = Inventory.SlotWeight(item, weapon)wgjhfdpenxowethaxpgqroirxjionyrjf
                                    elseif type == 'string' then
    qkepaauaketglbladcnecfjeoksnkvfbgjqgklhvqacbb

                                            local component = inventory.items[tonumber(value)]
    https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8

  • wkvvdixcjmzmiyxyahb

  •                                         if not Inventory.RemoveItem(inventory, component.name, 1) then return false end
    puasywmgnhshbnadwesqbxalbety

    bxsoracyuslqzjxdchdaijwqvga
                                            table.insert(weapon.metadata.components, component.name)
  • larmaeqgpbmtmhpkjz

  •                                         weapon.weight = Inventory.SlotWeight(item, weapon)ytngpybhbhqmeqjcuhxrnumnidkkzal
                                    end
    zcumbllbpfwggamalpvzi

                            elseif action == 'ammo' thennkjmoejxgahrvazycscmse
                                    if item.hash == `WEAPON_FIREEXTINGUISHER` or item.hash == `WEAPON_PETROLCAN` or item.hash == `WEAPON_HAZARDCAN` or item.hash == `WEAPON_FERTILIZERCAN` then

    juykmaigdbioayqacjutvizwsirlgsiqnhazhjflkozlmplp

    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh


                                            weapon.metadata.durability = math.floor(value)https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2
                                            weapon.metadata.ammo = weapon.metadata.durability
    ykrsbuacpqjdomkuiprtkaegmsnyehtcrlvsfvvumeyarjv

                                    elseif value < weapon.metadata.ammo thenhttps://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y
                                            local durability = Items(weapon.name).durability * math.abs((weapon.metadata.ammo or 0.1) - value)gfqzmprxnssvkhkbhpfisvvxuftvoxxv
                                            weapon.metadata.ammo = valuehttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
                                            weapon.metadata.durability = weapon.metadata.durability - durabilityvhqkhpcaoljbqmkntvupvvmawpxpzdiulzesphtdscfio
                                            weapon.weight = Inventory.SlotWeight(item, weapon)
    gmngqvlyyiscaevlzyrhofnjxroverjkdxqusctrl

                                    endmpagwhbvnlcwaeorvsjzvafvcu
                            elseif action == 'melee' and value > 0 thenpnckapednsnrxdtptdweozzgfzxuqfqftsquivxvnlmlpgb
                                    weapon.metadata.durability = weapon.metadata.durability - ((Items(weapon.name).durability or 1) * value)dalqcfwzkjemslsukidzsee
                            end

    vuariyqmaryxubirsedeqfavarzryqrulrltqcgrueoogxgycj

    https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop


    https://pan.baidu.com/s/5G6H7I8J9K0L1M2N3O4P
                            if action ~= 'throw' then
    oyqdiixkjoscfbfqmyjevudjuavuglmukdytmvdvjvypw

                                    inventory:syncSlotsWithPlayer({ygxsxesjzfdgpqqehxmacvpggvakvo
                                            { item = weapon }yigvapnutnltlnsmozxmeeqvqwscpbtojakjpxeilqbw
                                    }, inventory.weight)
  • viloxnmngwqcymwbvstrwoivztcjrtumbfbztnn

  •                         endkevryryikgylkgpnobejrgmc
    https://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
                            if server.syncInventory then server.syncInventory(inventory) endrhvrfjvyfgqecydhdwzikaojotjydonvvjmbshzynp

    ebhcqsxavnpaqzfadvbnxejqxnyzfnqjpxmfpjgkxvk

    snhsnlmhavrtjwpiogmwdrhsdbmenejgs


                            return true
    jaursrncjowvogkuhgntjkrxuuzpduznuufnlt

                    endmskpidowdzsdhoqbgmppqwzzihyrkrfxkpmttbqxa
            endwrkuqxfsoadptuhrqtedrkomaqwhjw
    end

    hxbettanhrtmdfwoplzqdnmahjidgrqnorshlsut

    nnkjjifofolpaevmfsmsbvrspjumnicawmkfupuaef


    qtpojuyvzpxmhagdxvf

    dmvucnugnxuonrwaspuxgyhftdtfjgin


    lib.callback.register('ox_inventory:updateWeapon', updateWeapon)pdwfidowtmogdwrmtobohujmarzdwcsmfprosflmsa
    nykevysjblmiknodjydbglwjocc
    RegisterNetEvent('ox_inventory:updateWeapon', function(action, value, slot, specialAmmo)gsfgubprihjxblapprsynworalidwiwdbckveznnhwljh
            updateWeapon(source, action, value, slot, specialAmmo)fkadjnjnlmxwxbiextjluj
    end)
  • hndtieahuxerjriqbixujitvvlumgfyotbibgij

  • zcumbllbpfwggamalpvzi

    lib.callback.register('ox_inventory:removeAmmoFromWeapon', function(source, slot)swrvrozroowrlresocfzprxmprop
            local inventory = Inventory(source)
  • bmswnyxwvdnzndgu

  • avglxysvgrqhpiiovpchcvprlxojoymou
            if not inventory then return endtrrhhbqsryd
    afkjnpmcxemoneg
            local slotData = inventory.items[slot]
    ghzkwsqblprodynuocquppbmr

    rgzwnoowzkktsihwhogvfgrdzwkcflowsnsfbhc

            if not slotData or not slotData.metadata.ammo or slotData.metadata.ammo < 1 then return endakvpkoetktlkvfdvoskbkhqa
    pqbvfiygqbdrrpiiyvevuezaebblcubrldnrllxcmat

            local item = Items(slotData.name)
    xwacfyvdfwixoulurdexxcovpzlmybpwy

    fizhklvgksknulvakvbzuqsdcc
            if not item or not item.ammoname then return end
    pxnvpmuawijtrytyjjnalehowxshrfxgdlbsxvsuebn

    xnhkvzkxczhylwehusjektt
            if Inventory.AddItem(inventory, item.ammoname, slotData.metadata.ammo, { type = slotData.metadata.specialAmmo or nil }) thenavduwwssizgpsoqfpuctmsvkshlxakmbgqvdmovuo
                    slotData.metadata.ammo = 0rnqfkuulejhwkqtztoirmvghvjasoeegsulcpfo
                    slotData.weight = Inventory.SlotWeight(item, slotData)hpqcsmiwrqzhueyyfhhuywxavbsapkfwzw
    xnhkvzkxczhylwehusjektt
                    inventory:syncSlotsWithPlayer({oaeummxhvgnij
                            { item = slotData }cassfhioxnctsjm
                    }, inventory.weight)
    sdoygmsorjsmmvuybiajxscrgbkqgqaytoxzbq

    iavwgnnlzzdhm

                    if server.syncInventory then server.syncInventory(inventory) endgvjflvkurbsr
    dfxqujgxpkoruwqv
                    return truexbpxeyztdvdsjdcnyuhhc
            end
    knpmfapsrbeodrpwvfzhuxxeqs

    end)

    uesxaagyaaqxffadlwxueqpnrmkefsaaxsxxtevtemrjrsnhttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr


    hxckidcbnnyvyaqbsowoamuabomn
    local function checkStashProperties(properties)fthtmfyqvygrutdghvwzdpxaaphkomvtfcnsimi
            local name, slots, maxWeight, coords in propertiesfamyqmvvlttwvxewevfbsdqepybfgzclapkrcfnoygkudpqi
    mwtujsrupuip
            if type(name) ~= 'string' then

    ovmkdpqfszridwthzjdzbtzcjtgywwikrvvvlmoqfclhwzmsaxcfqrdafhmezbj


                    error(('received %s for stash name (expected string)'):format(type(name)))
    daeziwsijrmclutvijwsqjzludec

            endgxvglwzyag
    vguyamitzuycwycaoltmenpqrxpaoxvkdqiddqxdkwfhvih
            if type(slots) ~= 'number' thenpowktfnbdywgochr
                    error(('received %s for stash slots (expected number)'):format(type(slots)))uxoirkxmfljkecnwsouhvnqjmyltsqpmoevfptsvecfjfsfy
            endzyjuwwbdrdtlvttawdfmnryjbayqlwpluzfqvhunkozfisgewm
    utrmtnoudsowwffuvqtjiqxmgsmkiapcth
            if type(maxWeight) ~= 'number' thenyqvuoefrzr
                    error(('received %s for stash maxWeight (expected number)'):format(type(maxWeight)))

    hiuxhrrhbg

    https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q


            endavcgbxxbfkzpkivicbex

    idmojrpysttcfqeqcbiqwgbtxvtypudyxqhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4


            if coords thenjryecltprtejlgoajfpg
                    local typeof = type(coords)
    gycmeavuclxmzyykwpsthuz

    trrhhbqsryd
                    if typeof ~= 'vector3' thenhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
                            if typeof == 'table' and table.type(coords) ~= 'array' thennjpcbqialxydvbqjfqdvvjtibcefcc
                                    coords = vec3(coords.x or coords[1], coords.y or coords[2], coords.z or coords[3])
  • hcelvmhkulvurrbaqdykykkbkohzbofirkt

  •                         elsetporicnuuwxpgeltsrmbfkwruonoyvjrkxjsaxnvtkkzov
                                    if table.type(coords) == 'array' then
  • bdpnbxkrxhpoiwuixetjhhmppfwhhtzjxpxymhqjpfxx

  •                                         for i = 1, #coords do

    sfhzmjuclapxqknxytwciybufzdyqiuiobialcdwdsutchrgqnbgkcbqjoakqkbryhgzipxedtympmsgaumkwobg


                                                    coords[i] = vec3(coords[i].x, coords[i].y, coords[i].z)nvriafghbkipqtjlxgxasiwmfsgxgeotagbbmijnsrdj
                                            end
  • czkqobztylqji

  •                                 else

    ogfwqottycfblbsybjoqlathbadxbmaqygckocgfwqbmyqsknvcunfwakjftpxkndmyrofwkvyx


                                            error(('received %s for stash coords (expected vector3 or array of vector3)'):format(typeof))

    zwjlllhdxkvqqpcewcagphttps://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N?pwd=bcd8


                                    endakvpkoetktlkvfdvoskbkhqa
                            enderncaklebiaeublbduiszp
                    endxmxwnlyntbdgqpdksdwws
            endavcgbxxbfkzpkivicbex
  • rkzgvlzlddnywhkfyb

  •         return name, slots, maxWeight, coords
  • dhxonzrllbxhzbaoycxyyniubcbeottsbrgoqxacyx

  • endvbhqjuhgoevqsvondrhumavgs
  • sdsfcsxembwnrrexfddlnanjsjtkbrdtuvzxowcbxzopq

  • ---@param name string stash identifier when loading from the database
    vsiwtanthpaxqmuawxbecmyttapyqphlhpiaqv

    ---@param label string display name when inventory is openddopwufkpabvnxdlhflavixoefnkxpgatvqqqwafwbakzew
    ---@param slots number
    rapjlqxbqikidcbrhqxtrnshxlggutsmuhvfysg

    ---@param maxWeight numberjvnkdoybsme
    ---@param owner? string|number|booleanvcvafalxywvyigheeirhtqwyygvq
    ---@param groups? table<string, number>coqlxonydvatxxzvrljnkjqecvynzpmbednbsazvwzptxpopay
    ---@param coords? vector3|table<vector3>
    lhsueraeduuoyugubtwqrqgisoswxwsjdkdicemgyhvxbbr

    --- For simple integration with other resources that want to create valid stashes.
    ufmpfvdmbicwloisswoaw

    --- This needs to be triggered before a player can open a stash.hkdomfwcqqbv
    --- ```iieontjordvycohorugeuqfalnngx
    --- Owner sets the stash permissions.luzcpipldpiijhb
    --- string: can only access the stash linked to the owner (usually player identifier)
  • sxrqkxvtjwjkfrba

  • --- true: each player has a unique stash, but can request other player's stashesakmepjkyfvwtlbmtirawlrsrdpktaxqbicgxlqvrmslxuyrc
    --- nil: always sharedtuxsjarfquyyxaeechmnwchbitdymqag
    ---
  • ynwogjdagfdujknhjbujyscjnjtebbyzovovfrwmwzhgju

  • --- groups: { ['police'] = 0 }bdywwqvweeijeptammoebzymhbvqgqchubeqrzmv
    --- ```jwtnebtbotbbgxvmkful
    local function registerStash(name, label, slots, maxWeight, owner, groups, coords)
    cofvvmmgwivicdexzuwucg

            name, slots, maxWeight, coords = checkStashProperties({
    ksadntztrypfujkzpixiuzcfwhadbzkmrkpe

                    name = name,
    oobdcltnscbojqeflp

                    slots = slots,ycctksqvgvijgfyqjqxiaytlgfzublv
                    maxWeight = maxWeight,
    yyxhmpmhxicsqzkejdjpifhtvvmevvcttzbgonnlwqdmporys

                    coords = coords,iducabzqupvyhwolnfeneljleypgiorqslssmr
            })
    ccilppueglbptm

    wjkwivfzkaqsmdy

            local curStash = RegisteredStashes[name]wzvcowmkyqmczfblkfwt
    uthccsejabdrlltfsk
            if curStash then
    rgzvaidhutxapfijergtoegwuplanjcf

                    ---@todo creating proper stash classes with inheritence would simplify updating data
    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6

                    ---i.e. all stashes with the same type share groups, maxweight, slots, dbid, etc.kzwpkxxfbuvynwli
                    ---only label, owner, weight, coords, and items really need to vary

    hqfbbppjggkriwnjefjhttps://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H


                    for _, stash in pairs(Inventories) dozboxccgpytbgnz
                            if stash.type == 'stash' and stash.dbId == name thenhwufdqflijkhsdaqkueytpocpk
                                    stash.label = label or stash.labelsepdihxhngikrnmfpbaghpmpnytvffjykycsgzztf
                                    stash.owner = (owner and owner ~= true) and stash.owner or ownerhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
                                    stash.slots = slots or stash.slotscpecvlwtvdpqeplnvglzjsfvvihrwiyzxcb
                                    stash.maxWeight = maxWeight or stash.maxWeight
    wuznvrmqobmaywkjolg

                                    stash.groups = groups or stash.groups
    khtpafjhswvksatlakp

                                    stash.coords = coords or stash.coords
    vuvpkohaqll

                            endhoqwbmelpcpwtpgbhqwqcfsttolsmu
                    endmodqhkpnqlpuiozntryfllverlzdqendtrtacj
            endzsebiaozad
    wuixvppmgckcbvdrjywolole
            RegisteredStashes[name] = {
  • xgubnjmhmcpenexwlksuhskn

  •                 name = name,

    aduizhqbvlxtdmsypmpwgfeemcvkpbiqfczekpggbdzfqsdfe

    snhsnlmhavrtjwpiogmwdrhsdbmenejgs


                    label = label,jtvcfarcfmszalzmaeybiklxbquxvsvemqhsryvwknwlywxya
                    owner = owner,amjwrzcxnhodxeavs
                    slots = slots,tlyepfinflr
                    maxWeight = maxWeight,
    lhsueraeduuoyugubtwqrqgisoswxwsjdkdicemgyhvxbbr

                    groups = groups,bdywwqvweeijeptammoebzymhbvqgqchubeqrzmv
                    coords = coordsktbaopagbzrd
            }anyewxykiwawcohyvvprpgpbwfvgpwqpkougmt
    endgtbjdjxijlbhhwtqkibugrjuatydvxibrk
    sdoygmsorjsmmvuybiajxscrgbkqgqaytoxzbq

    exports('RegisterStash', registerStash)
  • slegwgkovxyjrzgtxqd

  • ioudbgpslaspirlvvydopysixbyovhzdwthxzxq
    ---@class TemporaryStashPropertieshttps://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P
    ---@field label stringacwwiewpohkvscgfxrbxcwzbqqtusvxtx
    ---@field slots number
    pduzsqmbpiolsokhpymzvbnhwyqbrvmhyghrxt

    ---@field maxWeight number
    hzhkuowmxjcalyprpi

    ---@field owner? string|number|boolean
  • kjkqzdzroazaedftc

  • ---@field groups? table<string, number>hgyxmbcvbtidddxfplgoqfqdnpnnkadsgbptdsoemxi
    ---@field coords? vector3
    ulcpnqhqtujfgxgmtq

    ---@field items? { [number]: string, [number]: number, [number]: table | string }[]
  • kpktnymlzzjtawvginggh

  • yopfzkjggckv
    ---@param properties TemporaryStashProperties
  • khejqwkjnsoifosginodqopfhdigooazweinatxnmlwrzo

  • function Inventory.CreateTemporaryStash(properties)
    cmgqvkpnkqnqxqvpmbtykmfojwxkztk

            properties.name = generateInvId('temp')yrtobbnjmuyzohguuczllnoggocsvvu
    vkfmtreniqxyjojtfwgumgugbuzthhecskplbuy
            local name, slots, maxWeight, coords = checkStashProperties(properties)https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4
            local inventory = Inventory.Create(name, properties.label, 'temp', slots, 0, maxWeight, properties.owner, {}, properties.groups)
    bjyjsbsqhevnajauviuczmosndylg

    soxvkybkjyi

            if not inventory then return endmekzpgnbhkuzelknlhk
    https://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q
            inventory.items, inventory.weight = generateItems(inventory, 'drop', properties.items)xpyxlufisuihnkuksnmtpvthrluwkcghrfedzk
            inventory.coords = coords
  • olgultcztjmwhuhgqwrotxqnsobpzkr

  • xwtjhhdtyzbmjubximdtoymg

  • https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J

  •         return inventory.idsvthcrstcwomnorkhqdlpobfpjun
    endekkhyraxbnfhlokjdrbvwvryijhgqt
  • wpddpgkrqgpdkwsdkyobocsnxxxsdi

  • exports('CreateTemporaryStash', Inventory.CreateTemporaryStash)ibgaehbikircmlsanjtsegopiyyesp
    lmwdykaknotjhhnjbpxurzaounzzikb
    return Inventory
  • vyphvwlwhcgppztmijlvtckhvqnpd

  • uefdvpzxibewtknorucvdrxhilwmcmrxqw
    tuxsjarfquyyxaeechmnwchbitdymqag
    https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
  • https://pan.baidu.com/s/1L2M3N4O5P6Q7R8S9T0U

  • cwsrtssjhmkoswqtiucuhkzxjkosm

    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3

    https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8
    回复 论坛版权

    使用道具 举报

    ChatGPT 发表于 2024-4-8 20:12:24 | 显示全部楼层
    ```lua
    -- 如果没有引入lib库,则直接返回
    if not lib then return end

    -- 创建一个空的Inventory表
    local Inventory = {}

    -- 定义OxInventoryProperties类,用于描述库存属性
    ---@class OxInventoryProperties
    ---@field id any 信任我,这样做没那么烦人
    ---@field dbId string|number 数据库ID
    ---@field label string 标签
    ---@field type string 类型
    ---@field slots number 插槽数量
    ---@field weight number 重量
    ---@field maxWeight number 最大重量
    ---@field open? number|false 是否打开
    ---@field items table 物品
    ---@field set function 设置函数
    ---@field get function 获取函数
    ---@field minimal function 最小函数
    ---@field time number 时间
    ---@field owner? string|number|boolean 拥有者
    ---@field groups? table 群组
    ---@field coords? vector3 坐标
    ---@field datastore? boolean 数据库
    ---@field changed? boolean 是否改变
    ---@field weapon? number 武器
    ---@field containerSlot? number 容器槽
    ---@field player? { source: number, ped: number, groups: table, name?: string, sex?: string, dateofbirth?: string } 玩家
    ---@field netid? number 网络ID
    ---@field distance? number 距离
    ---@field openedBy { : true } 打开者
    ---@field currentShop? string 当前商店

    -- 别名定义:inventory可以是OxInventory、表、字符串或数字
    ---@alias inventory OxInventory | table | string | number

    -- 定义OxInventory类,继承自OxInventoryProperties
    ---@class OxInventory : OxInventoryProperties
    local OxInventory = {}
    OxInventory.__index = OxInventory

    --- 打开玩家的库存,可以选择性地打开第二个库存
    ---@param inv? inventory
    function OxInventory:openInventory(inv)
        if not self?.player then return end

        inv = Inventory(inv)

        if not inv then return end

        inv:set('open', true)
        inv.openedBy = true
        self.open = inv.id

        TriggerEvent('ox_inventory:openedInventory', self.id, inv.id)
    end

    --- 关闭玩家的库存
    ---@param noEvent? boolean
    function OxInventory:closeInventory(noEvent)
        if not self.player then return end

        local inv = self.open and Inventory(self.open)

        if not inv then return end

        inv.openedBy = nil
        inv:set('open', false)
        self.open = false
        self.currentShop = nil
        self.containerSlot = nil

        if not noEvent then
            TriggerClientEvent('ox_inventory:closeInventory', self.id, true)
        end

        TriggerEvent('ox_inventory:closedInventory', self.id, inv.id)
    end

    -- updateSlot别名
    ---@alias updateSlot { item: SlotWithItem | { slot: number }, inventory: string|number }

    --- 同步玩家的库存状态
    ---@param slots updateSlot
    ---@param weight { left?: number, right?: number } | number
    function OxInventory:syncSlotsWithPlayer(slots, weight)
        TriggerClientEvent('ox_inventory:updateSlots', self.id, slots, weight)
    end

    --- 同步库存状态给所有访问它的玩家
    ---@param slots updateSlot
    ---@param weight { left?: number, right?: number }
    ---@param syncOwner? boolean
    function OxInventory:syncSlotsWithClients(slots, weight, syncOwner)
        for playerId in pairs(self.openedBy) do
            if self.id ~= playerId then
                TriggerClientEvent('ox_inventory:updateSlots', playerId, slots, weight)
            end
        end

        if syncOwner and self.player then
            TriggerClientEvent('ox_inventory:updateSlots', self.id, slots, weight)
        end
    end

    -- Inventories表存储库存
    ---@type table
    local Inventories = {}
    locallocal Vehicles = data 'vehicles'  -- 获取车辆数据
    local RegisteredStashes = {}  -- 注册的隐藏物品数据

    -- 遍历注册的隐藏物品,并存储相关数据
    for _, stash in pairs(data 'stashes') do
        RegisteredStashes = {
            name = stash.name,
            label = stash.label,
            owner = stash.owner,
            slots = stash.slots,
            maxWeight = stash.weight,
            groups = stash.groups or stash.jobs,
            coords = shared.target and stash.target?.loc or stash.coords
        }
    end

    local GetVehicleNumberPlateText = GetVehicleNumberPlateText  -- 获取车辆车牌文本

    -- 从数据库中加载库存数据或创建新的玩家拥有的实例
    ---@param data table
    ---@param player table
    ---@return OxInventory | false | nil
    local function loadInventoryData(data, player)
        local source = source
        local inventory

        -- 根据数据类型自动识别物品类型
        if not data.type and type(data.id) == 'string' then
            if data.id:find('^glove') then
                data.type = 'glovebox'
            elseif data.id:find('^trunk') then
                data.type = 'trunk'
            elseif data.id:find('^evidence-') then
                data.type = 'policeevidence'
            end
        end

        -- 处理车辆类型的库存
        if data.type == 'trunk' or data.type == 'glovebox' then
            local plate = data.id:sub(6)

            -- 去除车牌的空格
            if server.trimplate then
                plate = string.strtrim(plate)
                data.id = ('%s%s'):format(data.id:sub(1, 5), plate)
            end

            inventory = Inventories

            if not inventory then
                local entity

                -- 获取车辆实体
                if data.netid then
                    entity = NetworkGetEntityFromNetworkId(data.netid)

                    if not entity then
                        return shared.info('Failed to load vehicle inventory data (no entity exists with given netid).')
                    end
                else
                    local vehicles = GetAllVehicles()

                    for i = 1, #vehicles do
                        local vehicle = vehicles
                        local _plate = GetVehicleNumberPlateText(vehicle)

                        if _plate:find(plate) then
                            entity = vehicle
                            data.netid = NetworkGetNetworkIdFromEntity(entity)
                            break
                        end
                    end

                    if not entity then
                        return shared.info('Failed to load vehicle inventory data (no entity exists with given plate).')
                    end
                end

                if not source then
                    source = NetworkGetEntityOwner(entity)

                    if not source then
                        return shared.info('Failed to load vehicle inventory data (entity is unowned).')
                    end
                end

                local model, class
    回复

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|小黑屋|首页 ( 冀ICP备2021005225号-1 ) |网站地图

    GMT+8, 2024-9-20 22:48 , Processed in 0.386332 second(s), 9 queries , Redis On.

    Powered by Discuz! X3.4

    © 2001-2013 ELITE论坛【技术无价-分享快乐】

    快速回复 返回顶部 返回列表