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

翻译一下

[复制链接]

升级进度: 83%

waaaa 发表于 2024-4-8 20:07:07 | 显示全部楼层 |阅读模式
if not lib then return endovlkmipfpiainumhacgxyiurbfplapno
caxvwkhoaiapotnfoclwdftbxbxrkaanbyjxj

local Inventory = {}

https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8 https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5


  • xalinqeqttiavhpjmdmcrh

  • ---@class OxInventoryPropertiesvbqkzcemasrduynphkhrypymlqkwszqnahxzjcmkuenpca
    ---@field id any trust me it's less annoying this waydchkzqbugdawtflajtejilkiqbjlfusjwzt
    ---@field dbId string|numberoqhhwatnnqdcsqtydqvrolcjtrxbcs
    ---@field label stringcrrxocltbfbhpuptjomrgbedrhddpcqrtiohlabm
    ---@field type stringitqxlgfyhtfckcjervnfjep
    ---@field slots numberfhabpshetcqeeeavzmifexcqyrumzkrfss
    ---@field weight numberxarkugwbuttmmxqxvjtzaevnosgmsvpqw
    ---@field maxWeight numberwlpbgojvnlo
    ---@field open? number|falsekyvythjozkalimar
    ---@field items table<number, SlotWithItem?>qzeqpnpdcvneatls
    ---@field set function
    https://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6

    ---@field get functionjpclivcwspzwrfeofegdbmkwzgcelikvxng
    ---@field minimal functionxygrtgsboxqyykwjbpntvxfwmwmzlcziafaumtvaqmypxuzykm
    ---@field time number
    wubzgfrulosynifkzsgwpdeuxypexdf

    ---@field owner? string|number|booleanpehuqcbmtzbinjsmsotbwfvrjvtqdfhtjpnaromlooub
    ---@field groups? table<string, number>jojgxqwfjnyaumlcfebyzxmabjnsqbxaqg
    ---@field coords? vector3xemwhuvudxjgdffjbhrlxjob
    ---@field datastore? boolean

    ggqemkmqhm

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


    ---@field changed? booleankdytdmaqfmrjfgsvlnfphiuoeplpqasb
    ---@field weapon? numberjdzpmtbxurvpbckfqoqvlommdktrxahgehvqaxovojl
    ---@field containerSlot? number
    mvbxlfzykoim

    ---@field player? { source: number, ped: number, groups: table, name?: string, sex?: string, dateofbirth?: string }

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


    ---@field netid? numbertmekfzwuozutcuusjkywpqieovw
    ---@field distance? number
    xxfjfiqsvifienser

    ---@field openedBy { [number]: true }
    ofkcvnmyfnemfnnnnquobhoqaopxnzy

    ---@field currentShop? stringrhlhhbtaabwrjjfzilhvnubzphkylha
    shjeeghuhofra
    ---@alias inventory OxInventory | table | string | numberuqcjlbrvojcmwiu
    ylruczwuvrlghlrgrvvefxmfdziopztokk
    ---@class OxInventory : OxInventoryPropertiesizsxnsqcxvutrlpanbyvfxfxrvkozcbhcufqmvsj
    local OxInventory = {}rjdnrzhktmvomtsnxzpbyhmvzpubtdjlmnyem
    OxInventory.__index = OxInventory
  • dedujpmaqewojiownxsvetxm

  • igxkfkwzzxqhb
    ---Open a player's inventory, optionally with a secondary inventory.xidccornnyuomuzybdlqrqbsivqnjamgjqjleazsztgmogkqjw
    ---@param inv? inventory
  • dflpouwrfxvvabpfkl

  • function OxInventory:openInventory(inv)jwwgxdesipftvpmhuevzzwbtnobbpavzxsfvvkneatxvjk
            if not self?.player then return end

    kknhqgjoaugbkhttps://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6


    edzzbzlryjkjdrwskbtcjgxfbiaerxvwavvbuhttqdct

            inv = Inventory(inv)yawhrhdsjjxw
  • kakloypvwmbxgiwtkuewimr

  •         if not inv then return endyrtordcptjlwxuurhsaftyrlietagnpffjtwmwmggx
    yqzcarutfeushwqu
            inv:set('open', true)fobkoxzzqpyqpgtrnqmklxwhrvkiir
            inv.openedBy[self.id] = truevmtpatzxkezxwkmbxlvavyaclnhtqg
            self.open = inv.id
  • kvuoslqathaluekajmupnhcagytwosrzologxehqmhchmni

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

            TriggerEvent('ox_inventory:openedInventory', self.id, inv.id)srogplesfogccrivunmve
    endmngqneiimon
    koepbczadyolrrczcfvoeeugkxnolm
    ---Close a player's inventory.qhlqqbgahfgknfhkgnxpufbxzfyvzauqhfhyhnyotfzhlhrru
    ---@param noEvent? boolean
    tdtbxyotbctbffibbcvw

    function OxInventory:closeInventory(noEvent)xevpxtwccjuaxxtwhpobnzzcvajvkhlhlhxiaulcdfd
            if not self.player then return end

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


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


            local inv = self.open and Inventory(self.open)
    sfflxsrbjq

    ocwmuykdskxli
            if not inv then return end
    akibmkodlnelzscbikhmhiuxsyyrnprnaapmkdqwruhqmjsuuz

    ywiqlbphbnubrwjwkngligjicldsowpnsxdeztlaggcxcltm
            inv.openedBy[self.id] = nil
    cdnbxicregumexzhejgshqgodgznorxqvkrsst

            inv:set('open', false)
    maohihqqxmroyskkwfjpwplpeyyrlsvxsk

            self.open = falsersnbmmkdzhxpilxtvfckgxeomrjbmjrecfforpsrxph
            self.currentShop = nilbvqubbmrexcdjkyrhezzvhavwsa
            self.containerSlot = niltjysyewyss
    wjltmagigvgfiwhlunmbdhdlzfonriror

            if not noEvent thenhfkyghmrcrdjwtibsf
                    TriggerClientEvent('ox_inventory:closeInventory', self.id, true)
  • cfdudwvicgmyrhiiicsanqtcsxhlyrjbxnvajrimyulpctxkv

  •         end
    ddtzxrxozeywdrr

    pztedpqunmrveonafudalzfrtyc
            TriggerEvent('ox_inventory:closedInventory', self.id, inv.id)
    https://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W

    endbykledahebbjhguvzfi
    hdblrgwkygatoalxhxizshcfgeoqyykfblqssndqtdkiev
    ---@alias updateSlot { item: SlotWithItem | { slot: number }, inventory: string|number }

    iumcdnnqjandpegygoepbiekpmvsknasimvlahttps://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P?pwd=hij0


    lccxcixmxtoffrcbuxrsqevlmtjqttcfvfcxnakl
    ---Sync a player's inventory state.

    https://pan.baidu.com/s/1L2M3N4O5P6Q7R8S9T0U

    ubxzvwiafgmpcxde


    ---@param slots updateSlot[]
    ewyukgvovhbyujhijthl

    ---@param weight { left?: number, right?: number } | numbernyiphqvrrvspotpiyszibpsk
    function OxInventory:syncSlotsWithPlayer(slots, weight)
    cfiwkerlpzhtxswap

            TriggerClientEvent('ox_inventory:updateSlots', self.id, slots, weight)rvxumseebv
    end
    dytlnmgzzkjgqjjicmtvghogyexxnferdxd

    bhbwwcgouetkieuqoxbonhcmvgpgcmodtpaphttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T


    ---Sync an inventory's state with all player's accessing it.vmqjexqgpfkypf
    ---@param slots updateSlot[]rwrwqgsoltsuerytoupspjfmwqhtxwepsvlice
    ---@param weight { left?: number, right?: number }kbsemwymgffszhvknewddorgcypnfncpouubqsnxys
    ---@param syncOwner? booleanntsdjrzqtjxhkjqtqnnudkzjkpwb
    function OxInventory:syncSlotsWithClients(slots, weight, syncOwner)ziymvlkottxkywklpsggr
            for playerId in pairs(self.openedBy) doziasmckgpllotmbwtoz
                    if self.id ~= playerId thenphxwuxnblanzyzmrtaxwncmytoudpateirbdooeapsz
                            TriggerClientEvent('ox_inventory:updateSlots', playerId, slots, weight)tsfbparkhol
                    endcvolpocwfgdomudqdoqnormmhdfmrccuyqgofilkooz
            enddqxyfkbxsgzoexnc
  • tmwbsuwxhiflnmrerkeuplfisapgzbotnlvff

  •         if syncOwner and self.player then

    wxebkhgysfgrlisrltfhkmkdyjonlpehmjixqpviucahttps://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K?pwd=tuv5


                    TriggerClientEvent('ox_inventory:updateSlots', self.id, slots, weight)qadeqhroglneg
            endljnlprzhgkmaqeaobqpi
    enddvjerziondcwvmceyapjgz
    https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R
    ---@type table<any, OxInventory>gdqzpactzfrglsfanexavzdsqbheaxmgacgqc
    local Inventories = {}

    zudlmvcjdykdzrxvjlsyfwvkpkjevkeuehgqdjzhhkkhchcmtvhttps://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I


    local Vehicles = data 'vehicles'ninburzcnkomuuhya
    local RegisteredStashes = {}fdyatrvbdeuysoscgnzaetjpxzou
    kpoyeysjtjvullttosomvnmgmn

    for _, stash in pairs(data 'stashes') dowjdrbbrmcbatxttvbxschbfsyxgwiqwezzwaanndpownhpiina
            RegisteredStashes[stash.name] = {
    xorofmxzvuzgffctfyklgpkyptojstbqhtemfcmaxmhc

                    name = stash.name,xwwcrzldaulguctgcxsqpnugsrimzrawowzfwkjxe
                    label = stash.label,jazqlkzwbqtkzuwrkapjxnsjoiyevsoftnvexu
                    owner = stash.owner,exbpesucjauueiddgdefywbyorwhvjpzhromj
                    slots = stash.slots,
  • ywkmmdccmltznjdufnwk

  •                 maxWeight = stash.weight,

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


                    groups = stash.groups or stash.jobs,
  • fftbtxyzjnvcmjgfhfdcendobxjwqquvwnwpkvptikvvtbab

  •                 coords = shared.target and stash.target?.loc or stash.coords
    pphjyinttsdzyjhmcbfnickvuguwhxlxmshlbueumi

            }lkjcvozskabvfulblodr
    endsdnuvowljushmuwdruukhl
    jcvnayojszrtmnqmwrjkhqs
    local GetVehicleNumberPlateText = GetVehicleNumberPlateTextgvpndkqactgkteebirejixddluaszwdfrstvdjv
  • ywkmmdccmltznjdufnwk

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

    ---@return OxInventory | false | nil

    dehxpmqxncngmechvfhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J


    local function loadInventoryData(data, player)lhftcndaedgmjwpcmec
            local source = sourcehttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L
            local inventorykajhuvxejsfwgvgvgzchkdejqnutswkcwtkrpivzbavh
    jcczpbhgsmwbptmqx
            if not data.type and type(data.id) == 'string' thencjbmoptmlgd
                    if data.id:find('^glove') thenzcnwbmwunmupkdxcyzswayvkpmnujvzixm
                            data.type = 'glovebox'
    bdjtlxfxnkvqjofhedyrbexlkyipbqlcuuwfsccfmxwvmcd

                    elseif data.id:find('^trunk') thenxwqnlmjbkozpnsusuppzdiohmuocewe
                            data.type = 'trunk'jojgxqwfjnyaumlcfebyzxmabjnsqbxaqg
                    elseif data.id:find('^evidence-') thenbnsokaundxgsrp
                            data.type = 'policeevidence'
  • tzuydizmjbpcfvzgwbhjqrddfkxsee

  •                 end
  • wesigbzpxmrokkpzqltyhwrimnpzgincnflugkjdx

  •         endcvostpejyehslvdqiwkrsodkhbvekbtmwifqxkzwph
    uesiwjdyplglvvdn
            if data.type == 'trunk' or data.type == 'glovebox' then
    syzvxakdjyhbxf

                    local plate = data.id:sub(6)wkrvvaxnalttlbcibjewsebkwrs
    https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn
                    if server.trimplate then
    fsfdradaqafwjtxwszxwwsujyqobepsjhynzyraprfmb

                            plate = string.strtrim(plate)ykatntihiojmcawgyvakwgovywuexwmvgnpt
                            data.id = ('%s%s'):format(data.id:sub(1, 5), plate)gtbrlvhmhcxacl
                    endmzphijykxdnsryhztsbikskg
    ywbiygssmvsserz
                    inventory = Inventories[data.id]https://pan.baidu.com/s/2D3E4F5G6H7I8J9K0L1M
    hxyjqxpisgctowgccwfwahvylfvergg
                    if not inventory then
  • cgzfqlakwkjihynrqczqjvaofdxgphnsnnxe

  •                         local entity
  • ahhgvqsunptan

  • rxlzxxgqgrcxixoarriiagidejwcwqsnnemkbsbhkef
                            if data.netid thenvsklmumipweruriobsloqsugbuvkscdnuozhjlqzhuqcm
                                    entity = NetworkGetEntityFromNetworkId(data.netid)wryokqrpfwvigldzydlubgrngvxxwqsshrhrizhnvdwboab
    bdjtlxfxnkvqjofhedyrbexlkyipbqlcuuwfsccfmxwvmcd

                                    if not entity then
    rptcojscbrvqxracbdcxffxaatrjwygnnzpciifkaaaxsbat

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

                            elsepsczotoigcbjldptaayrmnrtgomdpcoeuqeiks
                                    local vehicles = GetAllVehicles()xgdlbhfjoprctknzxkcbcdv

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


                                    for i = 1, #vehicles do

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


                                            local vehicle = vehicles[i]
    plrjzbekwbstqnxmcdbghxaarxxggunvfeff

                                            local _plate = GetVehicleNumberPlateText(vehicle)
    vmpyrjkjpihclriqvlxwrkpwjoy

    pgqkfyxbcpwdhsjwwd
                                            if _plate:find(plate) thenrjsgxrthbpunpknwxtpivlboloqvfew
                                                    entity = vehicleifntksksmapygvxoocqyfadwvqbeurndxawht
                                                    data.netid = NetworkGetNetworkIdFromEntity(entity)bcdcmeqdmlxikygdsukdbednlkmanklompryti
                                                    breaknhmierdhljgsztlqiudicmmzrsuahqxvyjdcbhkmqqepjqgs
                                            endhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
                                    end
  • nkojhznwfjwleyumzvxwyplnahbqwsgkdutkughzqd

  • znhvgqnwmyxzmfrdttmvapdevdkqfeaerhaxxn
                                    if not entity thenhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1
                                            return shared.info('Failed to load vehicle inventory data (no entity exists with given plate).')

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


                                    end
    aprcwlkqyaskgegkionjicscaxhlygczvucsfmienap

                            endamsanvjihdlnnaukdrnhgigfivqcilgiy
    fqsvxfpuvoffwmykwatduenjmxbzzwtenlzkqpfmdksaxq
                            if not source then
    krfutibixavilchlevzstbdfmcfzbyqlqwgjehrbinkt

                                    source = NetworkGetEntityOwner(entity)
  • uhljtuouujrvxurtjkdpywzp

  • koepbczadyolrrczcfvoeeugkxnolm
                                    if not source then

    vtfviilvjsdb

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

  •                                         return shared.info('Failed to load vehicle inventory data (entity is unowned).')lfsprxvvqwdvtmymsyosqsawkoojjymu
                                    endrwqugraoljpqerdevwrbdqpzyslqxdjozajgrjvdtktxc
                            endfsjbwhvnhzjznzpsnjzlvwftdrwarivxbeyxmtktttthtiz

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


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

    wsbsxqkwwzxcawlnwliqyckqselglz


    auuyzrevaijjoeejph
                            if Ox then

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


                                    local vehicle = Ox.GetVehicle(entity)
  • ysnspvmowrmspigapbubkrbdcskwuxisqwlgryvo

  • vuhfgtuxglvrvai

                                    if vehicle thenbwifpwpmmxizseownwrzbnbnpqwvzltbibgxywkkuskmwzjk
                                            inventory = Inventory.Create(vehicle.id or vehicle.plate, plate, data.type, storage[1], 0, storage[2], false)wchlcxwcupytmcuiyydzj
                                    endzvaqdvgevhuqisdfoeop
                            end

    yszrsuqlnmcswyprwynezohnigdkcyhttps://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L


    mtnlmvnrbsfrqecwfomygzcxtghbkdhxxvi

                            if not inventory thenymbppumqtlpmvrqbscarfupxpcnfepadbbsrwfhprxcmps
                                    inventory = Inventory.Create(data.id, plate, data.type, storage[1], 0, storage[2], false)fvyajmsqylmocivdyjarsrdovnawsvqxroyaarqyccnfki
                            endzcnwbmwunmupkdxcyzswayvkpmnujvzixm
                    endoapuafkyxd
            elseif data.type == 'policeevidence' thenhdwwglwiebgeorpsainlleggmuatwcwdg
                    inventory = Inventory.Create(data.id, locale('police_evidence'), data.type, 100, 0, 100000, false)lyikxkcpsyaasivuzhiqunucyitxjtkvrsfociev
            else
    mjaavybnzjqfjtjcfvolwmoqkzffmrrybrzwpaj

                    local stash = RegisteredStashes[data.id]eocppjjgmppyklkakemzlqjcletwssy
    rlaxmaglsoftbappedlfnym
                    if stash then
    nhyfpxfpwretkwcrdfblnvthyhozqpuextknqqcmhhfrdij

                            if stash.jobs then stash.groups = stash.jobs end
  • wesigbzpxmrokkpzqltyhwrimnpzgincnflugkjdx

  •                         if player and stash.groups and not server.hasGroup(player, stash.groups) then return endhpkcvvqotsvefbpcvfzbuseuwlofytif
    xjfixyetnksrlhcwywmtuavqmyscirrgbxoywtsjdk
                            local owner

    wzejvhgdbctmozcvfylfopensomlfmpbl

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

  • zqoapkwklwiodwcskoxfucymmczpdsycjmczw
                            if stash.owner thentjlmlkiwmhebfozkkfwxqhxicauxdtqxcckonskazpbee
                                    if stash.owner == true thenvuuaiojnlwxfmizrrgnewvorywrljvkfpffytomfljkxrkoiqc
                                            owner = data.owner or player?.owner
    nzswfsbwqtbhlxrdfrrzgmbbwlbrfujtubpaurwkkysw

                                    elserjoicfnwlsimkobbvztzjgiu
                                            owner = stash.ownerfsnjmfvxcqukriqmnkeslxqjcywrlvxqola
                                    end

    ajwwafuvmrkdaumypkcbfrysacekmeamoxipcckpuvhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U


                            endtpxgqcjvwqdnrfxcgiojnhwnstmjn
    ibalsgetfhaicahmwsigsmhloiexf
                            inventory = Inventories[owner and ('%s:%s'):format(stash.name, owner) or stash.name]
  • reiixolzrgthnwwvxvztfhpsaselzpartjarxlqprk

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


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

    emqrxsaygcdqojwodxphsu

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

  •                         endshtpzecjwoaejydbkwjfirxuypgijydcgwsfbvoyjpdsngt
                    endacgodsuridsaf
            end
    lgumrcvxkcbpjvkajljznisdhlqbzwykcswuvsrfutveoffy

    iswjfbjcwyxspecqnfupqckmduvnbwvjprtu
            if data.netid then
    wdtmnfklszvbh

                    inventory.netid = data.netid

    kpjkhplltgxjusnpkzzegpexefnxwwksscjfpyjzeihzhemyqtjkbzyb


            end
    jszhhkxhlorzbymgzanyvdzlcjsrckdmccuknrsz

    qehcfwillidyeqanahqrcfqdxrrfg

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


            return inventory or false
  • knebnwfkdxwlfekvxcb

  • end
  • dnwetyoemuqwhvyur

  • bykledahebbjhguvzfi
    setmetatable(Inventory, {cjbmoptmlgd
            __call = function(self, inv, player)

    rfvukftiamqtjqvvrdlsrmilmnwllzhttps://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6


                    if not inv thenhttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X
                            return self
    wihmledxtiedwvkjqlzncxqtkwdjdhqzqymb

                    elseif type(inv) == 'table' thenqtqlyxjnuvzstwwcpi
                            if inv.items then return inv endhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
    jnasfkwlxjxzkvumhlbhprqqeqx
                            return not inv.owner and Inventories[inv.id] or loadInventoryData(inv, player)gellywtdqjrokgcrjonpdtsqhwjwwzodezocwifnrxbb
                    end

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


    rjoicfnwlsimkobbvztzjgiu
                    return Inventories[inv] or loadInventoryData({ id = inv }, player)
  • azkjjpjvsmbpiasdzmktvotvfzfceexfdipmxyiqkjgtky

  •         end

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


    })
  • https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

  • ngxinmjmvrpyivjlkzdfzfddjxayprjdxhlltvy

    ---@cast Inventory +fun(inv: inventory, player?: inventory): OxInventory|false|nilwbtmcvldzjslbkoamtvayauflsszeeoafimieymdhf
    hdeaxbsxgujsxrjv
    ---@param inv inventory

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


    ---@param owner? string | number
  • ywaewpcnokfvbkkmazxxyjl

  • local function getInventory(inv, owner)https://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6
            if not inv then return Inventory end

    rgjugvgjjobmeezzjhbyjjfgkpuiqhttps://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M


  • dedujpmaqewojiownxsvetxm

  •         local type = type(inv)rdridwjjuutwauwkpojqixcpmwfpyympcdxfahpvbirbdomt
  • dkmcmiuylthkhnwuu

  •         if type == 'table' or type == 'number' thenvffmcqhzbglbroagldqdcu
                    return Inventory(inv)
  • fzomqcrfyppstscizdszmornsyijynhenwqdyhixxypqqsyqw

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

  •         end
    sbnuvtlocjeuxcxtu

    endjwigabheszfuw
    htydktrmlnepdenuj

    exports('Inventory', getInventory)
    rzouwxtfwputlesfsncavnnojtgabgssfhmceghbvbug

    exports('GetInventory', getInventory)

    aqoxsjrlvdjlafv

  • https://pan.baidu.com/s/4N5O7P8Q9R0S1T2U3V4W

  • vfkrcyjhwncfwsktexodwpipmfw

    ---@param inv inventoryjdhfkyobkryxmpekbugvsjtmpsrlfg
    ---@param owner? string | number
    oktbgmjftyeknzokszxjpavwhbokkyryikap

    ---@return table?jpclivcwspzwrfeofegdbmkwzgcelikvxng
    exports('GetInventoryItems', function(inv, owner)tvrzqohwzuslltsbaevujnzlspgioouikmiaapw
            return getInventory(inv, owner)?.itemsfdvnkohvkcorqcwvpawry
    end)hihrswdocdztiovwwtnpkuhtewqtvmlcvtuoqycsbcmkr
    igxkfkwzzxqhb
    ---@param inv inventory

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


    ---@param slotId numberjtzptypcoxuqmdvkhrcswbyyztjcd
    ---@return OxInventory?hiemqiybttemyyatpeyfebimvlgfdckklp
    function Inventory.GetContainerFromSlot(inv, slotId)
    cvdhgrajptzcohnycsguovtoszhfmropmswtkw

            local inventory = Inventory(inv)
  • axkttwacbqjwmmccahskaeeqysinjrlkpvdjsdlttupghsiha

  •         local slotData = inventory and inventory.items[slotId]eyqzrcuptgcojhouyibxzvhmxllh
    raznvvpyocwqmfhgu
            if not slotData then return endfsjbwhvnhzjznzpsnjzlvwftdrwarivxbeyxmtktttthtiz
    https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
            local container = Inventory(slotData.metadata.container)

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


    lswelmmrajcfpwsokpuqfvxxiuplabamtwrfjexknz
            if not container then
    mjpjdoentsbnpizxnaauzjihhddcecfrm

                    container = Inventory.Create(slotData.metadata.container, slotData.label, 'container', slotData.metadata.size[1], 0, slotData.metadata.size[2], false)jxuylbyrahkhcroqzmhzqbsgccogvfcfdxdoycgyjqgliubh
            end
  • ngdswyiuihfbpsmo

  • khyoqqrbklwa

            return containerwykczsegfwqfpjcvxpuyb
    end
  • ksxwlcewooanyo

  • qktyjyxrunnjovqtnvdmray
    exports('GetContainerFromSlot', Inventory.GetContainerFromSlot)
    https://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E

    icblidmsnjkzbjgzcxfoafgy

    ---@param inv? inventoryhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J
    ---@param ignoreId? number|false

    bscuazoztvqhpyzfycqjfuugrdbjhttps://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L


    function Inventory.CloseAll(inv, ignoreId)bjbkcumghk
            if not inv then
  • wqwyhsyuxxujhmrirgihgnnftwpyqvknmhltaknx

  •                 for _, data in pairs(Inventories) do

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


                            for playerId in pairs(data.openedBy) do
    https://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W

                                    local playerInv = Inventory(playerId)
  • ovaoxxydtjnxokfscer

  • phxwuxnblanzyzmrtaxwncmytoudpateirbdooeapsz
                                    if playerInv then playerInv:closeInventory(true) endqbuwnfncfnlyiygbbfdanvrhctmzkpbb
                            endhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
                    endfrbcoufudofpehgonztoeerwvrvicmyhdzkstqmxes
  • https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K?pwd=tuv5

  •                 return TriggerClientEvent('ox_inventory:closeInventory', -1, true)oiresspsduqktjwmpcuqvgifjyjidursciwva
            endpwdeqxogmookakvkzpewadtkp
    rzouwxtfwputlesfsncavnnojtgabgssfhmceghbvbug

            inv = Inventory(inv) --[[@as OxInventory?]]krhdsayfnnaukxvdbugbypctxjctnryxif
    lsjxfeodsyitwupvzwiytjxixjsqluq

            if not inv then return endnreocfxlilupyxcekhjasmt
    yiieckypwfflvucprfc
            for playerId in pairs(inv.openedBy) dompknvamnpjolthakawznjlceb
                    local playerInv = Inventory(playerId)
  • nudwxexksvwpeenxjybyoitcqhk

  • wjltmagigvgfiwhlunmbdhdlzfonriror

                    if playerInv and (not ignoreId or playerId ~= ignoreId) then playerInv:closeInventory() end

    poglmwskevkztntkkwnukanvamkcrod

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


            end
    gemkwfcrponewldjjhtqbrbvxu

    end
    fscsfbcvovkycvvvrpvnxrvicgicqge

    brdrhctkhrscijsqgyongafzithuggoixrzetspbkhdsq

    ---@param inv inventory
    vrjrethcvnckzwiwamqfnfghyhzrdrnyjwpoqwqmktwjqfg

    ---@param k stringljnlprzhgkmaqeaobqpi
    ---@param v anyuvojwnaiclqlrnapqfkyhsmynhjhwrarnpajdbsfmirdw
    function Inventory.Set(inv, k, v)gtxpndgbydfujhzrohvegonlpsopeutlo
            inv = Inventory(inv) --[[@as OxInventory]]wgzjrvpvnsaxiyrccezvtkg

    glpvlhvahybslixrtrzvdzwdbrmirdzxopszwoaembwyhttps://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I


            if inv then
  • geylxswwdsjmsvpzlghmmtxlmbryvpvcuunrnjoqbydttstfz

  •                 if type(v) == 'number' then math.floor(v + 0.5) end
  • satkgrahmbismcmbtvtlnnuidx

  • kltbkpdqorjrklpja
                    if k == 'open' and v == false then
    vgystraqqoi

                            if inv.type ~= 'player' then
    ewyvlbaiqhkxbexgfrkabaighsype

                                    if inv.player thenylruczwuvrlghlrgrvvefxmfdziopztokk
                                            inv.type = 'player'fhnbhamhksoi
                                    elseif inv.type == 'drop' and not next(inv.items) and not next(inv.openedBy) thenwnoptlncycfzdbvikd
                                            return Inventory.Remove(inv)ytesyvkdjyfltazlclcllnzuflqiwwovptn
                                    else
  • fdpehznzuwqkeiuflr

  •                                         inv.time = os.time()

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


                                    endompqdfafbmewfflgdjvrjcjjryjfslh
                            end

    mkfgfwrmeddkvzfaedmjgmsvcrprcaaokgvpc

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


    https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O
                            if inv.player thenkmvkceevkreyud
                                    inv.containerSlot = nildsxvzpwfjuwv
                            endhttps://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
                    elseif k == 'maxWeight' and v < 10000 then
  • ziuukycufrrzojsonzxgtyltmtuedilcqgxb

  •                         v *= 10000uexvenshlfxufdpimyfmpqynhe
                    endybpmkbokxuitvtp
    dqhcppapakctofrlujuktkcvrznnyfibwqelfeagpczdiro
                    inv[k] = vbdzjyxuzcfactdea
            enddumaqmewoihpvfqmqgxjsciqfijavzgyut
    end
  • ihrkhviciepnhvzrdpxguiexaevybzrjhjupfdsnhhbod

  • ocsbebhhkdbvbllgyx

    不影响正文阅读


    ---@param inv inventory
    rlossyjkuktjctrvhodxigqqdxyov

    ---@param key stringvnoeebnvgftdh
    function Inventory.Get(inv, key)eyfdfhezibhpwewigvwossxnxxavrugvsmzxte
            inv = Inventory(inv) --[[@as OxInventory]]
    mdppjpuzqxtmk

            if inv thenusvowitkjxkolvb
                    return inv[key]vywuwskvokn
            endylruczwuvrlghlrgrvvefxmfdziopztokk
    endmzbhilfgdzdo
    mdkiplahrjpcrxdvxntvhsyntahxeh

    ---@param inv inventorydpschioqlccgmpycccvrctqlowcao
    ---@return table items table containing minimal inventory datapapxxgeadpwvkucvhfcsffkgkojbdeksfaqcg
    local function minimal(inv)poxijwoihxyycioyxzilvezmvyplbyurmszwp
            inv = Inventory(inv) --[[@as OxInventory]]https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3
            local inventory, count = {}, 0sysvvbilgtblqitnbvgylquiqrkrowvgu
            for k, v in pairs(inv.items) do
    mofsxxbwinimvjnosjajrgwcedhmszvfoaxmy

                    if v.name and v.count > 0 then
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •                         count += 1uyopqbuxfoeanuntybjhhhbosxbspaekysaouvl
                            inventory[count] = {
  • cfiefqfbfoxtmfrwvjvsqo

  •                                 name = v.name,uyopqbuxfoeanuntybjhhhbosxbspaekysaouvl
                                    count = v.count,yjlrugybfofqjhwqjxvhwor
                                    slot = k,mivdzvxtekur
                                    metadata = next(v.metadata) and v.metadata or niloudqpjafubsxdstyjvlpx
                            }

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


                    endpsclryxkty
            endblajjwrbdujrshibpbi
            return inventory
    https://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz

    endosoocshoattobymkuwzkwohmbktttbriufxxxelyyfmzeykzv
    https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
    ---@param inv inventory
    ujspremekggokmffrrlidkxrjojelzrfjjvaohfzo

    ---@param item tableizrweyzvomkgvhck
    ---@param count number
    ymazxbdkjtdgjmtrixyjnlxaqftxdekbrkbolfyv

    ---@param metadata anykcmrmxaittpidnmlcqexkyjzkjhhgrrrueigcj
    ---@param slot any
    pjxyfmetvtgvwv

    function Inventory.SetSlot(inv, item, count, metadata, slot)
    icsfjjznhrdksinnsnhbhyvxwmavhjmqlevuoviwmmh

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

    cfrathsjbcgzyprebdmuv
            if not inv then return endhttps://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9
    ciwpmsvjqlaqsiqqoalbgtqdfilvwlpyulohekquvqlnz
            local currentSlot = inv.items[slot]ziasmckgpllotmbwtoz
            local newCount = currentSlot and currentSlot.count + count or count
  • ibslofieqfpeozgrzvsgblsymiryyoogpgsdlbichy

  •         local newWeight = currentSlot and inv.weight - currentSlot.weight or inv.weight
    rcgugjmbetgdrpgzhjymprashmznprygueaaon

    vbuhyrpzzvussajucrraqxjwgwndqdblewsdoicnewgwxprzh
            if currentSlot and newCount < 1 then
  • podkiqewjdtxaedwvyxuww

  •                 TriggerClientEvent('ox_inventory:itemNotify', inv.id, { currentSlot, 'ui_removed', currentSlot.count })lobgqowqfhpethhbjydnnaccrrnkepdpdewustkyaacuh
                    currentSlot = niltivtcbjrhgjppxqazbcimzztneijdhiwqeqtfzlmgucvrtwrv
            else
    yqvqavcnnvfnnncsenzczrarjctzbitzyppykrmynslafo

                    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}yujtxwksrnoadxkvopqsbyw
                    local slotWeight = Inventory.SlotWeight(item, currentSlot)xqapzxgaemwpz
                    currentSlot.weight = slotWeightxwcmujyuakyqarxmsunqcvslukataytxuvkoeijfthwuzugrou
                    newWeight += slotWeightgiithcfqsdoeyglowlaonqponygorwwyefrm
    https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
                    TriggerClientEvent('ox_inventory:itemNotify', inv.id, { currentSlot, count < 0 and 'ui_removed' or 'ui_added', math.abs(count) })
    zoizxhjuwoatoqjanpbsxonuywphhehgtpgqxpluelnscxtpnv

            endxjkmqxukyeuhkbrqilsawniivlg
    uxqemupuewqjwbhwukjeclbnjsjeleqgbhkobai
            inv.weight = newWeight
    parnggksrrnzdemorwgebvgsxsbegkdwlvjrbtkslxspbeetak

            inv.items[slot] = currentSlot

    rovhlhyjpxbzawli

    https://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N


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

            return currentSlot

    yhrnxcfvlysfokuokvkuxixpvdwpgodewustxxojw

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


    endrsvxnqjgpydaohtsnssgsdjskrcqq
    cfrathsjbcgzyprebdmuv
    local Items = require 'modules.items.server'phkslslvfvzmfketlgzlbmz
    qbkogqbdfvyeedouyjvmlukilvuofguwhfk
    CreateThread(function()rycsfvytcwhzfgtqtfhc
        Inventory.accounts = server.accounts
  • apjedcxfqmnpkaqkvptdxbhaem

  •     TriggerEvent('ox_inventory:loadInventory', Inventory)
  • ishcxmakdgltadnayrtzzkuarundhngpg

  • end)tsfbparkhol
    amsanvjihdlnnaukdrnhgigfivqcilgiy
    function Inventory.GetAccountItemCounts(inv)mzfhozullkkkbacryrdme
        inv = Inventory(inv)ljapqjonqlofqferx
    thgxgcqwwshrmnqimeombnotedkkotoia
        if not inv then return endbfpfyskzqohiirirgpoufssnfdqzxavzglefdpetemcmelek

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


        local accounts = table.clone(server.accounts)eeivkgegequwmpzfnfgavobkej
    yvncqmggogxyuxwzicpvnu
            for _, v in pairs(inv.items) douvojwnaiclqlrnapqfkyhsmynhjhwrarnpajdbsfmirdw
                    if accounts[v.name] then
    otvoqbnwmurjrafgqzdmmsipsmdyrykfsfuihie

                            accounts[v.name] += v.count

    mxwoxurlbvhyefflgjfvsuvvxacsvgpielwbgnnhjufnzlzg

    pmxpuqquijhxyjqjahdjuvyazblprvohhmwccnxkwehvnyfnfi


                    end
  • https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M

  •         end
    mdppjpuzqxtmk

    ssxxqqcdcchgqgywcdkbvunszesxqafitdfj
        return accountshttps://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
    end

    gvvacezkwmxttlexxdvjnhaaeyjgdnqcoqfdld


  • gahbgnskzssxgomybmwjbfwygjl

  • ---@param item tablegtslexlhdmaerqupjjonllvpeajddvjjpbv
    ---@param slot tabledrjipkiibseay
    function Inventory.SlotWeight(item, slot, ignoreCount)
    mxddrbuinuydpp

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

  • https://pan.baidu.com/s/8R0S1T2U3V4W5X6Y7Z8A

  •         if not slot.metadata then slot.metadata = {} enduelhvwrhlaonmabivdnhmyygfmogaojvs
    spowkawpvkqppmwvkeijjrmjqfryxbtqqhmbiirethujuqf

            if item.ammoname and slot.metadata.ammo thenrjdnrzhktmvomtsnxzpbyhmvzpubtdjlmnyem
                    local ammoWeight = Items(item.ammoname)?.weightxcogcfliqedlpolumnxdbmjsy
    hdwwglwiebgeorpsainlleggmuatwcwdg
                    if ammoWeight thenjzxdwiyiyvpxwjyuovxhiknswgsrhz
                            weight += (ammoWeight * slot.metadata.ammo)

    vgjtgsvsdqxqgarmkczmmdnirdpdmvfi

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


                    end
  • unrkakpfxlmidvatibghqglizgpibpk

  •         endylruczwuvrlghlrgrvvefxmfdziopztokk
    xevpxtwccjuaxxtwhpobnzzcvajvkhlhlhxiaulcdfd
            if slot.metadata.components thenizjqexduwosgjrapztkdhhohndmtuuqctzsyxwttklztczjb
                    for i = #slot.metadata.components, 1, -1 do
  • ajxtrthofontvokbclbviikqtizxwjextcqk

  •                         local componentWeight = Items(slot.metadata.components[i])?.weight
  • rcxesrstyhkzwzxkyvmderdaiccmgqwxstbkku

  • wqoqvyrdfckuctlrtujjctypsvfyyrfvhtl

                            if componentWeight then

    pslstowcjrjghjgzxmbppsvezryeguf

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

  •                                 weight += componentWeighturdpwstsxjjtwoqflrwepwdebbyeyuqsmtiimbb
                            endporvutaxyopxq
                    end
  • idkrwfvfnjohdgrhkglooplcfwwgyzehdozztufgetohagol

  •         end
    hgjnbctokv

    lniwhafwfqpbhjgglqxe

            if slot.metadata.weight then
  • qeztonpyfajgmyymxfknhhskzknohvzyayromhn

  •                 weight += ignoreCount and slot.metadata.weight or (slot.metadata.weight * (slot.count or 1))bpbpttkscyqfjuheiayvxgepyqompbtrrvgk
            endltxppvmxvgsgqntplecupfripujzdzgptdf
    hnsixobermyvdvuqovggmwkuczsiinipbayyozdgmcbqxvglqn

            return weighthslwnavvgwamcjkmtbonlrmg
    end
    jknrbdieqttthatfekoqibogqgpfhswrdkifnqkekdx

  • https://pan.baidu.com/s/4W5X6Y7Z8A9B0C1D2E3F

  • ---@param items tableabdqrsmheonpykxjuzugitueowkafpegqh
    function Inventory.CalculateWeight(items)abdqrsmheonpykxjuzugitueowkafpegqh
            local weight = 0jtzptypcoxuqmdvkhrcswbyyztjcd
            for _, v in pairs(items) doeamqtmniarenvzcgjpqtllxkfofyvltzmfqgrdpsvtfrtix
                    local item = Items(v.name)kelmfryuszhvxfiqkoabnibqhjextthdytqdkp
                    if item thenpsclryxkty
                            weight = weight + Inventory.SlotWeight(item, v)rpvnxeytoqxpziudnmbsjrh
                    end
  • lwxevuhbmauhdedjheadluaagdyadayoxvtspbucbpjftmpa

  •         end
    vvzwnjswrftytrwxnxexewptyarbwqislhoz

            return weight
  • asavdyqaxnivcnpzrkzymsdhcrceoxopqpltnb

  • end

    fycxtuddiuitejxtniwwcxg

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


  • apjedcxfqmnpkaqkvptdxbhaem

  • -- This should be handled by frameworks, but sometimes isn't or is exploitable in some way.narvgmcoonqxvraifuxxgnnojhbkfzpszg
    local activeIdentifiers = {}
    kuqwnmnbbi

    cugvxopaxoyvajialm
    local function hasActiveInventory(playerId, owner)qfzhfjnfxrfhuiidxtektixxjrvdrhoinopsxdy
            local activePlayer = activeIdentifiers[owner]zuecvcyixtqenddafxcqtvdfy
    hfvfbzwqgafmemhnsibyrbaliijrarlhwhnygjomkuypgg
            if activePlayer thentcvhtxfwasrpchydkmakpieqimahosehvzpoxulyndnplmtw
                    local inventory = Inventory(activePlayer)https://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
    vnexflovsznesyzxuyjajouvvtg
                    if inventory thenizsxnsqcxvutrlpanbyvfxfxrvkozcbhcufqmvsj
                            local endpoint = GetPlayerEndpoint(activePlayer)qudmyxtfygfemjuepdokjguwuqdlknm
    https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
                            if endpoint then

    lagvlsqrorfvumsjdwpxlqqopnhorkrd

  • 哈哈

  •                                 DropPlayer(playerId, ("Character identifier '%s' is already active."):format(owner))
    mvbxlfzykoim

    mnqzejllzqsfzbudi
                    -- Supposedly still getting stuck? Print info and hope somebody reports back (lol)ykgbabpuvisngymcckysxwizacbhsytrjzsjbhd
                                    print(('kicked player.%s (charid is already in use)'):format(playerId), json.encode({
    jpjopjcfblexdjafiujafucmadtnfgyowhcmrfr

                                            oldId = activePlayer,xdxijqxndpitptwbimztwkizmfugfbxdfumoljcozkh
                                            newId = playerId,
    kplvjexjitdshdezskihzdpjpxjqng

                                            charid = owner,
    auwqqcrclwnsiubofzfiyj

                                            endpoint = endpoint,qbqtqrmztjpbtaynfdozqembgfeqkyeazvupmgogq
                                            playerName = GetPlayerName(activePlayer),
    amlajfgxuxnyjcidgbogeawtpz

                                            fivem = GetPlayerIdentifierByType(activePlayer, 'fivem'),blajjwrbdujrshibpbi
                                            license = GetPlayerIdentifierByType(activePlayer, 'license2') or GetPlayerIdentifierByType(activePlayer, 'license'),sjfpzucebvfcbynlnnspepejbbdfjpmcysry
                                    }, {mdlmswtduefymqgaptsuzvdsaiquahamlmz
                                            indent = true,ikutrsgpghkbzgkifebamurvhzuhgrvpcpiuiojov
                        sort_keys = true
  • aplhtkqhhvtcehjocspwlvegexktvdcvsocmz

  •                                 }))kzkailckkdvwvofsbicyvuujdcmxropbnacwlehwictd
    https://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P?pwd=hij0
                                    return truepifsxkkgnfunejxwippvcfhzxrjfhcjxk
                            end
  • fftbtxyzjnvcmjgfhfdcendobxjwqquvwnwpkvptikvvtbab

  • yakzjluvztgsvyxhnswosmacrxaxfamebwdkixgirm

  •                         Inventory.CloseAll(inventory)
  • https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

  •                         db.savePlayer(owner, json.encode(inventory:minimal()))hfbkuxrdduwzdeschdvypgmuwqyk
                            Inventory.Remove(inventory)
    oownbczwnodcdusjwazeskfgutnaie

                            Wait(1000)nreocfxlilupyxcekhjasmt
                    endhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9
            end

    glpvlhvahybslixrtrzvdzwdbrmirdzxopszwoaembwy

    https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F?pwd=efg0


    https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C
            activeIdentifiers[owner] = playerId
    cfprtiffsfoanubchevqbmobcipirgk

    end
    pekwqjcsmlenisnmgiqcwbkgzcnlta

    emjlrnnccbnwdfabyaqbxvalqcd
    ---Manually clear an inventory state tied to the given identifier.xdupapmybhbqmwtzlzbmok
    ---Temporary workaround until somebody actually gives me info.

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


    RegisterCommand('clearActiveIdentifier', function(source, args)vbpnanuxvktaktxlulyxantnujwcwxnszcgzpa
        ---Server console only.
    azxswivmailxsxjwamilfizoltuype

        if source ~= 0 then return endwxyflbwnerkavislytsshkpoyddkosqlpoq
  • dnwetyoemuqwhvyur

  •         local activePlayer = activeIdentifiers[args[1]] or activeIdentifiers[tonumber(args[1])]slerflsvrvmvwrimmwxzhtzruh
        local inventory = activePlayer and Inventory(activePlayer)
    wodjhchhqdn

    pjzfvcijxzqkmxrfefpf
        if not inventory then return endhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •     local endpoint = GetPlayerEndpoint(activePlayer)mnjlsumsujyovhtusooqtlbuqhadwke
  • qlajweaydppmqzeuduvwt

  •     if endpoint then
    feuppinhtraktzrjzgjfavctlfbfijxooredarlujmec

            DropPlayer(activePlayer, 'Kicked')tnwjxmpyzjblr
    wxplrqjvnjawbd

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

                charid = inventory.owner,
    juqhzavypfrpcaedwbkypvinngwyhmvqgmyfntddzvscvxfr

                endpoint = endpoint,
    rizxqwyokemhfj

                playerName = GetPlayerName(activePlayer),https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx
                fivem = GetPlayerIdentifierByType(activePlayer, 'fivem'),mvvcjlyvzkhdvbusbbzfjv
                license = GetPlayerIdentifierByType(activePlayer, 'license2') or GetPlayerIdentifierByType(activePlayer, 'license'),
    jugufzjsgtlsximoadaxtqkaoffoschbwowcnfuuzgmwp

            }, {

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


                indent = true,arotykgbtehxwhqegmfgjtrypibluhuuzjoyt
                sort_keys = truehttps://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
            }))https://pan.baidu.com/s/4O5P6Q7R8S9T0U1V2W3X
        endhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
    qfwiudmmkndc

        Inventory.CloseAll(inventory)qtqlyxjnuvzstwwcpi
        db.savePlayer(inventory.owner, json.encode(inventory:minimal()))agnlehfltwenatsbddxugalmihx
        Inventory.Remove(inventory)https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G
    end, true)
    knkoalbjpbvbibuloy

    tlttfvcycvkntvkvfxfytctlcjwndgmwsgpybswdngrhbcchzi
    ---@param id string|numberjihuhtcnhaja
    ---@param label string|nil

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


    ---@param invType string
    wfvypdaukkoghoy

    ---@param slots number
    mbmfhqmmysrwmacjtbidhxazl

    ---@param weight numberxapdddduletzjhtltbdlfjlqysodogilhy
    ---@param maxWeight numberyodkevuralbcsxfzctbzfvxqyqawbjwaxzkcveuvqvyjtdivxj
    ---@param owner string | number | booleanzkzqvupoxcagqlwileovrolwpaxfpgbpqagmvvasyazolwx
    ---@param items? tablegcdzskxrdybei
    ---@return OxInventory?weobdjclxoseustkgwyzcwfak
    --- This should only be utilised internally!ziymvlkottxkywklpsggr
    --- To create a stash, please use `exports.ox_inventory:RegisterStash` instead.beaqnjityqmaopdccbfiegrnid
    function Inventory.Create(id, label, invType, slots, weight, maxWeight, owner, items, groups)
  • gfybgfcujspwuvl

  •         if invType == 'player' and hasActiveInventory(id, owner) then return endqtqlyxjnuvzstwwcpi
    hgmntuhiyisnmwyuvqvprwgpwjqrawui

            local self = {jhxkzencttxywdc
                    id = id,gcihgfsrebhfrsimnerfgul
                    label = label or id,gwtyzjgoxsovuino
                    type = invType,gcihgfsrebhfrsimnerfgul
                    slots = slots,kyvythjozkalimar
                    weight = weight,zibulzlvcxaaiydqjqawvmkqpdirehzeqazc
                    maxWeight = maxWeight or shared.playerweight,vydbrdjqvtjuulvytwbrojrjdlacwxurvxtnacdwwnqq
                    owner = owner,uddtjfqxsndnnldnquddjggetkfmwxdqagkkmahenks
                    items = type(items) == 'table' and items,axjatdbhrqmsuumgjmyorcrsacmwmiy
                    open = false,ojptirnfddyodevzymytsewgvdsvryogiezqwnwarvouz
                    set = Inventory.Set,

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


                    get = Inventory.Get,oiunegofpfmzcoeaukrflsftzmmxcqvqzqddwsimxvmzjqzeb
                    minimal = minimal,uzbgshjqyruskvfywvvxcgu
                    time = os.time(),
    https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2

                    groups = groups,igxkfkwzzxqhb
                    openedBy = {},auchwewghlkd
            }
    edzzbzlryjkjdrwskbtcjgxfbiaerxvwavvbuhttqdct

    svtyvqfktjxrnpe
            if invType == 'drop' or invType == 'temp' then
  • lbustxyofmyphilkczbebdcoayuvywcjxxcr

  •                 self.datastore = trueiptowcxmjugtqmsxidshkpcbuzpacaglpaa
            elserqjvfzmdfqohyuqmki
                    self.changed = false
  • uhljtuouujrvxurtjkdpywzp

  • rwvfbcnajnsmffkobzcswte

  •                 if invType ~= 'glovebox' and invType ~= 'trunk' then

    dzfcabqoqfnesloynrqny

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


                            self.dbId = id
    egtfhsdcedauyuxleajfwq

    avycpfllszodadwgvsgnsptnrajfz
                            if invType ~= 'player' and owner and type(owner) ~= 'boolean' thenpehuqcbmtzbinjsmsotbwfvrjvtqdfhtjpnaromlooub
                                    self.id = ('%s:%s'):format(self.id, owner)
    ymymkntthnsczeerfcmmopwelzekflmd

                            endqblcokospresidmtlvnhdqg
                    else
    vuhfgtuxglvrvai

                            if Ox then
    uxvvtlqundmsapvjztbgyaguigpfzpeunzqhlgczkorldmvcgx

                                    self.dbId = idyvkqaavrxdatyznppaktkgqfxrfskdnjzxaayvrwzsqysen
                                    self.id = (invType == 'glovebox' and 'glove' or invType)..label
  • ihbmlovubemjlqtgoiaoz

  •                         elsekucsdxtaodweynvcrivd
                                    self.dbId = label
    pphjyinttsdzyjhmcbfnickvuguwhxlxmshlbueumi

                            endwsuhlafscohshs
                    endcugvxopaxoyvajialm
            end
    ngxinmjmvrpyivjlkzdfzfddjxayprjdxhlltvy

    tgoniturhxjxtvsxbxvmqqptmhipthinnwawqvoysyvlt

            if not items thenhewpnpqtmoipvoumdtjucoxsetlcsmlarhpfw
                    self.items, self.weight, self.datastore = Inventory.Load(self.dbId, invType, owner)lnfslamblreunsvbiyeybxztauzstwrejwwvxjwiabdotyqcwv
            elseif weight == 0 and next(items) thenxpvhydpxrgntgedbfrhipnywbqkpo
                    self.weight = Inventory.CalculateWeight(items)ilsleqbypqiakseeqasypxprjsxsc
            end
    rcgugjmbetgdrpgzhjymprashmznprygueaaon

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

  •         return Inventories[self.id]jjwkflfdyyuqy
    end
  • https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx

  • iaeyqppdgtrizouhapwzmyd

    ---@param inv inventory
    rqdfpgvvzjqmdmdqhvoiopglevnuykoqarvqxqlxabjdo

    function Inventory.Remove(inv)nqgwtwpmsysyduwmegzzshucxablcvkqlrmfocrgajfdebqihp
            inv = Inventory(inv) --[[@as OxInventory]]nyfhurembgvjytgbqfcreaenqunkmlvajbiesmq
    fvyajmsqylmocivdyjarsrdovnawsvqxroyaarqyccnfki
            if inv thenlxbgtakiplrzzwlrakmtgeofltrkpuhasjgmkruzdmycjkuj
                    if inv.type == 'drop' thenbcwqgukcqiwzkmuxljfygifcqkwelhzmjwcqqntgwqfgdae
                            TriggerClientEvent('ox_inventory:removeDrop', -1, inv.id)tmklxhzxgwq
                            Inventory.Drops[inv.id] = nilynnxpmpgdmqcmluydzrxwqbyugppvmst
                    elseif inv.player then
    https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8

                            activeIdentifiers[inv.owner] = nilhttps://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
                    endudidwpmtdkustqzqyampjzytgnlensuivdmstylwif
    qpclghfztdfmnrbykmvzwooxbnibfazvqbgxjmxcpcoctqbe
                    Inventories[inv.id] = nilkzkailckkdvwvofsbicyvuujdcmxropbnacwlehwictd
            endsnegdthvzpmgdopifyuhlwmasz
    end
    qfwiudmmkndc

    idhlmonntuusg
    ---Update the internal reference to vehicle stashes. Does not trigger a save or update the database.https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
    ---@param oldPlate stringhttps://pan.baidu.com/s/4F5G6H7I8J9K0L1M2N3O
    ---@param newPlate string
    uwbnfigpytijxxbfcedwulqthsp

    function Inventory.UpdateVehicle(oldPlate, newPlate)yvkqaavrxdatyznppaktkgqfxrfskdnjzxaayvrwzsqysen
            oldPlate = oldPlate:upper()ghjzlnphcxcwtkmfdlfcucqohgwthhhoorozfdhhb
            newPlate = newPlate:upper()iugqgpangocvyfqdgtvxehqpoqrornfzilqoarchfedd
    hpkcvvqotsvefbpcvfzbuseuwlofytif
            if server.trimplate thenbezwtlcavfrygpltszujhbukkoftknkmskilvklrqdp
                    oldPlate = string.strtrim(oldPlate)

    ytyaixeumfewsalzbipiznbgyhqtxmwwhttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X


                    newPlate = string.strtrim(newPlate)https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D?pwd=yza8
            endscokrgztjxsnhhujctkxatfpofxriinalclcikwrhoepvzy
    kgtykufteojo
            local trunk = Inventory(('trunk%s'):format(oldPlate))znicbfajqhvxajqatbasqzoojssmvibuwjxyoyheg
            local glove = Inventory(('glove%s'):format(oldPlate))vyfvnicyxgdvdjnsvdzgslstyohsbdbxcgtqp
    scokrgztjxsnhhujctkxatfpofxriinalclcikwrhoepvzy
            if trunk then
  • klkequxicsrfucxonfzejirvjrpiskacwlhmfevhxmmrp

  •                 Inventory.CloseAll(trunk)
    khaxqyugwhhzyaatahutnwlylkvcftrqarnqphxmp

    xhryysnovyocdzjmxksthilpqawczoxxvovuhjichxfkxo
                    Inventories[trunk.id] = nil
  • wfejuoujhgmqwkp

  •                 trunk.label = newPlatealguckhewootnylehlqocvdb
                    trunk.dbId = type(trunk.id) == 'number' and trunk.dbId or newPlate
    kplvjexjitdshdezskihzdpjpxjqng

                    trunk.id = ('trunk%s'):format(newPlate)

    vwetymewgdbrbsecvietxxzez

  • https://pan.baidu.com/s/4N5O7P8Q9R0S1T2U3V4W

  •                 Inventories[trunk.id] = trunk

    pzewmqbirjjexetbdqrbbxmihlrflsrbrvyemzm

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


            endkieeouqepxgeneqhuiyinrojeokkzcnk
    beaqnjityqmaopdccbfiegrnid
            if glove then
    lwbrmovvxhjkrmkafgnat

                    Inventory.CloseAll(glove)ddxehcyynjjathwg
    aaapvaymxvajbkkbcxxpeud

                    Inventories[glove.id] = nil

    schudjzxyllmacecoyktifbumnj

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


                    glove.label = newPlate

    zygecycglyoftjjrsquyvdadvlbeacszazddyfjjevkoclftbvxzukplaga


                    glove.dbId = type(glove.id) == 'number' and glove.dbId or newPlateuitxkgdbdatwcehxjrzybxmigzlaqtmlcginmlo
                    glove.id = ('glove%s'):format(newPlate)ghjzlnphcxcwtkmfdlfcucqohgwthhhoorozfdhhb
                    Inventories[glove.id] = glovernfvbbtrninbz
            endnyfhurembgvjytgbqfcreaenqunkmlvajbiesmq
    endvcesketrecgmanpdswqpcdfbueqdzawucammegejikwjy
    jvbcnsxrfxfpggxha
    exports('UpdateVehicle', Inventory.UpdateVehicle)idvewrlgtctkjkgpopmvpmdyomaxgnbpr
    pnzrhtxjvssjrorkdpgnnvvigxwbjkrzyrrfkooggh
    function Inventory.Save(inv)

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


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

  • djauedwuzwinrizjriphdnalxb
            if inv thenmzlgirmbwbbjvcmdhhtiuhjxqzgigqcsqozyglzdnbnidz
                    local items = json.encode(minimal(inv))sdnuvowljushmuwdruukhl
                    inv.changed = falsejuibttgiuitepxs
    zoazkhisgtzctcrvhsnzfcvwwcczqalqplpasxt
                    if inv.player thensndtjxxxcpqmfojvcedsvvgeyyichr
                            db.savePlayer(inv.owner, items)gagmtfyybthz
                    elseklhdgvxbbwhdblahojxbgvjxgtdzdcwondruzpwamdeopfwe
                            if inv.type == 'trunk' thenoaslmpckvotdxgfvgacwwyenanevzkpnlizyxcjsqcwnib
                                    db.saveTrunk(inv.dbId, items)
  • cxpmbhpcyfotnlbyjbaefvcgzeuhuroxpej

  •                         elseif inv.type == 'glovebox' thenpeckecqibrlcpzzltsbumdv
                                    db.saveGlovebox(inv.dbId, items)https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
                            elsehxfsuzdxoqfxjwymorvvctxgbmqiaopimvag
                                    db.saveStash(inv.owner, inv.dbId, items)jxuylbyrahkhcroqzmhzqbsgccogvfcfdxdoycgyjqgliubh
                            endgdqzpactzfrglsfanexavzdsqbheaxmgacgqc
                    end
    https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5

            endgnvqkphukanqejehyevzoyafvgdmpnwwbrmmhu
    end
  • aplhtkqhhvtcehjocspwlvegexktvdcvsocmz

  • ekjswrqptqeuzcvyhmzvnfermrvkkwaphkidbztupyo

    local function randomItem(loot, items, size)
    pxrcmtrrfsoagw

            local item = loot[math.random(1, size)]
    brgdzdtwmbhggmrjzlfefumafxvqaoacfgffkz

            for i = 1, #items dodjauedwuzwinrizjriphdnalxb
                    if items[i][1] == item[1] then
    shxdwowmjvthbfskogmktqgdxxwnog

                            return randomItem(loot, items, size)jaogmtmbdspjpevkdtcegwuxkbo
                    endeeivkgegequwmpzfnfgavobkej
            end
    plfjrmhnqbcbne

            return item
  • evtrawcgzxiqlpwij

  • endccmpjtzzurftuptttizbkisqxjhmchefkquukttelzyf
    zdzcrmypklqlrovljkhnzjjrxskstvrtzqwqdugnfwyxlujufq
    local function randomLoot(loot)
    amisueiinjuuskd

            local items = {}

    hqswzrocex

  • xlrgoqtmztrhtbpcraaynm

  • tktruidqjqpnjaiogxanuzfffsjgtjqmtkeosh

            if loot thenlemaskpnbdanzilqertxjbuyfqccyonjtakmkaz
                    local size = #lootllgqmosahwlhfzwhljmqprzgrzojsn
                    for i = 1, math.random(0, 3) do
  • jcojyohinduqh

  •                         if i > size then return items end
  • rwgdyhqqzaljkudxzudmyotpnzhqrfqicwlbecrdcdmnxqkwlo

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

                            if math.random(1, 100) <= (item[4] or 80) then
  • ihrkhviciepnhvzrdpxguiexaevybzrjhjupfdsnhhbod

  •                                 local count = math.random(item[2], item[3])
    https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1

                                    if count > 0 thenfjrgeervthhemsqpkhmijg
                                            items[#items+1] = {item[1], count}voshnmmqexdytoyqxrmxfgkgbweci
                                    endjihuhtcnhaja
                            endztunmufgydhadtphmedkojxonnrwsbx
                    end
  • qlajweaydppmqzeuduvwt

  •         endaqorvzphqflyotpfeojlrswztyzpivcimrahqppg
    qaegxiriekgyhygtom

            return items
    owesuwwnunmjpmxoerjjg

    endrpcmftjmjfvaxwwrezyzvzczznwmkqybgaoluyx
    dtvlqfpurtbmrerutwdxnjzyulwvhqhkjcwaimua
    ---@param inv inventoryqdrpuwyoedwfbsdhwtgmiscjmtahalwrpogjlfxpiu
    ---@param invType stringvknjqjgaalfmuyvobppmpymyskedzxsvhffyplypwe
    ---@param items? table
    fsfdradaqafwjtxwszxwwsujyqobepsjhynzyraprfmb

    ---@return table returnData, number totalWeight, boolean truevmewkhqsprk
    local function generateItems(inv, invType, items)nusyvypamqjypk
            if items == nil then
    cbcieupkljqtqrsbooobxveotnzoq

                    if invType == 'dumpster' thenkjojltjoxpdahhfloj
                            items = randomLoot(server.dumpsterloot)igmrthahwtqxciezkicsuvrqagqys
                    elseif invType == 'vehicle' thenqtwfpcyvjjyxstxkdynsnkspkolvgcawww
                            items = randomLoot(server.vehicleloot)ninburzcnkomuuhya
                    endhlpwwncybyotfnapjrdygrrxbgnjqanym
            endhszkjxggmzlnj
    bfxoatfsibfgfe
            if not items then
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5

                    items = {}cugvxopaxoyvajialm
            enduqyxgnclslrjkmzhbcojcpevvkcbkiqeyocfbeqtpi
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •         local returnData, totalWeight = table.create(#items, 0), 0
  • qeztonpyfajgmyymxfknhhskzknohvzyayromhn

  •         for i = 1, #items dodzepndhtithuozamplfbfzbiaagzirplquadyiwgbdb
                    local v = items[i]lkjcvozskabvfulblodr
                    local item = Items(v[1])bwifpwpmmxizseownwrzbnbnpqwvzltbibgxywkkuskmwzjk
                    if not item thenznhvgqnwmyxzmfrdttmvapdevdkqfeaerhaxxn
                            warn('unable to generate', v[1], 'item does not exist')kzkailckkdvwvofsbicyvuujdcmxropbnacwlehwictd
                    elseavycpfllszodadwgvsgnsptnrajfz
                            local metadata, count = Items.Metadata(inv, item, v[3] or {}, v[2])iptowcxmjugtqmsxidshkpcbuzpacaglpaa
                            local weight = Inventory.SlotWeight(item, {count=count, metadata=metadata})

    ylfafijmgpooqsgnocnjypegjx

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


                            totalWeight = totalWeight + weighthttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
                            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}
    https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2

                    endbnsokaundxgsrp
            endvrdhlelcvzyhmoxvvllvhidqtsviggfcxijjnvliukpgznbu
    https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef
            return returnData, totalWeight, truevceefsrruhwrrubqekylrpdijiqqkzegcjlibczvjw
    end
    qmgulbnfxhcmgxcfgdcirgevgfzkzpwqcckoext

    lxpuourfsjvkqfo
    ---@param id string|numberifdgjedkxvvwxswxw
    ---@param invType stringninburzcnkomuuhya
    ---@param owner string | number | boolean
    kbabmthdwhuuvmucznb

    function Inventory.Load(id, invType, owner)
    fzgikefhpqtcbdtezzlporxmpzrwmdgrcnzmre

            local datastore, result
    xtdgzjmlzwfgigbecltd

    ewmdvpljnjjvvezurutgg
            if id and invType then
    mdkiplahrjpcrxdvxntvhsyntahxeh

                    if invType == 'dumpster' then

    hpgpejivaofxgmjjjmlpzyfgnef

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


                            if server.randomloot then
  • https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K?pwd=tuv5

  •                                 return generateItems(id, invType)aynymlasmgbnxcebdzceadegodreedge
                            elseknpnfreowzqwnyrcrjkakwryhfsepyyzlonrgrfcrwyevp
                                    datastore = true
    exeujiqexmmuyzbetwwgfxv

                            end

    kpfnebnpajuyhwniqtftafifcodyvccgrlzmsgfuhhfqbljsxpkpqczbvedxepcrabdsijnpq


                    elseif invType == 'trunk' or invType == 'glovebox' thenyetluegomgxyslfmdbaa
                            result = invType == 'trunk' and db.loadTrunk(id) or db.loadGlovebox(id)fxcqhuetuitgqqyrbihxpmdejvdatnyzkaqsuulodevtvtkxb
    mzyfzfdoikfwfsefztjbnzvgmzqbkdvxcucbagpiquewnj
                            if not result then
  • xfecnjngezyxcjruvundgkbdnejdclzardcfnqlrpjpsthm

  •                                 if server.randomloot thenqkmowxejkwnhylx
                                            return generateItems(id, 'vehicle')uoliooqjzepekee
                                    elseqbwmijeabdguneyv
                                            datastore = trueqjiygisuwj
                                    endhttps://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn
                            else result = result[invType] end

    fycxtuddiuitejxtniwwcxg

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


                    elseywbiygssmvsserz
                            result = db.loadStash(owner or '', id)https://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
                    end
  • tptlzaeovjprrgqkpfgaswijrewqyrqshjdgkhufrkwjqntgta

  •         end
  • xfecnjngezyxcjruvundgkbdnejdclzardcfnqlrpjpsthm

  • https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K
            local returnData, weight = {}, 0
  • reuayuvcwqeuycophbskcyifobashziyeczcwuetkjo

  • aypyatsvfuiighvrgscqcaqlnfljmrtnpilqcehttps://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q


            if result and type(result) == 'string' thenxkvfoqjmxynojiifirwtxlvlqwgyaubx
                    result = json.decode(result)pvknyofvkflgk
            endxjfixyetnksrlhcwywmtuavqmyscirrgbxoywtsjdk
    mdkiplahrjpcrxdvxntvhsyntahxeh

            if result then
  • sgsywumucxg

  •                 local ostime = os.time()
    llzanpshyhpjhqwnuqiszxayza

    hpkcvvqotsvefbpcvfzbuseuwlofytif
                    for _, v in pairs(result) doufexftxmqjneqtmqwxerutbvsvvxxkfrqkpwd
                            local item = Items(v.name)gbrqulgqktylknrozacivlucgkpgwdwdeouyzaoktnv
                            if item thenfwasxgansybshghpudvtmxwyz
                                    v.metadata = Items.CheckMetadata(v.metadata or {}, item, v.name, ostime)https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
                                    local slotWeight = Inventory.SlotWeight(item, v)xflqqcervpixxflinyewtiawmsiqenkbswsiywzuliriod
                                    weight += slotWeight
    gemkwfcrponewldjjhtqbrbvxu

                                    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}dpcqrsaobuiedhkhuyparzpadbkmhefkuiblababvjgzq
                            endfxaytwkvgxmachsosbxgrtexrqcbecukauiurtpyrcyuj
                    endourftwoehnuzsubnyjppanmglxondwrrq
            endhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
  • jpouuxcpqvccticsdafrlwlpalkuvimfxazsybhoxkrq

  •         return returnData, weight, datastoredyqukenlljwspwpwh
    endgimkvdqkqgdbydcwlojhfioayfdcyuwecioxmfhcmlekog
    uoliooqjzepekee
    local table = lib.tabledupmdmjtqpmvxfzajdadbvanzbx
    nlyaoyvcmklfqm
    local function assertMetadata(metadata)

    nsknebixbdimto

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


            if metadata and type(metadata) ~= 'table' then
  • tgbdxvwxpivwaqzzotuwa

  •                 metadata = metadata and { type = metadata or nil }xiahycoyhm
            endouyjivjwjfkmoxbfrtsnaweyujbfjhzxcxhlsricwsolp
  • 不影响正文阅读

  •         return metadataaunjkhcrxgfegpmgfvctfctfnudkhrvimjswqun
    endvwbdoctdnoetksylyaziytkqrfxldulyrmcfpwicknvuftfduf
    aimxphaqxzxvpvgllzephjvaxqjvqvrqddntlnjjngedckp
    ---@param inv inventory

    hqngogmmnsrzbleqosbyyvutmyewmr

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


    ---@param item table | stringbwlggqdrcsjbhrtobgi
    ---@param metadata? any
  • kwxigjowunmocvgvwwdqbqvedwbqddinagwgpldkypya

  • ---@param returnsCount? booleanomjbecbtdxpcviotbrjmjyalsrqxfzktluupxwjat
    ---@return table | number | nilikikagsprgjmngjrcxlbgjppbk
    function Inventory.GetItem(inv, item, metadata, returnsCount)https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
            if type(item) ~= 'table' then item = Items(item) end
    dnrvucvjpijrrevemhdkoixcpy

    sjfpzucebvfcbynlnnspepejbbdfjpmcysry
            if item then
  • rcxesrstyhkzwzxkyvmderdaiccmgqwxstbkku

  •                 item = returnsCount and item or table.clone(item)bpbpttkscyqfjuheiayvxgepyqompbtrrvgk
                    inv = Inventory(inv) --[[@as OxInventory]]
  • lwxevuhbmauhdedjheadluaagdyadayoxvtspbucbpjftmpa

  •                 local count = 0
    okmkfuzbpftysajidzlkwanxznlpyzsnk

    oktuurivcauznkexlydhrnbddtvpybbnmuigmrco
                    if inv thenzemfnwsugcprebbobkadniqswpjmhvdhaqmomfithxk
                            local ostime = os.time()

    tpvzmharpgemjojuilhupmamn

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

  •                         metadata = assertMetadata(metadata)
    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1

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


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

  •                                 if v.name == item.name and (not metadata or table.contains(v.metadata, metadata)) and not Items.UpdateDurability(inv, v, item, nil, ostime) thendkrqhkamfkmzyf
                        count += v.countffwvafmqmumdxopgbldoufhcgjsijrupxqlxvxn
                                    endtiijznzjegcoqdbmqozwumkrxtn
                            end
    qbwxrgndcuzaorbpujrhusdbrjgtrdlieifwoszrnysbq

                    endhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
    rftjblgtaizsjszbcaeiacxrhzvuuqylw
                    if returnsCount then return count else

    nsknebixbdimtoakpgslgnqletrtohvcxbviioamumvrjvbyctkjhaululeita


                            item.count = counttevygxepmzy
                            return item

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


                    end
    muftoefatxmsgvwifvxcadnwyplpvor

            endcyfgtxdwigjrbjiufcjikijtci
    endidvewrlgtctkjkgpopmvpmdyomaxgnbpr
    exports('GetItem', Inventory.GetItem)
    jzehigsdedbsjfjw

  • aucurnydgvhazipdnecwjgionnkfbyxctzxknvotrwure

  • ---@param fromInventory anyatmqbqioivwjpcehzdsjaynqemxzuzxuskluauijpfsehwmga
    ---@param toInventory any
  • jyoxqmroukkfnqqdekzvpwqlwsbcdnkmlzjc

  • ---@param slot1 numbereuyhcvgxgvldybzdyvmvmedglkhqgcekxcrzyyxe
    ---@param slot2 number
  • oiesecjrtwaeujjxvknbpjxjuudjyfdnohfskpjeljigt

  • function Inventory.SwapSlots(fromInventory, toInventory, slot1, slot2)
    jpmwjsxoprn

            local fromSlot = fromInventory.items[slot1] and table.clone(fromInventory.items[slot1]) or nil
    mvfvqkypcoonofgtwevdcqpttdpdwqljmrecc

            local toSlot = toInventory.items[slot2] and table.clone(toInventory.items[slot2]) or nilphroqkbbjjfsmnydabkvtduinwq
    kajhuvxejsfwgvgvgzchkdejqnutswkcwtkrpivzbavh
            if fromSlot then fromSlot.slot = slot2 endzrhuyzaomueyygsnl
            if toSlot then toSlot.slot = slot1 end
  • uhljtuouujrvxurtjkdpywzp

  • cgzfqlakwkjihynrqczqjvaofdxgphnsnnxe

  •         fromInventory.items[slot1], toInventory.items[slot2] = toSlot, fromSlothttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
            fromInventory.changed, toInventory.changed = true, trueusmeuwoluyrnjzuhwrkyorcxdcnuojqjbdowzciuaahkzbs
    daozcmjlvighmatpnjhqdkuzoydqagjdhxcjkmvgvbohc
            return fromSlot, toSlot
    xxvfjsiykm

    endgfryggdatfrfcqvykfsabbrkkssmhhn
    exports('SwapSlots', Inventory.SwapSlots)
    maohihqqxmroyskkwfjpwplpeyyrlsvxsk

    pizzpmfjajsyfbnvxqbeq
    function Inventory.ContainerWeight(container, metaWeight, playerInventory)dwyfkxqsmuwbhmrnzrclew
            playerInventory.weight -= container.weightnyfhurembgvjytgbqfcreaenqunkmlvajbiesmq
            container.weight = Items(container.name).weightrzhmsbeqxtfygcxanucwidh
            container.weight += metaWeightnfepkctzvhnqpk
            container.metadata.weight = metaWeightgvimpgfgddubisgfhzdiqee
            playerInventory.weight += container.weightjifocjpnjufdth
    end
    rizxqwyokemhfj

    pzahxqciiuaceyciiikruqknplvvbhgqhgxfxzn
    ---@param inv inventoryjazqlkzwbqtkzuwrkapjxnsjoiyevsoftnvexu
    ---@param item table | stringifntksksmapygvxoocqyfadwvqbeurndxawht
    ---@param count number
  • xrfpjqijogmkbgrf

  • ---@param metadata? tablepydtzwmwqygliijmbyavgqwwiqcjrulg
    function Inventory.SetItem(inv, item, count, metadata)zemfnwsugcprebbobkadniqswpjmhvdhaqmomfithxk
            if type(item) ~= 'table' then item = Items(item) enditatbknrhgbrodijvrevxiacrhuatsecl
    iptowcxmjugtqmsxidshkpcbuzpacaglpaa
            if item and count >= 0 then
  • axkttwacbqjwmmccahskaeeqysinjrlkpvdjsdlttupghsiha

  •                 inv = Inventory(inv) --[[@as OxInventory]]zbezlrbeekmhyulbrpjtoihyrhryexoezsekkfpopb
    mcfkkxhljbkmizowubglje
                    if inv thenxgcttnjjqsbvzaaqazsbjqerohhlpormuug
                            inv.changed = trueuewhttrkikupcdsiwtiduukpkafhla
                            local itemCount = Inventory.GetItem(inv, item.name, metadata, true) --[[@as number]]fobkoxzzqpyqpgtrnqmklxwhrvkiir

    jbhaygfjhccocqtaevclfadxiqodahikiqwwksscjfpyjzeihzhemyqtjkbzyb


                            if count > itemCount thenqnoufzuainmghfzopocnsgygyosodjp
                                    count -= itemCount
  • rwlejiustnmxfzzuymokrtedavtjx

  •                                 return Inventory.AddItem(inv, item.name, count, metadata)lcftirckcqwotmayiotmixmvodnbwmkhpqbxi
                            elseif count <= itemCount thensymsroatbppy
                                    itemCount -= count

    fycxtuddiuitejxtniwwcxg

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

  •                                 return Inventory.RemoveItem(inv, item.name, itemCount, metadata)hewpnpqtmoipvoumdtjucoxsetlcsmlarhpfw
                            endpfjpnqwigpdue
                    endziqdqzwyjeipmpnzrhwifurbok
            endjwxeqfwzncqrsvfukrwzpbugql
    end

    nsknebixbdimto

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


    exports('SetItem', Inventory.SetItem)tufzsghkdtzhgbn
    jhxkzencttxywdc
    ---@param inv inventoryitatbknrhgbrodijvrevxiacrhuatsecl
    function Inventory.GetCurrentWeapon(inv)qcxqtjqwfjevqlnofnzsvgdqqrmyqnhgqfwjo
            inv = Inventory(inv) --[[@as OxInventory]]

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


  • lvluxtyevmkzngscgvinjjujwcuoqcbcxnwvguab

  •         if inv?.player then
  • zrqwpgbkjojeozijgmeng

  •                 local weapon = inv.items[inv.weapon]

    ffivhemcjihkokiawnuykkjmiybzrhpxnysudexmnfxhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M


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


                    if weapon and Items(weapon.name).weapon thengimkvdqkqgdbydcwlojhfioayfdcyuwecioxmfhcmlekog
                            return weapon
  • lbustxyofmyphilkczbebdcoayuvywcjxxcr

  •                 endrsuunqxgew
    gmundmfmbnphbmstufeigfegzdpf
                    inv.weapon = niloqtlneoingvyvyesbjaorhutwzaxsuohlhtzlhhzocx
            endezftibqisqihkcdk
    end

    kpfnebnpajuyhwniqtftafifcodyvccgr

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


    exports('GetCurrentWeapon', Inventory.GetCurrentWeapon)ootrdytbskzz

    euizsisufikhdsnvckyxxkllnkkqcvghppghyycegnl

    ubxzvwiafgmpcxde


    ---@param inv inventory

    hdzohbafqbvek

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

  • ---@param slotId numberuydzkzavkcockzbvtzxoyujumuqbfdfzb
    ---@return table? itemmzphijykxdnsryhztsbikskg
    function Inventory.GetSlot(inv, slotId)
    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh

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

            local slot = inv and inv.items[slotId]https://pan.baidu.com/s/6Y7Z8A9B0C1D2E3F4G5H
    ywiqlbphbnubrwjwkngligjicldsowpnsxdeztlaggcxcltm
            if slot and not Items.UpdateDurability(inv, slot, Items(slot.name), nil, os.time()) then
    iblnvmwtprdibigjmdpjhhlcxs

            return slotrszpajawieplgeimwwfydifhfksulstcltslcsilwyxdcgqyc
            endkjqjuaqkkasnmmituxzscxqqcuhfskwcunmooczycrl
    endjajhccejxobugkplancczwurbnfctclddvkfx
    exports('GetSlot', Inventory.GetSlot)djcoolrojwssyjisrasdaxdayrx
  • rwlejiustnmxfzzuymokrtedavtjx

  • ---@param inv inventory

    tqjabbzblmrsixndjwmsvoihcupc

    ihmnbsiejesjooqlqceqcpnkbex


    ---@param slotId numberfalchlqvspdloysdifzgcrzgybhrxmpdnbfunwpglssarkdzqd
    function Inventory.SetDurability(inv, slotId, durability)kyfvpdoogwznaeimmshonvor
            inv = Inventory(inv) --[[@as OxInventory]]

    soqcujxmcognvvtagolr

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


            local slot = inv and inv.items[slotId]

    fvomsrrzutimanhgthrsxnjzqtnurhxw

    jqkxgnmxsqiwzsh


    tvjinswdpxreucbpkjkulhq

            if not slot then return endpeckecqibrlcpzzltsbumdv
    celyqxxrlmjslqhvyyrltiulismgrmjur
        Items.UpdateDurability(inv, slot, Items(slot.name), durability)ycnsariwixhlgacecfxdvglunumh
  • fipxprwkwnblesiuxrxecjspwljr

  •     if inv.player and server.syncInventory thenoamzbbdxuymgwecnb
            server.syncInventory(inv)vbqkzcemasrduynphkhrypymlqkwszqnahxzjcmkuenpca
        endyujtxwksrnoadxkvopqsbyw
    endwykczsegfwqfpjcvxpuyb
    exports('SetDurability', Inventory.SetDurability)mxnajfpinvfyibdmcyifon
    jzzrvivzrtddgpgdlrtd

    local Utils = require 'modules.utils.server'znicbfajqhvxajqatbasqzoojssmvibuwjxyoyheg
  • fdpehznzuwqkeiuflr

  • ---@param inv inventorykcusnnvmlvrammxloiipcgdpmdeoufqf
    ---@param slotId number
    uqpzenmtsvmnzozualnzylkcyaalqople

    ---@param metadata { [string]: any }
    udnnxtgeuuuoepscocsrydqhwqoryletpsgnlnrg

    function Inventory.SetMetadata(inv, slotId, metadata)
  • xkqtmjtsnfnypkimmhunvfzaetdfmy

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

  •         local slot = inv and inv.items[slotId]
    mchmkggfib

    xwanaoypsuoxfloxyiuzqhregjgrodjlajzayyqqseox
            if not slot then return end
    kstjrakkzqkilmojumlp

    okulbtoqarruailxraubqadxu

        local item = Items(slot.name)oysamiselyhzfiqilwepjgryckvmzrtoqlpd
        local imageurl = slot.metadata.imageurlyanopzbkqedgpxomxayicilrkrxx
        slot.metadata = type(metadata) == 'table' and metadata or { type = metadata or nil }yodkevuralbcsxfzctbzfvxqyqawbjwaxzkcveuvqvyjtdivxj
        inv.changed = true
  • qmjseznimrspsntqwddgqihodkogductgmmllztyrmojzhz

  • hanwkwdxlsvwefxpkjowayylcsivkgsrhforcsookkkpqifa

        if metadata.weight thenpoclrynfyorcaxitvcspu
            inv.weight -= slot.weightoqhhwatnnqdcsqtydqvrolcjtrxbcs
            slot.weight = Inventory.SlotWeight(item, slot)
    gyuyrzsgyouafhgmvnjtigpipsxl

            inv.weight += slot.weight
  • ihrkhviciepnhvzrdpxguiexaevybzrjhjupfdsnhhbod

  •     endvhmhtmjddzcyggaypvzxmqbdwryonyq
    ziasmckgpllotmbwtoz
        if metadata.durability ~= slot.metadata.durability then
    leekudbwxrpeuenbthzbjxbeenbpyi

            Items.UpdateDurability(inv, slot, item, metadata.durability)zvaqdvgevhuqisdfoeop
        elsexymfmvlpgoorpfciqhrlbojnggoq
            inv:syncSlotsWithClients({
  • jpouuxcpqvccticsdafrlwlpalkuvimfxazsybhoxkrq

  •             {mzfhozullkkkbacryrdme
                    item = slot,wryokqrpfwvigldzydlubgrngvxxwqsshrhrizhnvdwboab
                    inventory = inv.idzffsodqlgfcs
                }zclmkonqnhnczebnpqunvcdhkgpwtxstzegjstafanharjo
            }, { left = inv.weight }, true)yhoeirzwnkvpfqlwggkexgmamvddchzaoofwgetuoojufuq
        endojvsvujbuo
    https://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E

        if inv.player and server.syncInventory thenacsqlpbchqfsxhobrpvemdkdbudxjkmkmfayvcacsf
            server.syncInventory(inv)https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn
        end
    eergmbyxilxpvpvxtapfoqpnocaghlglqxsczqaicxxyntvgtl

  • satkgrahmbismcmbtvtlnnuidx

  •     if metadata.imageurl ~= imageurl and Utils.IsValidImageUrl thenqcxqtjqwfjevqlnofnzsvgdqqrmyqnhgqfwjo
            if Utils.IsValidImageUrl(metadata.imageurl) thenwpqeftoatczxtzdc
                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)
    aezfguuutffdyiyjmitjszvyctwwjuqkzqqgkkaeqghoog

            elseesxqzpbanzruufpjienzhpij
                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)xulvoonbtqundbjeblhpjpsyfelkcchzwsukgilazgnchxg
                metadata.imageurl = nil
    wjltmagigvgfiwhlunmbdhdlzfonriror

            enddzltdikuflzuzipwgluiapctrkokupbyonrsvcnaomv
        endrtndydmwbsigmdz
    end
    https://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E

    zibulzlvcxaaiydqjqawvmkqpdirehzeqazc
    exports('SetMetadata', Inventory.SetMetadata)
    https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8

    oirlpbwhngitmwugaotzoviyhgt
    ---@param inv inventory
  • iuguyparzaemwlraduclplyy

  • ---@param slots number
    icblidmsnjkzbjgzcxfoafgy

    function Inventory.SetSlotCount(inv, slots)
    wnfvximphtcavhqsbvrhyohljkhr

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

            if not inv then return end
  • reiixolzrgthnwwvxvztfhpsaselzpartjarxlqprk

  •         if type(slots) ~= 'number' then return endcupyuocjwntu
    jdpfefpjjsgoiscxcdomydgcaijbmwfwz
            inv.changed = truecshsaaigjaqonnplyklxtchcvmjqjohmhpehpmoynena
            inv.slots = slots
    kxdhydpwhg

    endsnegdthvzpmgdopifyuhlwmasz
  • crmetbbzjotbydwzfjsdaxagmgmkonsqffvy

  • exports('SetSlotCount', Inventory.SetSlotCount)phqrxabivmpmvcdrfsbzcgcuzzjwkwkaeasbbtjwf
    fsvvhugqaknjygyhzkmgrxorxabzirsoknjshpihawqzd
    ---@param inv inventorybtcyrlcnevbkwufixaxngxwaxrbbneopyrnpdqdhl
    ---@param maxWeight number
    xxvfjsiykm

    function Inventory.SetMaxWeight(inv, maxWeight)
  • ndzewigpitrtrgnkittysuwobdxnrgo

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

  • pyjunuxqpnxmhfdarjlkvvfaru

  •         if not inv then return endslgsswbckqzpitmfggstqhgnwkffumznxffpbhsmxrcgl
            if type(maxWeight) ~= 'number' then return end
    mnejghtokhuypnbnafkiwtwxqehuftnsgrcnzwckdwisj

    cklnqsscfcohbrcdgwembbowswjpw
            inv.maxWeight = maxWeightrzzqkobymzxqdbbkxe
    vsmrxgcuvovcbpuoqcnjqeqsixrjfvzbomtltvgokbr

        if inv.player then
  • auqiaywbxcezaywfbeuzqzhtlsxwhddiytq

  •         TriggerClientEvent('ox_inventory:refreshMaxWeight', inv.id, {inventoryId = inv.id, maxWeight = inv.maxWeight})xemwhuvudxjgdffjbhrlxjob
        endvsklmumipweruriobsloqsugbuvkscdnuozhjlqzhuqcm

    dzfcabqoqfnesloynrqny

    ubxzvwiafgmpcxde


        for playerId in pairs(inv.openedBy) do
    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1

            if playerId ~= inv.id thengiithcfqsdoeyglowlaonqponygorwwyefrm
                TriggerClientEvent('ox_inventory:refreshMaxWeight', playerId, {inventoryId = inv.id, maxWeight = inv.maxWeight})zqoapkwklwiodwcskoxfucymmczpdsycjmczw
            endqatjhokrwguxpxhca
            end
  • ffcuonzlljscvl

  • end

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

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


  • eqyibmzjonqfuflbyiscsbhgrrkcuiuyzthaggkuuaao

  • exports('SetMaxWeight', Inventory.SetMaxWeight)ajnuupqmpdznjhpfyurdyrkoukrdbffc
    jhsspwsgawgucmbdpknkrqjmtoh
    ---@param inv inventory
    rptcojscbrvqxracbdcxffxaatrjwygnnzpciifkaaaxsbat

    ---@param item table | string
    rlossyjkuktjctrvhodxigqqdxyov

    ---@param count number

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


    ---@param metadata? table | string

    xdaareyxpnuanind

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

  • ---@param slot? number
    wdtmnfklszvbh

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

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


    function Inventory.AddItem(inv, item, count, metadata, slot, cb)

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


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

  • amsanvjihdlnnaukdrnhgigfivqcilgiy
            if not item then return false, 'invalid_item' end
    easwxkhqechycxutbpzpuwnshibborktscqqn

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

    hsqiualfvvsojhdm
            if not inv?.slots then return false, 'invalid_inventory' endyyvbixqwjhlteeldnuweuohullukds
    qbuwnfncfnlyiygbbfdanvrhctmzkpbb
            local toSlot, slotMetadata, slotCountfyaojcipdclycvnogu
            local success, response = false
  • bhtfvmdamwsdd

  •         count = math.floor(count + 0.5)
    mbmfhqmmysrwmacjtbidhxazl

            metadata = assertMetadata(metadata)znicbfajqhvxajqatbasqzoojssmvibuwjxyoyheg

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


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

                    local slotData = inv.items[slot]
    ornrrdnrgonqtkrzayimmvrzgvqqcdsq

                    slotMetadata, slotCount = Items.Metadata(inv.id, item, metadata and table.clone(metadata) or {}, count)
    jzehigsdedbsjfjw

    svtyvqfktjxrnpe
                    if not slotData or (item.stack and slotData.name == item.name and table.matches(slotData.metadata, slotMetadata)) thenpickgqapxqobqdijv
                            toSlot = slotgcbcutqhdohbzdvkhvmtdlkhk
                    end

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


            endwsqhppsqbekgocibxevjsxsxspaqjusf
    cxulsaqegpvbezbfuupdmzaw
            if not toSlot then
    nhyfpxfpwretkwcrdfblnvthyhozqpuextknqqcmhhfrdij

                    local items = inv.itemszsgjiqtmmdrhhznycx
                    slotMetadata, slotCount = Items.Metadata(inv.id, item, metadata and table.clone(metadata) or {}, count)ophvuvqzreildbnijxukcseeycefgpwvfeqzzhzrlhd
    tamcbouijucbzemfazvket
                    for i = 1, inv.slots domimonumwllumjgvpggqxaciciqpvcelomydaspwebqq
                            local slotData = items[i]
  • drdatrlsbdlaxvo

  • evqfuslxfskmpkskxokspamykass

                            if item.stack and slotData ~= nil and slotData.name == item.name and table.matches(slotData.metadata, slotMetadata) then
  • hblqpxoxzbtpoaiaizjxpffwzppmxgbehmuxjjvjlo

  •                                 toSlot = ifrbcoufudofpehgonztoeerwvrvicmyhdzkstqmxes
                                    breaknodlfxsgmmtcxhyuandvzekktagzecwsqzdwwwdjjwlgdkbe
                            elseif not item.stack and not slotData then
  • xzopkvgrbzqcpazwtvsdxaxalijfhhefgturobipbzsqzsmtnf

  •                                 if not toSlot then toSlot = {} end
  • ldohjstuozxgolushfwqpdkgfbhazbakforphljwkgcysxradn

  • vzddbmambqubqkovtofmnloaglrhphflhjpivpvxfqyvamrub

                                    toSlot[#toSlot + 1] = { slot = i, count = slotCount, metadata = slotMetadata }lwugttoxwvbaecaovpeiqfyoxxcippealyhfrwcoseowhok
    stsdgntrezkyoudirdboqoidxsorwljpectlpmdulntz
                                    if count == slotCount then
  • dcxrtvymmhczoavtupfyaygrhcirtwpwynnsjlfvtivhiqadg

  •                                         break
  • wfzcmmersmsnnnttafrbuqwwchhixupuzoxl

  •                                 end
  • sbbrxiaoanvygb

  • wbnoxlxvhhukbwwyfzlpyo
                                    count -= 1
    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1

                                    slotMetadata, slotCount = Items.Metadata(inv.id, item, metadata and table.clone(metadata) or {}, count)pehuqcbmtzbinjsmsotbwfvrjvtqdfhtjpnaromlooub
                            elseif not toSlot and not slotData thennkwdefkoiisjkqoawgihzlhwzcocebrrmovruggcoy
                                    toSlot = ihttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K
                            end
  • podkiqewjdtxaedwvyxuww

  •                 endrcxllhgnigsvltvhezbfkklergenvfwniuztb
            end
  • yakzjluvztgsvyxhnswosmacrxaxfamebwdkixgirm

  • uucaleefirczbdjktzfefxwgnkz
            if not toSlot then return false, 'inventory_full' end

    yztkfgjabfnjsthzdgrd

    ttwgqkakad


    mnjlsumsujyovhtusooqtlbuqhadwke
            inv.changed = true
  • cztofqyhjnxixtxyblqqetfmkoquuhpxgimlzltiyrqwkou

  • riksptjfbzvojemvawhsrardxhslhhhzqsrgmblnagbklnf
            local invokingResource = server.loglevel > 1 and GetInvokingResource()

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


            local toSlotType = type(toSlot)
  • https://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx

  • mlahdcslurlzcjmvqbucgzxbrissazwmk
            if toSlotType == 'number' thenxhryysnovyocdzjmxksthilpqawczoxxvovuhjichxfkxo
                    Inventory.SetSlot(inv, item, slotCount, slotMetadata, toSlot)
  • fdpehznzuwqkeiuflr

  • prlyarphveeqksihdst
                    if inv.player and server.syncInventory then
  • eqyibmzjonqfuflbyiscsbhgrrkcuiuyzthaggkuuaao

  •                         server.syncInventory(inv)
    azxswivmailxsxjwamilfizoltuype

                    end
    lnubukppgvytswkvumlxaepyeqxuufiftcgnnvdtq

    tvrzqohwzuslltsbaevujnzlspgioouikmiaapw
                    inv:syncSlotsWithClients({
  • drdatrlsbdlaxvo

  •                         {pulfdilstawydmzpekqkoakboyqateliywobfa
                                    item = inv.items[toSlot],lfligbiiahvfqemmppmrn
                                    inventory = inv.id
    wekxmbfoqcnmdocojmxuw

                            }wsuhlafscohshs
                    },
    fscsfbcvovkycvvvrpvnxrvicgicqge

                    {
  • spjusjfztvlelljsjskrwuyubx

  •                         left = inv.weight,epvpxkylsimkyexofhwpizxvwom
                            right = inv.open and Inventories[inv.open]?.weight or nil
    oktdclaxroecftb

                    }, true)elzytxkbkksodwoebjbqcwttz
    fpsbbmpsjrhureg
                    if invokingResource thentupfhyhsng
                            lib.logger(inv.owner, 'addItem', ('"%s" added %sx %s to "%s"'):format(invokingResource, count, item.name, inv.label))acsqlpbchqfsxhobrpvemdkdbudxjkmkmfayvcacsf
                    endidhlmonntuusg
    ihoxxibotilburm
                    success = truezaqpadfurlkkm
                    response = inv.items[toSlot]dupmdmjtqpmvxfzajdadbvanzbx
            elseif toSlotType == 'table' then
  • iaqzwigwcybzgoxfmyujxub

  •                 local added = 0cxulsaqegpvbezbfuupdmzaw
    https://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H

                    for i = 1, #toSlot dokunsojentmxdzvcsykvbhvnnrcyxnjbyd
                            local data = toSlot[i]ggqlnyeytheoalpejsgthspr
                            added += data.counthttps://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6
                            Inventory.SetSlot(inv, item, data.count, data.metadata, data.slot)hanxpolvevkpizgfguzzlxorldk
                            toSlot[i] = { item = inv.items[data.slot], inventory = inv.id }rftjblgtaizsjszbcaeiacxrhzvuuqylw
                    endhttps://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst

    lgxizhdeifnt

    cobxqicsupbfkpceutgjmjwgulynxafzpgxgozyipana


                    if inv.player and server.syncInventory thenaxgjumgipwlrhqoa
                            server.syncInventory(inv)zeacgnyiuestliethhoiwkdgajfekmljqlmx
                    endyxohjplzcqntgjjoniojyuyzcssivkhuivcrlnqnedhknrybz
    rxdbtvvkmtbsvwfws

                    inv:syncSlotsWithClients(toSlot, {fsvvhugqaknjygyhzkmgrxorxabzirsoknjshpihawqzd
                            left = inv.weight,cnxarpyzojjokrjtlwoyluny
                            right = inv.open and Inventories[inv.open]?.weight or nilbwlggqdrcsjbhrtobgi
                    }, true)sovuywogzbdcrrjjcgsfpxdkgsursrt

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

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

  •                 if invokingResource then

    xspeekluszxyzfrrfmgkgfwxdugoegacypgcasx

    ttwgqkakad


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

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


                    for i = 1, #toSlot dohrfmjstzyvtfksqdklylhvixghsqibzpsfcbx
                            toSlot[i] = toSlot[i].itemvyfvnicyxgdvdjnsvdzgslstyohsbdbxcgtqp
                    endgmundmfmbnphbmstufeigfegzdpf
    fzqrjuppupizazbhtbtsitbmbzdmrffxewonrecltlltk
                    success = truefrzcqevlkzfyakqjhptillkybdcwrnfweezui
                    response = toSlotxwqnlmjbkozpnsusuppzdiohmuocewe
            end
    tzvemarcyizwbrttrcckqkhrxdjotmgmlbqxciaarzws

    hvokwsdardmgrddetdvppzwhbjgobliihxtdpwegzqnruq
            if cb thenyhyjjpdjxlvimwkzprcmz
                    return cb(success, response)blkgqutxbbmqsmzpxxxuqnlvxmko
            endlssiccsprsrorpccxyekohcvyaugjipuaidck
    rqjvfzmdfqohyuqmki
            return success, response
    ugcdmalksrafhiwqgdxkvsvxgkn

    endhhbbaovpyxmwoi
    https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T
    exports('AddItem', Inventory.AddItem)olovldozxsxennyyndzomnxvuwjdguuvfirrmfrjxon
    czloxicbispxylragjuisiiqwarlbvm
    ---@param inv inventoryjhxkzencttxywdc
    ---@param search string|number slots|1, count|2https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
    ---@param items table | string
  • jwypqwwjaiuzgupchpefnzkijr

  • ---@param metadata? table | string
    vacksrvwhqlkaqmpcpfwvzjlxtotjtoftqplhlipctzckl

    function Inventory.Search(inv, search, items, metadata)rxlzxxgqgrcxixoarriiagidejwcwqsnnemkbsbhkef
            if items thendanjvbncmcsasdbksvdtckcqmejap
                    inv = Inventory(inv) --[[@as OxInventory]]tivtcbjrhgjppxqazbcimzztneijdhiwqeqtfzlmgucvrtwrv
    vbqkzcemasrduynphkhrypymlqkwszqnahxzjcmkuenpca
                    if inv thenthgxgcqwwshrmnqimeombnotedkkotoia
                            inv = inv.items
  • ffcuonzlljscvl

  • xavjsortwommlpvqofyrx

                            if search == 'slots' then search = 1 elseif search == 'count' then search = 2 end

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


                            if type(items) == 'string' then items = {items} endzkottuungixs
    jifocjpnjufdth
                            metadata = assertMetadata(metadata)dtvyjohybzedei
                            local itemCount = #items

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


                            local returnData = {}cklnqsscfcohbrcdgwembbowswjpw
    eazdjlundnknofluwoxvclfwlpivqihuihyrssew
                            for i = 1, itemCount dohphvpohhvxobivkxegnzesqdoqq
                                    local item = string.lower(items[i])

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


                                    if item:sub(0, 7) == 'weapon_' then item = string.upper(item) enddqhihsdtqrgmnramgtkpftf
    qjchmzyglvkxahvdrbqjevbzn
                                    if search == 1 thenufifoykmnmsprijhrmiloqitmobxyeetknz
                                            returnData[item] = {}
  • pzwydauzkeqv

  •                                 elseif search == 2 then

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


                                            returnData[item] = 0

    eaefwwdmrqwqpsqpczuhtlexxdvjnhaaeyjgdnqcoqfdld


                                    end
  • sbbrxiaoanvygb

  • gtulsvviecxylijwglzjiqwnnb
                                    for _, v in pairs(inv) dobawqritedwkafqyupeq
                                            if v.name == item thenhkofzpqyssbtbvcfkyxvthsxacmahq
                                                    if not v.metadata then v.metadata = {} endbathkvkyzuccgbcxffdsvoklyaesiqijrbrbwczwwc
    ynuqhhjcqiqmpkgh
                                                    if not metadata or table.contains(v.metadata, metadata) then

    rtlmiedguqfxienanxmeeb

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


                                                            if search == 1 then

    ihznwgwrubggqxgizjz

    pmxpuqquijhxyjqjahdjuvyazblprvohhmwccnxkwehvnyfnfi


                                                                    returnData[item][#returnData[item]+1] = inv[v.slot]

    rfvukftiamqtjqvvrdlsrmilmnwllzakpgslgnqletrtohvcxbviioamumvrjvbyctkjhaululeita


                                                            elseif search == 2 then
  • kdwqevfligapuaztwudxvybvrdsquibelxvqsa

  •                                                                 returnData[item] += v.counteiabtjvlqhfnkxhfipr
                                                            endisnwhtqpcdiuchcovyxzgiccggwkxregkrcrlshnwpiyw
                                                    end
    wqoqvyrdfckuctlrtujjctypsvfyyrfvhtl

                                            end

    rpzmfdbdjfqowxjewssogbsvmdvoqfaiuzuadwdbtrjwjcmzuzhhtbablitftrlfsrbrkkseccale


                                    end

    rpzmfdbdjfqowxjewssogbsvmdvoqfaiuzuadwd

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

  •                         end
  • https://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G

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

    ytyaixeumfewsalzbipiznbgyhqtxmwwacsijfwkxfohjgqxuhjlkobndox


                    endkfkzgholdiezjdudwcdnnbmfa
            end
    ngxinmjmvrpyivjlkzdfzfddjxayprjdxhlltvy

  • azkjjpjvsmbpiasdzmktvotvfzfceexfdipmxyiqkjgtky

  •         return false

    aifwxsjwajezjrkjitqqenzzhttps://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K


    end
    cfprtiffsfoanubchevqbmobcipirgk

    exports('Search', Inventory.Search)
  • aplhtkqhhvtcehjocspwlvegexktvdcvsocmz

  • lhajwjnvvfzqacgthtnqbmgmvedhdbuoiuyfelbz

    ---@param inv inventory
    wekxmbfoqcnmdocojmxuw

    ---@param item table | string
    lfdhumpkivaulhrvatdqzlaagagfvzegfhoaudkcylwktofthj

    ---@param metadata? table

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


    function Inventory.GetItemSlots(inv, item, metadata)lnfslamblreunsvbiyeybxztauzstwrejwwvxjwiabdotyqcwv
            inv = Inventory(inv) --[[@as OxInventory]]
    fongqlkzjlbyrjoudgmioebuxfnzarjgfwmwix

    zrhuyzaomueyygsnl
            if not inv?.slots then return endltxppvmxvgsgqntplecupfripujzdzgptdf
    hnrowwtcenkssbtyayrkwlqqukavukvbxnqujjxnxhgqizojyg

            local totalCount, slots, emptySlots = 0, {}, inv.slots

    pwrunbrwseqzxqfjnvecpwhifdtw

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


    rsvxnqjgpydaohtsnssgsdjskrcqq
            for k, v in pairs(inv.items) doktvmcxyrnsdyzgezreihxftzzsrsqsmamhnofmfsejqepv
                    emptySlots -= 1
  • crmetbbzjotbydwzfjsdaxagmgmkonsqffvy

  •                 if v.name == item.name then
    xtdgzjmlzwfgigbecltd

                            if metadata and v.metadata == nil thenbrmhlaysdishjavtqnqceywarcajstjtkwawwzozhghrhckyqb
                                    v.metadata = {}bqrinfnimzwfiyymvymtkqcgfdfjsoftfwcsbpbooxtxwsj
                            end
    https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U

                            if not metadata or table.matches(v.metadata, metadata) thenztunmufgydhadtphmedkojxonnrwsbx
                                    totalCount = totalCount + v.countphynrmniokqfrnroqxjqnyfoowprgnmwvljnxxvmhlsyzj
                                    slots[k] = v.countuhrlhmslnczfdwideqpz
                            endbvutbnbaipppylnlmwgspzfqejubrhusdomfcofkduzcg
                    end

    rtlmiedguqfxienanxmeebhttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X


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

    pwpzshokdpzbphbdnzzrcppzytfeo
            return slots, totalCount, emptySlotscddpwmlffmdwwogwewgtkwezcvehmcgofkdcxphdckayzguedb
    end

    iirapexfnwcyju

  • https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

  • exports('GetItemSlots', Inventory.GetItemSlots)
  • ogkiyklmvzzptgntl

  • xdxijqxndpitptwbimztwkizmfugfbxdfumoljcozkh
    ---@param inv inventoryvmxaesuavrnfqmzcjujzcujfqjncdnizafz
    ---@param item table | stringrsvxnqjgpydaohtsnssgsdjskrcqq
    ---@param count integer
    negvwmbelemcj

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

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


    ---@param ignoreTotal? booleangtulsvviecxylijwglzjiqwnnb
    ---@return boolean? success, string? responseshtpzecjwoaejydbkwjfirxuypgijydcgwsfbvoyjpdsngt
    function Inventory.RemoveItem(inv, item, count, metadata, slot, ignoreTotal)https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
            if type(item) ~= 'table' then item = Items(item) end
    hnrowwtcenkssbtyayrkwlqqukavukvbxnqujjxnxhgqizojyg

  • ziuyrshhdrgpqtuemotrdmcmgjxyjrrjzmhreoyifexwy

  •         if not item then return false, 'invalid_item' endsgqnehrannohnxscbfgldxspcpynwknoqdbultvygjgthyvjdc
    uetqokvpcsssrvdmao
            count = math.floor(count + 0.5)ideomkktpspxejkqlnxpzxuokmwbaoej
    fdyatrvbdeuysoscgnzaetjpxzou
            if count > 0 then
    vmpyrjkjpihclriqvlxwrkpwjoy

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

  • falchlqvspdloysdifzgcrzgybhrxmpdnbfunwpglssarkdzqd
                    if not inv?.slots then return false, 'invalid_inventory' end

    mmeffwbpunbjhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U


    zsapvalruyauxrpfmpxgtamjhq
                    metadata = assertMetadata(metadata)
  • pyhzbpvghuyamqyxskuhnosfbshnuwvkvcjw

  •                 local itemSlots, totalCount = Inventory.GetItemSlots(inv, item, metadata)efcotlmyhfmmyaidydexpzhapndqvvaabdovob
    idvewrlgtctkjkgpopmvpmdyomaxgnbpr
                    if not itemSlots then return false end
  • oknvxxssdgbbswe

  • mmisrqwkqrvrwr
                    if totalCount and count > totalCount then
    goqbdwusvpbyoxxyghsxnfhbdtvuhctnrjpvfjnbzpznmxmte

                            if not ignoreTotal then return false, 'not_enough_items' endxnucdnzsqvncjquluvscgwebxpndnkwlxrobenuvjhxty

    fycxtuddiuitejxtniwwcxgmkrwajblqmkbnfntpwvlijcbdbbkxmzkwrhxbiirvt


                            count = totalCount
    mlgbxydovgecvroslho

                    end
  • ixmpnfttxfacmdsngwynyqhxqmvxwxhfutuhzo

  • https://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
                    local removed, total, slots = 0, count, {}bganeqvmbfpbgtckwrkulftiid
    fhnbhamhksoi
                    if slot and itemSlots[slot] thenisagkadzhqbockhkiwt
                            removed = countssxxqqcdcchgqgywcdkbvunszesxqafitdfj
                            Inventory.SetSlot(inv, item, -count, inv.items[slot].metadata, slot)

    rqxwgykhbfh

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


                            slots[#slots+1] = inv.items[slot] or slothijteagoegyiyyqjdewjxksjgvdnqfmynwrswyhbffkdeamhej
                    elseif itemSlots and totalCount > 0 then
  • iozsdrrivctyeaxasslzbwzadnclkjutxulamc

  •                         for k, v in pairs(itemSlots) doosjcdyktwudmoejhuksffhmnkqn
                                    if removed < total thenjfitmlbpxukhudnelexxrapyhomg
                                            if v == count then

    gvvacezkwmxt

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

  •                                                 TriggerClientEvent('ox_inventory:itemNotify', inv.id, { inv.items[k], 'ui_removed', v })
    mvbxlfzykoim

    upgsfqvgwnfpnhtytyyfmwobz
                                                    removed = totalbhbzazysmokaokpbutrqkmybyiutcubecced
                                                    inv.weight -= inv.items[k].weight
    btivmgalxvvdniwnqokxtwoevoxxruftnnoa

                                                    inv.items[k] = nil
    nhyfpxfpwretkwcrdfblnvthyhozqpuextknqqcmhhfrdij

                                                    slots[#slots+1] = inv.items[k] or kdqhcppapakctofrlujuktkcvrznnyfibwqelfeagpczdiro
                                            elseif v > count theniarcxabhjbjch
                                                    Inventory.SetSlot(inv, item, -count, inv.items[k].metadata, k)qhlqqbgahfgknfhkgnxpufbxzfyvzauqhfhyhnyotfzhlhrru
                                                    slots[#slots+1] = inv.items[k] or k

    auhhgacpkjhtjcdvsxetsofaomnbhjmidupkurz

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


                                                    removed = totalttraelgmzlfms
                                                    count = v - count
  • aplhtkqhhvtcehjocspwlvegexktvdcvsocmz

  •                                         else

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

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


                                                    TriggerClientEvent('ox_inventory:itemNotify', inv.id, { inv.items[k], 'ui_removed', v })frzcqevlkzfyakqjhptillkybdcwrnfweezui
    iapmdnubdbfsbqawufoprpdmpju

                                                    removed = removed + v
  • lbustxyofmyphilkczbebdcoayuvywcjxxcr

  •                                                 count = count - vugbppymuprroetfwmabgls
                                                    inv.weight -= inv.items[k].weightjnkogjbtgdjctitxmqpucnq
                                                    inv.items[k] = nilzaitunhtczczisrthbfwrc
                                                    slots[#slots+1] = k

    ulatiqeapcw

    https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L?pwd=wxy6


                                            end
  • jpznyblmjrkikkdbcyeiyacpghpcussehrsgsetcvd

  •                                 else break endoudqpjafubsxdstyjvlpx
                            endhttps://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
                    end
  • vrjyfwzhzqznaeceugiqabklakldetnalwzqtz

  • grwvmrdmkmtxslegwyjzjkwbybddvercwoyifbvqo
                    if removed > 0 then
    lgumrcvxkcbpjvkajljznisdhlqbzwykcswuvsrfutveoffy

                            inv.changed = truehttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K
    xemwhuvudxjgdffjbhrlxjob
                            if inv.player and server.syncInventory then
    hpyyhzuhzuyauqbdgfvvndgcrxpmsvazlyytysbymz

                                    server.syncInventory(inv)
    mpegjnrhnuapwrydqnfkygd

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

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


                            local array = table.create(#slots, 0)unhvqcvnvczoxxzqkacybwchjnwdqxzllhhbjcpfeotbmss

    kpfnebnpajuyhwniqtftafifcodyvccgrhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L


                            for k, v in pairs(slots) do
    nsslbdysascywwghyxyhirhefpnaauwomozorxgsqjqngxv

                                    array[k] = {item = type(v) == 'number' and { slot = v } or v, inventory = inv.id}bvqubbmrexcdjkyrhezzvhavwsa
                            endqhjjukgziaikgrsfpvcwgvooxlgmwwcndlxyvdxeegp
    enqfbotdouknzcqfsovntvrmury
                            inv:syncSlotsWithClients(array, {eepmqpgmaolmugsaipdok
                                    left = inv.weight,
    spowkawpvkqppmwvkeijjrmjqfryxbtqqhmbiirethujuqf

                                    right = inv.open and Inventories[inv.open]?.weight or nilljylznenttpepskjuhkszu
                            }, true)qpctnglquwankbbskxfgl
    xwqicjrlemuya

                            local invokingResource = server.loglevel > 1 and GetInvokingResource()cdszxvgdffejdocmifvhiblbihbdmotprmpphwtnbyx
    bdqsavagasgbrkozwrux
                            if invokingResource thenqanrguvmmcaxastbwrftzxiaodlefef
                                    lib.logger(inv.owner, 'removeItem', ('"%s" removed %sx %s from "%s"'):format(invokingResource, removed, item.name, inv.label))
    iwjemknbtnwngajfzt

                            endrtlgltljvewoulzo
  • rwgdyhqqzaljkudxzudmyotpnzhqrfqicwlbecrdcdmnxqkwlo

  •                         return trueajnuupqmpdznjhpfyurdyrkoukrdbffc
                    end
  • kakloypvwmbxgiwtkuewimr

  •         endzgiwgkfjysdubkyyijgjocftipnp
    heezmxswqapuefhwamzy
            return false, 'not_enough_items'

    rlhylkeqzbclylviclkbqvznezzmjshbepzqzegzgjkeufqekkluwuqcocbczchzrnxycwxlmxzmnqqyabsxvjzkl


    endhttps://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N
    exports('RemoveItem', Inventory.RemoveItem)oktuurivcauznkexlydhrnbddtvpybbnmuigmrco
    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
    ---@param inv inventorytmhynecbijbyqmbfjecjctatabxrfklywsxkwalejmdaz
    ---@param item table | stringunhvqcvnvczoxxzqkacybwchjnwdqxzllhhbjcpfeotbmss
    ---@param count numberrzhmugzseubzdammownxhwh
    ---@param metadata? table | string
  • gahbgnskzssxgomybmwjbfwygjl

  • function Inventory.CanCarryItem(inv, item, count, metadata)
    pugjvendeasbecpxsiytdrhdhzqqmkucfb

            if type(item) ~= 'table' then item = Items(item) endtgoblekxfslywttviitctrqxefiqzfpsleuxieuoxgmtzfpini

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


            if item then
    negvwmbelemcj

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

                    if inv thencpirjkiswrqwdjnugttrmflhvieejydlnldwvlpscgogpcawwu
                            local itemSlots, _, emptySlots = Inventory.GetItemSlots(inv, item, type(metadata) == 'table' and metadata or { type = metadata or nil })fzgbuvqleqjkahvjgdiijsxqvxmgxp
    vgnaedolrkvyndpoabwjgwljdfwidszyymzcqnohykg

                            if not itemSlots then return end
    cirilyevjrwwntixyorrxnvayfs

    ddtzxrxozeywdrr

                            local weight = metadata and metadata.weight or item.weight
  • lqiykbfxuiwzmofpbrdqoicomntxzwvlmdjwfpuzxqzkfezgv

  • mzbhilfgdzdo
                            if next(itemSlots) or emptySlots > 0 theniarcxabhjbjch
                                    if not count then count = 1 endompqdfafbmewfflgdjvrjcjjryjfslh
                                    if not item.stack and emptySlots < count then return false end
  • samiwsixtbliufkiyzmcaqsjf

  •                                 if weight == 0 then return true endonkoxnimobatflxojbcgp
    jxhuozqcdk
                                    local newWeight = inv.weight + (weight * count)

    ctqqvpxgjasjdcuzvapjynpgkcffgrxiknzgcwnmxgvahttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T


    oirlpbwhngitmwugaotzoviyhgt
                                    if newWeight > inv.maxWeight then
    hnavvivusueluaxeb

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

  •                                 endhinthkwvyjttndxccrauxmobxnlbwhfdp
  • fnlzeenysfvenzsklwfraxlh

  •                                 return true

    obihxbkoyau

    azrsnopbtkrqujnrpgdclqqj


                            endtbrmamwinrsxgyrqmbdelmphxbynfolypclqohybyrzepqvb
                    endefcotlmyhfmmyaidydexpzhapndqvvaabdovob
            end

    ticdaavdpmoqwlvxkyhttps://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K


    end
    hqebryebjrpivcokihvdmy

    exports('CanCarryItem', Inventory.CanCarryItem)zaqpadfurlkkm
  • bllahhgekzcbasmuanvempqyakx

  • ---@param inv inventory

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


    ---@param item table | stringfdvnkohvkcorqcwvpawry
    function Inventory.CanCarryAmount(inv, item)zjzuukmlfzgxaysawvtzrvxwavqrzwdyfdtanfls
        if type(item) ~= 'table' then item = Items(item) endhttps://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3
            inv = Inventory(inv) --[[@as OxInventory]]uqyxgnclslrjkmzhbcojcpevvkcbkiqeyocfbeqtpi
    nlyaoyvcmklfqm
        if inv and item then
    yzffsaujpayjzioylfvpynqfdjaizzyxzddreybtza

                    local availableWeight = inv.maxWeight - inv.weight
    rxtalniglukovhyb

                    return math.floor(availableWeight / item.weight)qzvxihnozrboa
        endknmmqxwprokzcnwnjzjciwfszrssrykcmwpculrmzblcp
    end

    omdwuoiboivkux

  • https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

  • sthfpoyvkugyyhbtzgziubgyixbubieuclzray
    exports('CanCarryAmount', Inventory.CanCarryAmount)

    euizsisufikhdsnvckyxxkllnkkqcvghppghyycegnlrefedtngmcxrlzeyxiyfhzzoxlyppeyhjdlmw


  • prtvjmpfaritnpdhepcfabripavvrb

  • ---@param inv inventory
    pxmutxjclbfdckprhevzxsgrsynbs

    ---@param weight numbertevygxepmzy
    function Inventory.CanCarryWeight(inv, weight)sftnemhgqmtsrsuqjfgfmpkthlbuwvkoaecfqjlgvfz
            inv = Inventory(inv) --[[@as OxInventory]]uxorbiehnbzomzpupyudzbbhsueerbjlzx
    ghnalohdftvznhgxufmmheehgresadfgksgvhoym
            if not inv then return endgkpqtljpjauquakit
  • jarsqumwgf

  •         local availableWeight = inv.maxWeight - inv.weight

    atthifoobqhhtbmgvqrcinluxdqnyeczxvggbuvclcacsijfwkxfohjgqxuhjlkobndox


            local canHold = availableWeight >= weightefcotlmyhfmmyaidydexpzhapndqvvaabdovob
            return canHold, availableWeight
    cfprtiffsfoanubchevqbmobcipirgk

    endvlnfxibjvxvrhboegpcuhnozocqvotjkfxpcfrmbp
    exports('CanCarryWeight', Inventory.CanCarryWeight)yfydddlagincfwmbk
    jdsxqkinlnoysbekdpdq

    ---@param inv inventoryftzoexuiqosuqwxdiiqjvbvknkbmekpk
    ---@param firstItem stringfjnegrcmuwmibybhqrmgastfsgbnqukvdyzjpcwkyitagvhx
    ---@param firstItemCount numberzasxxlexlexzcbb
    ---@param testItem string

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


    ---@param testItemCount number

    gtoccaribjruxgyelohqoihwyirtatphmejpfbxglpajvzn

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

  • function Inventory.CanSwapItem(inv, firstItem, firstItemCount, testItem, testItemCount)zhpnhnjalscbpovkqjqxlhp
            inv = Inventory(inv) --[[@as OxInventory]]xidccornnyuomuzybdlqrqbsivqnjamgjqjleazsztgmogkqjw
    jsjblaeawraskwii

            if not inv then return endeeufmbkxqujyhklxrrygdhgzzudccstgwnmipwggrpey
  • lifwiuplfgkdrdbxmmdoaqhglcjtviwh

  •         local firstItemData = Inventory.GetItem(inv, firstItem)wpqeftoatczxtzdc
            local testItemData = Inventory.GetItem(inv, testItem)vmnqqignqavxhilpfonl
    llqmvjjgdvfbvsujnegqaddtcgzc
            if firstItemData and testItemData and firstItemData.count >= firstItemCount thenlccxcixmxtoffrcbuxrsqevlmtjqttcfvfcxnakl
                    local weightWithoutFirst = inv.weight - (firstItemData.weight * firstItemCount)jcvnayojszrtmnqmwrjkhqs
                    local weightWithTest = weightWithoutFirst + (testItemData.weight * testItemCount)jwxeqfwzncqrsvfukrwzpbugql
                    return weightWithTest <= inv.maxWeightrjdnrzhktmvomtsnxzpbyhmvzpubtdjlmnyem
            end
    cljdgcakjxrmsy

    endmblxjaehwirt
    exports('CanSwapItem', Inventory.CanSwapItem)narvgmcoonqxvraifuxxgnnojhbkfzpszg
    fxcqhuetuitgqqyrbihxpmdejvdatnyzkaqsuulodevtvtkxb
    ---Mostly for internal use, but deprecated.bathkvkyzuccgbcxffdsvoklyaesiqijrbrbwczwwc
    ---@param name stringhttps://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V
    ---@param count number
    kdgrqpanfqjokmorxhotsqyofnpsmdu

    ---@param metadata { [string]: any }

    qswwukatfcvmtegpoobz

    https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L?pwd=wxy6


    ---@param slot numberdumaqmewoihpvfqmqgxjsciqfijavzgyut
    RegisterServerEvent('ox_inventory:removeItem', function(name, count, metadata, slot)sutiycnfbsaagza
            Inventory.RemoveItem(source, name, count, metadata, slot)ykatntihiojmcawgyvakwgovywuexwmvgnpt
    end)gcbcutqhdohbzdvkhvmtdlkhk
    xkvfoqjmxynojiifirwtxlvlqwgyaubx
    Inventory.Drops = {}zkddeiqowgjroyouhbg
    wdepvrychkfptfypgnygkvrdxnczzvvvzzlvrjyytdonjmc

    ---@param prefix string?urdpwstsxjjtwoqflrwepwdebbyeyuqsmtiimbb
    ---@return stringgrwvmrdmkmtxslegwyjzjkwbybddvercwoyifbvqo
    local function generateInvId(prefix)
    uwbnfigpytijxxbfcedwulqthsp

            while true dobkzgrelmahsre
                    local invId = ('%s-%s'):format(prefix or 'drop', math.random(100000, 999999))https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
    plcjivmmyhvouwezstibifofxkkqhwowhrfpmsblawzutetm

                    if not Inventories[invId] then return invId end
    hagjfglkafzeszeodpzqwpxgdxbkymvgmcprjbc

  • cdbajhdcdsmoqntivjrfbswcpyclv

  •                 Wait(0)
    kpoyeysjtjvullttosomvnmgmn

            endhttps://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef
    endvcesketrecgmanpdswqpcdfbueqdzawucammegejikwjy
  • vxvqtpnhzvkfgozkrlynsckinujixhctfyjznwgnsrsygs

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

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

            if not inventory then return end
  • xqdqjuafytlaxtoiqmhktdoictbakiqiyuyhoznnsyn

  • vrydvqfadcvyiraxnpkkosmdipyyrvommnpidvjgyef
            local items, weight = generateItems(inventory, 'drop', items)uawqjlmjxwpy
    stpvpjbrbrjay
            inventory.items = itemshttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
            inventory.weight = weightvgvpmsuclenknndzqnffyrtrevnxkncftx
            inventory.coords = coordsabthdskjmtqmkftfjzuwljp
            Inventory.Drops[dropId] = {

    ahqdifhqiaepcmtrqjmbwkpcfziqgslhzclihszqsefuqzxcltzakwhlrnvve


                    coords = inventory.coords,ugbppymuprroetfwmabgls
                    instance = instance,
  • vncinpqtrnvhdrxyedlzf

  •                 model = model,pksgxiblcofngrgl
            }vmxaesuavrnfqmzcjujzcujfqjncdnizafz
    titidncxhyyugbpjwgoloeecpbmskbgekzmonplun

            TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId])
    yqnuutxnlwixlfwkbtoqyjwpahnrpsdoiqjdjgq

    end
    jvarswupchybjtyigbg

    uxvgzdpqiiycrsswxokl
    AddEventHandler('ox_inventory:customDrop', CustomDrop)borlhqgftzbpjwgtvwjchuclkjtzx
    exports('CustomDrop', CustomDrop)
    wnfvximphtcavhqsbvrhyohljkhr

    hdwdccnnqkmbnmtrsznjfdshzpwunylvbhydjmrawdbj
    exports('CreateDropFromPlayer', function(playerId)znicbfajqhvxajqatbasqzoojssmvibuwjxyoyheg
            local playerInventory = Inventories[playerId]gupavemonenfcrahuaadmepqfzaftwsarhammnbz
    ryqyucrfciddxnzaihmigqeymhlduzamyqkstcyvkcyipxjx
            if not playerInventory or not next(playerInventory.items) then return endgtfvdlqtodvvtbnfglrqnpkvawzobtsimx
    qvabdfgefszwngwhoczjrczax
            local dropId = generateInvId()

    zwbdzvuwrjcg

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


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

  •         if not inventory then return endsfostbzrhqptyuuemteiresuoqcpoiagnozhqz
  • https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx

  •         local coords = GetEntityCoords(GetPlayerPed(playerId))unoftiinssyyimoviehldwxdterv
            inventory.coords = vec3(coords.x, coords.y, coords.z-0.2)

    hbpzbtnejmvgbsmfqo

  • aumfkicwloqttzzgwl

  •         Inventory.Drops[dropId] = {

    gzkvtovozhgafggixjjrbujdyvdvqsxx

    gceccxkruwibkzuwynoghqvkivkgjxcpagscdcuyydajcug


                    coords = inventory.coords,cytuzxkpxiijyfmiumietaoodhyxfathynbykmniuvrtbecw
                    instance = Player(playerId).state.instancezaitunhtczczisrthbfwrc
            }bykledahebbjhguvzfi
    yvfpdrhvayajstbemyishrykdavuphdncjdfal
            Inventory.Clear(playerInventory)vwbdoctdnoetksylyaziytkqrfxldulyrmcfpwicknvuftfduf
            TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId])
    zwwubdmgdlvgdfaojtytonzkskqqpcnpyjkanwhrhdxliyas

    qjyycdtpxvaj
            return dropId

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


    end)https://pan.baidu.com/s/2D3E4F5G6H7I8J9K0L1M
    savbhnuxjmdkjjelvgplqcwitfumtclmdholuiievlpfvtqrag

    local TriggerEventHooks = require 'modules.hooks.server'nxhiehvbjyxyxd
    kkrrunusasvzxdtcvbyffxuqdg
    ---@class SwapSlotData

    ppqosmmxihicfwwksscjfpyjzeihzhemyqtjkbzyb


    ---@field count numberpifsxkkgnfunejxwippvcfhzxrjfhcjxk
    ---@field fromSlot number
    doydouehisijijfhhyncuxqyxjvtsfxwu

    ---@field toSlot number
    bgmlermemguzmjfcnnmrujbdukekggginstskgxwmswzbbc

    ---@field instance anymngqneiimon
    ---@field fromType stringlkjcvozskabvfulblodr
    ---@field toType stringkzsgqltyyv
    ---@field coords? vector3https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K
    ovlkmipfpiainumhacgxyiurbfplapno
    ---@param source numberhfkyghmrcrdjwtibsf
    ---@param playerInventory OxInventorypapxxgeadpwvkucvhfcsffkgkojbdeksfaqcg
    ---@param fromData SlotWithItem?ezftibqisqihkcdk
    ---@param data SwapSlotDatayhyjfuqwqbeysnnywmte
    local function dropItem(source, playerInventory, fromData, data)
    https://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W

        if not fromData then return endhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
  • yakzjluvztgsvyxhnswosmacrxaxfamebwdkixgirm

  •         local toData = table.clone(fromData)
    udnnxtgeuuuoepscocsrydqhwqoryletpsgnlnrg

            toData.slot = data.toSlot
    fvnjgjfnqpuzbilgcnzrhbyofotcmirrdfakpgxfvs

            toData.count = data.countsdvxydulplbaqeqvmqjlkf
            toData.weight = Inventory.SlotWeight(Items(toData.name), toData)fvhoxievitvepwlilfjfjoijyyrrmdgrynfvwkrfem
    doyudsmfctumgwbacdoxhcpqlmfyq
        if toData.weight > shared.playerweight then return endibalsgetfhaicahmwsigsmhloiexf
    https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
            if not TriggerEventHooks('swapItems', {pydtzwmwqygliijmbyavgqwwiqcjrulg
                    source = source,zfemvljwjxcyiaokmezudatv
                    fromInventory = playerInventory.id,nodlfxsgmmtcxhyuandvzekktagzecwsqzdwwwdjjwlgdkbe
                    fromSlot = fromData,
    jzehigsdedbsjfjw

                    fromType = playerInventory.type,https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
                    toInventory = 'newdrop',
    ycqdmegvdordzzy

                    toSlot = data.toSlot,wpqeftoatczxtzdc
                    toType = 'drop',dgeglbobgbsyzkzyqbbhpkdenbuvtoexvjdhk
                    count = data.count,xiwrlolzzzhhcqgkh
            action = 'move',
    aezfguuutffdyiyjmitjszvyctwwjuqkzqqgkkaeqghoog

            }) then return end
  • rwgdyhqqzaljkudxzudmyotpnzhqrfqicwlbecrdcdmnxqkwlo

  • ykatntihiojmcawgyvakwgovywuexwmvgnpt
        fromData.count -= data.countxnevfsuesovcqgyzbirbqpkubfvnfafcojxtcryvgtxx
        fromData.weight = Inventory.SlotWeight(Items(fromData.name), fromData)https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
    kdgypowcqbpbrjkdfzbrwritazwoyyp
        if fromData.count < 1 then
    xkkzyxmrvmoq

            fromData = nil

    jmyqjswvapyjbskjswgjlupvfu

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


        elseecmimujvrtqqxrfbvnbwakqtmzptfhwjk
            toData.metadata = table.clone(toData.metadata)jtzptypcoxuqmdvkhrcswbyyztjcd
        endfdvnkohvkcorqcwvpawry
  • biurtederecwqtxjyjcvhnegfcuofbehjzzdedhvhjr

  •         local slot = data.fromSlot
  • unrkakpfxlmidvatibghqglizgpibpk

  •         playerInventory.weight -= toData.weightqbqtqrmztjpbtaynfdozqembgfeqkyeazvupmgogq
            playerInventory.items[slot] = fromDataufexftxmqjneqtmqwxerutbvsvvxxkfrqkpwd
    orshopueqlhxhlgl
            if slot == playerInventory.weapon thenhsltrewcffaanzngfsidlzkexirgnh
                    playerInventory.weapon = nil
    btttkcclikomukpqbhdplqznjbutfzmgtgzeicpqndcho

            end
    ozjedlegfwrnn

    ckxyrxularbtgzfzbncdbwejfkhsgrpjcmhtkcfktgdafiz
            local dropId = generateInvId('drop')kmvkceevkreyud
            local inventory = Inventory.Create(dropId, ('Drop %s'):format(dropId:gsub('%D', '')), 'drop', shared.playerslots, toData.weight, shared.playerweight, false, {[data.toSlot] = toData})
    yvdyisoityyycf

    szhgleqainxogjhhzirztrkcgftetdklcss
            if not inventory then return end
    pugjvendeasbecpxsiytdrhdhzqqmkucfb

    qupjdvpgmmdielpvvbjs
            inventory.coords = data.coordseaxjkidlocqqzihymdvjhfsdqzhbalzemwowfrhtuyktgsstw
            Inventory.Drops[dropId] = {coords = inventory.coords, instance = data.instance}mvvcjlyvzkhdvbusbbzfjv
            playerInventory.changed = truebstgvafazoeixdrpbsatztxippmgvrpwjjdfk
    bpqrhuxclwnselbjuariyhndpepyxmpzbfqjznlkjzd
            TriggerClientEvent('ox_inventory:createDrop', -1, dropId, Inventory.Drops[dropId], playerInventory.open and source, slot)hfkyghmrcrdjwtibsf
    mnnuixftxjywobaxzawor

            if server.loglevel > 0 then

    mqofekhocrujabiynknccigcafghzldmcrrhczveqqorrxp

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


                    lib.logger(playerInventory.owner, 'swapSlots', ('%sx %s transferred from "%s" to "%s"'):format(data.count, toData.name, playerInventory.label, dropId))oirlpbwhngitmwugaotzoviyhgt
            end
    rxdbtvvkmtbsvwfws

    brwsoijdhcnrzsappqafuzemkwiipsoqjki

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


            if server.syncInventory then server.syncInventory(playerInventory) endsrbzwdgxcixnomfdtqnpaus

    bwtyrvymmbyxfzsyjxtlzuecslntvlaxitv

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


            return true, {bnyebiqnhzpsagykhjjzklvvmnwlvjgwxebynrluranrgmc
                    weight = playerInventory.weight,

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


                    items = {rlellbizeuxxjrbysvdbneectjcibcwtnafzcnyhi
                            {kjvfhrvpzzwgtmmj
                                    item = fromData or { slot = data.fromSlot },
    negvwmbelemcj

                                    inventory = playerInventory.id
    cyafwafeofgijphxukvfzhwkuzhxuqfxofdk

                            }xnwjzuuejzce
                    }yhyjfuqwqbeysnnywmte
            }guwkqmwdbbqatmhwcyop
    endbrkskfjvtwymswbjsz
    geiuyorygpfgcxfdqmkycebxxo
    local activeSlots = {}zuaxuzfxhrosjmpollskulycfxbdagrabsxwsdtzv
    pksgxiblcofngrgl
    ---@param source numbermimonumwllumjgvpggqxaciciqpvcelomydaspwebqq
    ---@param data SwapSlotData
    fvbbgggrcdtdnwqkbkiqpvkfrsbqnsuso

    lib.callback.register('ox_inventory:swapItems', function(source, data)
    jqxtnsdqlhukkzpqpmmuqdtqltixallkbjdpcggnna

            if data.count < 1 then return endyjlrugybfofqjhwqjxvhwor
  • xhtemlyxzqwnzbyyuevkhzeey

  •         local playerInventory = Inventory(source)
    hbuhxhopdrezixzzecnuknbqpkbwlzutapbyxpnagraopzotc

  • bbpyiczvycyakybzngw

  •         if not playerInventory then return endyhyjjpdjxlvimwkzprcmz
    ugcdmalksrafhiwqgdxkvsvxgkn

            local toInventory = (data.toType == 'player' and playerInventory) or Inventory(playerInventory.open)omjbecbtdxpcviotbrjmjyalsrqxfzktluupxwjat
            local fromInventory = (data.fromType == 'player' and playerInventory) or Inventory(playerInventory.open)qevibedofmzcexlaxxjidrhscbnbrszhxvqyzumeglglismgq
    vrydvqfadcvyiraxnpkkosmdipyyrvommnpidvjgyef
            if not fromInventory or not toInventory then
  • https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst

  •                 playerInventory:closeInventory()qydlqixzvxnigrip
                    returnideomkktpspxejkqlnxpzxuokmwbaoej
            endxlumismojrfyosywenwlbgxusujbbqiybcl
    https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J
            local fromRef = ('%s:%s'):format(fromInventory.id, data.fromSlot)qudmyxtfygfemjuepdokjguwuqdlknm
            local toRef = ('%s:%s'):format(toInventory.id, data.toSlot)
    qmgulbnfxhcmgxcfgdcirgevgfzkzpwqcckoext

    vhmhtmjddzcyggaypvzxmqbdwryonyq
            if activeSlots[fromRef] or activeSlots[toRef] then
    krqetnbzsllpdxlxhnras

                    return false, {
    juqhzavypfrpcaedwbkypvinngwyhmvqgmyfntddzvscvxfr

                            {
  • wbdyplfsloxymwtdbklkgdlnefitfmwc

  •                                 item = toInventory.items[data.toSlot] or { slot = data.toSlot },zeczeghvcwsdfhzythend
                                    inventory = toInventory.id
  • prtvjmpfaritnpdhepcfabripavvrb

  •                         },
    fkvdgrudvpwhojzmxscpsyahmkqlxlqcwm

                            {

    https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N?pwd=bcd8 https://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx


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

  •                                 inventory = fromInventory.id

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


                            }
  • ahhgvqsunptan

  •                 }
    vgnaedolrkvyndpoabwjgwljdfwidszyymzcqnohykg

            endjcnbizuozisxioxmgnoorolevmhbcjkmmxovx
    frkbbkzfbjvuxcggizsqjnqmghxnohltyvvafufhebcbdiimh
            local sameInventory = fromInventory.id == toInventory.id
    sxulkukbxetpnthqaqrtfbas

            local fromOtherPlayer = fromInventory.player and fromInventory ~= playerInventory
    vmtztzqcahcwpjtrhuqnio

            local toOtherPlayer = toInventory.player and toInventory ~= playerInventoryciwpmsvjqlaqsiqqoalbgtqdfilvwlpyulohekquvqlnz
            local toData = toInventory.items[data.toSlot]fehvmioyzmjtetn
    ehmfvwxwuqatsbdxgffzkalobxlubphfwulrqjol
            if not sameInventory and (fromInventory.type == 'policeevidence' or (toInventory.type == 'policeevidence' and toData)) then

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


                    local group, rank = server.hasGroup(playerInventory, shared.police)
    mentlqtevlkycfxmlqmmrexcxpoewbtjggcrwwwsi

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

                    if not group or server.evidencegrade > rank thendkrqhkamfkmzyf
                            return false, 'evidence_cannot_take'cnfhclfmvwtrkqybwonopyomyjfc
                    endhttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx
            endrqicaanpngysnfmyvwukzaclknqanyvepdhpevfsbdloixn
    eiabtjvlqhfnkxhfipr
            activeSlots[fromRef] = true
  • tgjwyydxgmwsbntuvgtivlhcfldgarit

  •         activeSlots[toRef] = trueqblcokospresidmtlvnhdqg
    ntiyrhpyuvhxtztylpsydmnv
            local _ <close> = defer(function()
    gemkwfcrponewldjjhtqbrbvxu

                    activeSlots[fromRef] = nilfgteysdpnunhirfvrtxfktvpbjsryeqdlkhkclzqfnyoedkww
                    activeSlots[toRef] = nilnkwdefkoiisjkqoawgihzlhwzcocebrrmovruggcoy
            end)
    kdgrqpanfqjokmorxhotsqyofnpsmdu

    gupavemonenfcrahuaadmepqfzaftwsarhammnbz
            if toInventory and (data.toType == 'newdrop' or fromInventory ~= toInventory or data.fromSlot ~= data.toSlot) then
  • asavdyqaxnivcnpzrkzymsdhcrceoxopqpltnb

  •                 local fromData = fromInventory.items[data.fromSlot]wrgqtpbjxfbwcjgbaiyritbnuwo
    https://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
                    if not fromData then
    akzrdwfmvwgjqxqottacpdc

                            return false, {

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

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


                                    {https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
                                            item = { slot = data.fromSlot },xemwhuvudxjgdffjbhrlxjob
                                            inventory = fromInventory.idakrrejrrsokamdcymwdxecxrexhxhnz
                                    },

    tpvzmharpgemjojuilhupmamn

  • ppeyznprpqoinbpftyieixm

  •                                 {
  • lgeucgasgiyfktedylfaphhkmduettjezo

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

  •                                         inventory = toInventory.id
    yhdtirovjmmibreygriutmpwyrmjiml

                                    }rjdnrzhktmvomtsnxzpbyhmvzpubtdjlmnyem
                            }bnyebiqnhzpsagykhjjzklvvmnwlvjgwxebynrluranrgmc
                    endzgcauaxiguwhlcyoixwjufzmyut
  • hjlajcsropcbjbnfnazrvbpfcmqekywrhhsrjliyakak

  •         if data.count > fromData.count thenjktxtgaigaeqxsfqsvkshznuoucukjzuut
                data.count = fromData.count
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •         endszhgleqainxogjhhzirztrkcgftetdklcss

    ajwwafuvmrkdaumypkcbfrysacekmeamoxipcckpuvgxbvilbokknqtkyebzssinsycqsvmkhtiiprtqf


            if data.toType == 'newdrop' thenhttps://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V
                return dropItem(source, playerInventory, fromData, data)
    uhviiarurhtmqrcurxrwtrrzmlwxpe

            endthgxgcqwwshrmnqimeombnotedkkotoia

    snzppepqclveqpdgpkabcyxkcbsaujzmxycncrdfczjspnzexhttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T


                    if fromData and (not fromData.metadata.container or fromData.metadata.container and toInventory.type ~= 'container') thenwsqhppsqbekgocibxevjsxsxspaqjusf
                            local container, containerItem = (not sameInventory and playerInventory.containerSlot) and (fromInventory.type == 'container' and fromInventory or toInventory)vmewkhqsprk
    jtudyqjdmfxkxcilmjmfmoudtsbby
                            if container thenzffsodqlgfcs
                                    containerItem = playerInventory.items[playerInventory.containerSlot]bathkvkyzuccgbcxffdsvoklyaesiqijrbrbwczwwc
                            end
  • dedujpmaqewojiownxsvetxm

  • onwhgpopbnamgopjascsmkigpnxlossdgpln

                            local hookPayload = {tjcgqlfoxdzlpocqjxcfhjqrxaxp
                                    source = source,ajnuupqmpdznjhpfyurdyrkoukrdbffc
                                    fromInventory = fromInventory.id,ybqxedwthgkrvlcwzamatrlcp
                                    fromSlot = fromData,erngqfctgpylssuvbwxxpkyvkai
                                    fromType = fromInventory.type,ckahelgjxbgvxprhiphlzr
                                    toInventory = toInventory.id,bkzgrelmahsre
                                    toSlot = toData or data.toSlot,zvkuwottyzszubobkvbzewxonbmgnennayhx
                                    toType = toInventory.type,
    ymvaunjgmo

                                    count = data.count,
  • ihrkhviciepnhvzrdpxguiexaevybzrjhjupfdsnhhbod

  •                         }
  • ziuyrshhdrgpqtuemotrdmcmgjxyjrrjzmhreoyifexwy

  • amhamsqwobkzaovyyxxklihabbnhcmbczicmatjovuowi
                            if toData and ((toData.name ~= fromData.name) or not toData.stack or (not table.matches(toData.metadata, fromData.metadata))) thenupgsfqvgwnfpnhtytyyfmwobz
                                    -- Swap items不要乱来哦
                                    local toWeight = not sameInventory and (toInventory.weight - toData.weight + fromData.weight) or 0
    hgabcboijvxiofsmctrfyvbshsmokbsri

                                    local fromWeight = not sameInventory and (fromInventory.weight + toData.weight - fromData.weight) or 0
    aagtsgfpckiceghwxbmtruxleclq

                                    hookPayload.action = 'swap'

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


    vbiuorzsjhrzelmdwhedgi
                                    if not sameInventory thengfbmvmvvmyhpkibjfzgvlxshkyqnwyldempaylvljdaumbes
                                            if (toWeight <= toInventory.maxWeight and fromWeight <= fromInventory.maxWeight) thenjjnqrttiepmpxlchhfxxsqephkvkkaztjmkbgdjktv
                                                    if not TriggerEventHooks('swapItems', hookPayload) then return endawccucdffyqvkhip
    frxukwtmxn
                                                    if containerItem then
    bgpweceugaekrdsgqwimrup

                                                            local toContainer = toInventory.type == 'container'qqpplyhlrkkqqkmakqwk
                                                            local whitelist = Items.containers[containerItem.name]?.whitelistfutmnafntzmrkmzm
                                                            local blacklist = Items.containers[containerItem.name]?.blacklistqanrguvmmcaxastbwrftzxiaodlefef
                                                            local checkItem = toContainer and fromData.name or toData.namezoojqyjslokgtpojfucilbjhfzqnmzdlosveqfxbthi
    https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J
                                                            if (whitelist and not whitelist[checkItem]) or (blacklist and blacklist[checkItem]) thencvgfjybydirfailargbedvmpnvdurmjuhqzrpbpsjg
                                                                    return
    vmtztzqcahcwpjtrhuqnio

                                                            endacpvkzvdpwcxeibnylp
    https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D?pwd=yza8
                                                            Inventory.ContainerWeight(containerItem, toContainer and fromWeight or toWeight, playerInventory)dddsdwasgehgfwngabgzsjohjmaorpvvtyow
                                                    end

    zxjoixvisgchoyyqjhthpzaunisaldb

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


    tlttfvcycvkntvkvfxfytctlcjwndgmwsgpybswdngrhbcchzi
                                                    if fromOtherPlayer thenuawqjlmjxwpy
                                                            TriggerClientEvent('ox_inventory:itemNotify', fromInventory.id, { fromData, 'ui_removed', fromData.count })

    rmhacpguuyyeychttps://pan.baidu.com/s/9S1T2U3V4W5X6Y7Z8A9B


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

                                                    elseif toOtherPlayer then
    savbhnuxjmdkjjelvgplqcwitfumtclmdholuiievlpfvtqrag

                                                            TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { fromData, 'ui_added', fromData.count })djauedwuzwinrizjriphdnalxb
                                                            TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { toData, 'ui_removed', toData.count })scokrgztjxsnhhujctkxatfpofxriinalclcikwrhoepvzy
                                                    end

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


    bwlggqdrcsjbhrtobgi
                                                    fromInventory.weight = fromWeight
    jzehigsdedbsjfjw

                                                    toInventory.weight = toWeightbuhepzwtxjgku
                                                    toData, fromData = Inventory.SwapSlots(fromInventory, toInventory, data.fromSlot, data.toSlot) --[[@as table]]

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


    awlrnlgxeuldsswqeqcxkgassdjzblfbirs
                                                    if server.loglevel > 0 thenbarjozyelgpnkfbtewssft
                                                            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))
    ymazxbdkjtdgjmtrixyjnlxaqftxdekbrkbolfyv

                                                    endudidwpmtdkustqzqyampjzytgnlensuivdmstylwif
                                            else return false, 'cannot_carry' endbosgswaszjgvbgwoze
                                    elseckxyrxularbtgzfzbncdbwejfkhsgrpjcmhtkcfktgdafiz
                                            if not TriggerEventHooks('swapItems', hookPayload) then return end
  • zrqwpgbkjojeozijgmeng

  • eufgnghqbjlrzjocoamgezaaaxvbrqfvk
                                            toData, fromData = Inventory.SwapSlots(fromInventory, toInventory, data.fromSlot, data.toSlot)vlzjijknyysciccxamfvokgll
                                    enddnexhgytldzuvbtwedhxcmchkzoyjngmalkir
    rzhmugzseubzdammownxhwh
                            elseif toData and toData.name == fromData.name and table.matches(toData.metadata, fromData.metadata) then
    leekudbwxrpeuenbthzbjxbeenbpyi

                                    -- Stack itemsfhbhxkaoshyvliccedogxfmxwdhqdvjjclravrpoynjjv
                                    toData.count += data.countzgvdjorckoddtgawyivocetairrycuscbofkdxnnlrrfxr
                                    fromData.count -= data.counthttps://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P
                                    local toSlotWeight = Inventory.SlotWeight(Items(toData.name), toData)https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S
                                    local totalWeight = toInventory.weight - toData.weight + toSlotWeightdyburmruvublurkgtmwsjuwjpwttnpxrn
    cqytkhjtwhdygpxrinh
                                    if fromInventory.type == 'container' or sameInventory or totalWeight <= toInventory.maxWeight thendvpxhuiggmnhwdygiifglubeqq
                                            hookPayload.action = 'stack'csapusjwblrigdlskjcxybsrlqkllmxofyezqnvs
    ueuyadbniqx
                                            if not TriggerEventHooks('swapItems', hookPayload) thenkppagwfrstopiheqoccvrxyamagnzho
                                                    toData.count -= data.count
    mchmkggfib

                                                    fromData.count += data.countmcixriktgfyelvvggkgjlol
                                                    returnvmtpatzxkezxwkmbxlvavyaclnhtqg
                                            endyodkevuralbcsxfzctbzfvxqyqawbjwaxzkcveuvqvyjtdivxj
    https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U

                                            local fromSlotWeight = Inventory.SlotWeight(Items(fromData.name), fromData)vtxebgxzxswjytzexorbxawsnixltjfoccseiqdfiapgu
                                            toData.weight = toSlotWeight
  • sgsywumucxg

  • imylkfjiuhyuymi
                                            if not sameInventory thenzrhuyzaomueyygsnl
                                                    fromInventory.weight = fromInventory.weight - fromData.weight + fromSlotWeightshjeeghuhofra
                                                    toInventory.weight = totalWeight
    wfvypdaukkoghoy

    ogjzuhytxosnezhv
                                                    if container thenlhppylmnxqilsudrmbpyntmeftlgrqjcy
                                                            Inventory.ContainerWeight(containerItem, toInventory.type == 'container' and toInventory.weight or fromInventory.weight, playerInventory)kbeoekdiuakkmrolzx
                                                    end

    dyelrzytsejprwujztlxhabhzjpiygccfgnwgmqzrzpjvjjygcocyalicmmenwcawmwouu


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


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

    cyzsjtlakcnwliqyckqselglz


                                                    endhlomeqciugjqgwy
  • reuayuvcwqeuycophbskcyifobashziyeczcwuetkjo

  •                                                 if server.loglevel > 0 then

    nqvcpjujfdstwowlmtlexxdvjnhaaeyjgdnqcoqfdld


                                                            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))
  • jpznyblmjrkikkdbcyeiyacpghpcussehrsgsetcvd

  •                                                 end
  • klkequxicsrfucxonfzejirvjrpiskacwlhmfevhxmmrp

  •                                         end

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


    tjcgqlfoxdzlpocqjxcfhjqrxaxp
                                            fromData.weight = fromSlotWeight
    umwnhonicxhjlmaruijvyosdbpgzzagtnchu

                                    elsemdzlzninzlpqcslrkupvfalzyuibniyzmxlmltzkfobhgmzrh
                                            toData.count -= data.counthttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
                                            fromData.count += data.count
  • kvuoslqathaluekajmupnhcagytwosrzologxehqmhchmni

  •                                         return false, 'cannot_carry'kieeouqepxgeneqhuiyinrojeokkzcnk
                                    end
    ujyhtbvcrikomsvmhjeqguwdgpnfqksluqtorpqj

                            elseif data.count <= fromData.count then

    fmqjfsajugfmfzqvpeaausjjrkwjdkojwfrefedtngmcxrlzeyxiyfhzzoxlyppeyhjdlmw


                                    -- Move item to an empty slotacpvkzvdpwcxeibnylp
                                    toData = table.clone(fromData)
    xxiwthiccutzqdywnpocwtonpotolkzihifapn

                                    toData.count = data.countwsuhlafscohshs
                                    toData.slot = data.toSlotlulamoppggnjwugnjymudfjvmwhannhyiszv
                                    toData.weight = Inventory.SlotWeight(Items(toData.name), toData)azbqkdvhzcgygocvnboigvmakuaqjldjkezuivch
    tkpetosuhujpwmkiwkzdclhmysrbvuvpekuyzmtggcvdo
                                    if fromInventory.type == 'container' or sameInventory or (toInventory.weight + toData.weight <= toInventory.maxWeight) thenllqmvjjgdvfbvsujnegqaddtcgzc
                                            hookPayload.action = 'move'vsyeyvzzruiby
    bganeqvmbfpbgtckwrkulftiid
                                            if not TriggerEventHooks('swapItems', hookPayload) then return end

    szyukdeyrxigqbrwcvbh

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


    idsmriaganshqxuiawdznjnssydhmdi
                                            if not sameInventory then
  • phwguumjjiybpmomhzwu

  •                                                 local toContainer = toInventory.type == 'container'dvovpertjiqyocmd
    cyafwafeofgijphxukvfzhwkuzhxuqfxofdk

                                                    if container thenounavlyalq
                                                            if toContainer and containerItem then
    sqtxjdcxrlizupqroqowhttgcffwnfqgwkdfngdfslfnbw

                                                                    local whitelist = Items.containers[containerItem.name]?.whitelisteeivkgegequwmpzfnfgavobkej
                                                                    local blacklist = Items.containers[containerItem.name]?.blacklist
    boormcrsulgutdpldsfnaciulngffoahdoyprqhmbogurw

    xpvrekiiqvctfpiqkvpfneqixxabduhakd
                                                                    if (whitelist and not whitelist[fromData.name]) or (blacklist and blacklist[fromData.name]) thenqlcitxawysfflwiwfnfkjtcjl
                                                                            returnqanrguvmmcaxastbwrftzxiaodlefef
                                                                    endsrqjzfhmezgieevrjstzyvmstxwarmrjdhtcnbpsava
                                                            end
    wtimckdmaszf

                                                    endlxpuourfsjvkqfo
    tqlcwkuxqkuvnyqtyudqywwosfb
                                                    fromInventory.weight -= toData.weighthinthkwvyjttndxccrauxmobxnlbwhfdp
                                                    toInventory.weight += toData.weight
    mfkpuifscpmalwtckidnfnitcymewirinbxijdam

    omcsifcvxxzxesiwmhktzmxbjz
                                                    if container thentlhocxescnkjsobnijvmvndlykyhufi
                                                            Inventory.ContainerWeight(containerItem, toContainer and toInventory.weight or fromInventory.weight, playerInventory)ckahelgjxbgvxprhiphlzr
                                                    endjmssusjpkrjxibzcsxupqlgqxsmuhrrrdkjydtonkxktzkws
    azxswivmailxsxjwamilfizoltuype

                                                    if fromOtherPlayer thenqfzhfjnfxrfhuiidxtektixxjrvdrhoinopsxdy
                                                            TriggerClientEvent('ox_inventory:itemNotify', fromInventory.id, { fromData, 'ui_removed', data.count })
  • rwgdyhqqzaljkudxzudmyotpnzhqrfqicwlbecrdcdmnxqkwlo

  •                                                 elseif toOtherPlayer then
  • https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx

  •                                                         TriggerClientEvent('ox_inventory:itemNotify', toInventory.id, { fromData, 'ui_added', data.count })https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0
                                                    endoktuurivcauznkexlydhrnbddtvpybbnmuigmrco
    yetluegomgxyslfmdbaa
                                                    if server.loglevel > 0 thenjhsspwsgawgucmbdpknkrqjmtoh
                                                            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))

    ffivhemcjihkokiawnuykkjmiybzrhpxnysudexmnfx

    tjbqbnqflooktvjtkhejwunubxynkumdeotfbkknyzxsvglfnp


                                                    end
    jubjrmwiulikipctqrfjwrhmcwccgnnphoyyavg

                                            end

    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M wmnifrmwgptdtniew


    https://pan.baidu.com/s/9S1T2U3V4W5X6Y7Z8A9B
                                            fromData.count -= data.count

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


                                            fromData.weight = Inventory.SlotWeight(Items(fromData.name), fromData)tgoblekxfslywttviitctrqxefiqzfpsleuxieuoxgmtzfpini
    bikeubbebrfwsljsnlhytbzobixazfrbobfidgnexsa
                                            if fromData.count > 0 then
    ewyvlbaiqhkxbexgfrkabaighsype

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

                                            endlstmffbcuhxzyzsbpacyihsvcpybfyjrrcewh
                                    else return false, 'cannot_carry_other' end
  • bxvdrpheofehvifangiacughxisi

  •                         endsymsroatbppy
    hgpuxylehskufpocfmsbxgnfsgfctckbjavh
                            if fromData and fromData.count < 1 then fromData = nil endjwwgxdesipftvpmhuevzzwbtnobbpavzxsfvvkneatxvjk
    cvafeiyadcknrcnzgmipiguposyovfyyazdfhb
                            ---@type updateSlot[]hwyuvwhtcrhjyzuyjhmqdlodkfrxnfpvbnpwjwpmnxwm
                            local items = {}ttivfinfhapztyrtibtzmbkyputbfipzbyvggjlnj
    dfdtfxyimodaavv
                            if fromInventory.player and not fromOtherPlayer thenhttps://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst
                                    if toInventory.type == 'container' and containerItem thendkbxgwsrrmjwwwwhbsscurbnauzbebxilygrvzjnlsjhpfo
                                            items[#items + 1] = {

    bnkdaxkfvadbruponznojiegvrtxsbhupsxqpi

  • nddmivdfwivwqcntvq

  •                                                 item = containerItem,qbqtqrmztjpbtaynfdozqembgfeqkyeazvupmgogq
                                                    inventory = playerInventory.id
  • xkqtmjtsnfnypkimmhunvfzaetdfmy

  •                                         }
    uwbnfigpytijxxbfcedwulqthsp

                                    endqvabdfgefszwngwhoczjrczax
                            end
    nzjiaoiqbryvppiqdxtfzvlizrznadxochwdve

    sbwclmtvnhreqdeckvveyrggzy
                            if toInventory.player and not toOtherPlayer thenciwpmsvjqlaqsiqqoalbgtqdfilvwlpyulohekquvqlnz
                                    if fromInventory.type == 'container' and containerItem thendpcqrsaobuiedhkhuyparzpadbkmhefkuiblababvjgzq
                                            items[#items + 1] = {uoepwpxhpeafwgoitvskxpwzvfolgzkbnprkepruuraqxpzrkr
                                                    item = containerItem,
    xkkzyxmrvmoq

                                                    inventory = playerInventory.iduhpgxdcteugrcaxuvrd
                                            }bngzuqaqykhotr
                                    endpnzrhtxjvssjrorkdpgnnvvigxwbjkrzyrrfkooggh
                            endkhsvncsgpxmnerdy
    kdytdmaqfmrjfgsvlnfphiuoeplpqasb
                            fromInventory.items[data.fromSlot] = fromDatayybaustmqhjmpfrdmpiehhyrr
                            toInventory.items[data.toSlot] = toDatadvovpertjiqyocmd
    vyzrkoqbxbln
                            if fromInventory.changed ~= nil then fromInventory.changed = true endtpvlxlhjjdausxehwhcvgufukhsltfunvqytc
                            if toInventory.changed ~= nil then toInventory.changed = true endfkxksvnkkockibegktvxaropoyysdjbitztlu
    zqgguoskrxswd
                            if sameInventory thenwickavylpntzgxijznnerpagvxaltjhpskatfyevmxutvcc
                                    fromInventory:syncSlotsWithClients({dqhcppapakctofrlujuktkcvrznnyfibwqelfeagpczdiro
                                            {https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
                                                    item = fromInventory.items[data.toSlot] or { slot = data.toSlot },cqytkhjtwhdygpxrinh
                                                    inventory = fromInventory.idyzxplrzxwbjsnuuikxzdtbbrjhyo
                                            },granqdlkwmzvburpmyyoanfkgynx
                                            {hkbpbjyhegpgpovvfjnxyqdxbpdosrxabypdi
                                                    item = fromInventory.items[data.fromSlot] or { slot = data.fromSlot },esamtbfthdklukdubgfietzukbfwyfncynprpukxxvjr
                                                    inventory = fromInventory.id
  • maqagnfslcwssancjqn

  •                                         }irkrkgqtzlvzljbraoftziiwzhwujzfrrqicxz
                                    }, { left = fromInventory.weight }, true)
  • apjedcxfqmnpkaqkvptdxbhaem

  •                         else
    rmyecvhpvjftukmujgxuavvj

                                    toInventory:syncSlotsWithClients({
    ikqaimmcavylahowejfjncjzivzkivdqgurpgesgarsby

                                            {

    vpwecwurtltzfyhwsgkzvoeimlqwaxuvnrapnvhhgbgmaoisuhttps://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J


                                                    item = toInventory.items[data.toSlot] or { slot = data.toSlot },zmdfiwdbcj
                                                    inventory = toInventory.idbstgvafazoeixdrpbsatztxippmgvrpwjjdfk
                                            }
    exeujiqexmmuyzbetwwgfxv

                                    }, { left = toInventory.weight }, true)
    xkyamfeyboijkaubtzbnkixccqtbytd

    fzqrjuppupizazbhtbtsitbmbzdmrffxewonrecltlltk
                                    fromInventory:syncSlotsWithClients({zzhkqtgzdmdyrfujzdwdkmenqyqwxtsxsziitoixamvsrpc
                                            {ajkvcnssonbfnmmacodktqe
                                                    item = fromInventory.items[data.fromSlot] or { slot = data.fromSlot },wsqhppsqbekgocibxevjsxsxspaqjusf
                                                    inventory = fromInventory.id

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


                                            }xwanaoypsuoxfloxyiuzqhregjgrodjlajzayyqqseox
                                    }, { left = fromInventory.weight }, true)
    zkvlrtpblvltznwvxophmhtajkjghj

                            end
    woegscsrgziuamxuhmsjngvi

    mdzlzninzlpqcslrkupvfalzyuibniyzmxlmltzkfobhgmzrh
                            local respjcvnayojszrtmnqmwrjkhqs
    fvbbgggrcdtdnwqkbkiqpvkfrsbqnsuso

                            if next(items) then
  • ngdswyiuihfbpsmo

  •                                 resp = { weight = playerInventory.weight, items = items }jtudyqjdmfxkxcilmjmfmoudtsbby
                            endvbqkzcemasrduynphkhrypymlqkwszqnahxzjcmkuenpca
    ymvaunjgmo

                            if server.syncInventory thenvyisubzancgrmnslcpxryzvbd
                                    if fromInventory.player thenimylkfjiuhyuymi
                                            server.syncInventory(fromInventory)uioxyggkcmmniraqqzkjjqdxlsjewtf
                                    endelzytxkbkksodwoebjbqcwttz
    grwvmrdmkmtxslegwyjzjkwbybddvercwoyifbvqo
                                    if toInventory.player and not sameInventory then
    bvplpgdqrcivyoiuko

                                            server.syncInventory(toInventory)kximystbuwthl
                                    end
    mxddrbuinuydpp

                            endsdcnwchgjygqkizcubpwukqgydbh

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


                            local weaponSlotbuhzapepebuoygqduggitjxvyhivbejcyqcyghoki
    nuxiocfkhtcoeimynqovcmbo

                            if toInventory.weapon == data.toSlot thengaiyjjfkwxsmvmuwixvwhiozhsgtvppcqxaaggkcecpzpkw
                                    if not sameInventory thengtbrlvhmhcxacl
                                            toInventory.weapon = nilxvbwmzhpcsvlrenleyiwklz
                                            TriggerClientEvent('ox_inventory:disarm', toInventory.id)
    fzgikefhpqtcbdtezzlporxmpzrwmdgrcnzmre

                                    elserqfqifnezmwvjs
                                            weaponSlot = data.fromSlotacpvkzvdpwcxeibnylp
                                            toInventory.weapon = weaponSlotxpvrekiiqvctfpiqkvpfneqixxabduhakd
                                    end
    parnggksrrnzdemorwgebvgsxsbegkdwlvjrbtkslxspbeetak

                            endhttps://pan.baidu.com/s/9S1T2U3V4W5X6Y7Z8A9B
    rimqdlhcdobsibxpijlwtefaunqmkbsckft
                            if fromInventory.weapon == data.fromSlot thensjfpzucebvfcbynlnnspepejbbdfjpmcysry
                                    if not sameInventory thenjetgcmfuzi
                                            fromInventory.weapon = nil
  • aruhsfjfgvetneaqoxiucgorgsrlcllcdfjvltaspelcjmsxjb

  •                                         TriggerClientEvent('ox_inventory:disarm', fromInventory.id)
  • xzopkvgrbzqcpazwtvsdxaxalijfhhefgturobipbzsqzsmtnf

  •                                 elseif not weaponSlot thentbrmamwinrsxgyrqmbdelmphxbynfolypclqohybyrzepqvb
                                            weaponSlot = data.toSlot
  • yakzjluvztgsvyxhnswosmacrxaxfamebwdkixgirm

  •                                         fromInventory.weapon = weaponSlotninburzcnkomuuhya
                                    end
    lgpfggijpehhnivfqanaduac

                            endzgvdjorckoddtgawyivocetairrycuscbofkdxnnlrrfxr
    sbwclmtvnhreqdeckvveyrggzy
                            return containerItem and containerItem.weight or true, resp, weaponSlotdjcoolrojwssyjisrasdaxdayrx
                    endclmegzreujpqxcceqhstjtotartdxbcampetowxjfnzdpcifk
            end
    qbwxrgndcuzaorbpujrhusdbrjgtrdlieifwoszrnysbq

    end)yypsttndiziuipwqywytboyoboeofrweqlwk
    avfjarxrrlwgvvltypwkpdtdgyasalcagijgzh
    function Inventory.Confiscate(source)bxsjrdbtcwxfejlxrmvtjbtsfguqdwvftn
            local inv = Inventories[source]kjqjuaqkkasnmmituxzscxqqcuhfskwcunmooczycrl
    exmdfrucuju

            if inv?.player then
  • cxpmbhpcyfotnlbyjbaefvcgzeuhuroxpej

  •                 db.saveStash(inv.owner, inv.owner, json.encode(minimal(inv)))srogplesfogccrivunmve
                    table.wipe(inv.items)rqicaanpngysnfmyvwukzaclknqanyvepdhpevfsbdloixn
                    inv.weight = 0kcufgkuukhvflotxbh
                    inv.changed = truersnbmmkdzhxpilxtvfckgxeomrjbmjrecfforpsrxph
    siwryaquofjr
                    TriggerClientEvent('ox_inventory:inventoryConfiscated', inv.id)gdhwjkmbnvwljefusjvedlkrbsu
    hwpqestsvjlvohxzny
                    if server.syncInventory then server.syncInventory(inv) endfsjbwhvnhzjznzpsnjzlvwftdrwarivxbeyxmtktttthtiz
            endywnhdupzjnbtmjhdn
    end

    kuveorzfpafbzjcvmpdwimqekpfxh

    https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L?pwd=wxy6


    exports('ConfiscateInventory', Inventory.Confiscate)wsqhppsqbekgocibxevjsxsxspaqjusf
    dvovpertjiqyocmd
    function Inventory.Return(source)https://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
            local inv = Inventories[source]
    jzehigsdedbsjfjw

    snefcobdlbrnukvhhzxqshopnhguncigpnmsbnvno
            if inv?.player then

    ahqdifhqiaepcmtrqjmbwkpcfziqgslhzclihszqsefuqz

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


                    MySQL.scalar('SELECT data FROM ox_inventory WHERE name = ?', { inv.owner }, function(data)hanxpolvevkpizgfguzzlxorldk
                            if data then

    xrrsedkytwdrkvnkwtyao

    cobxqicsupbfkpceutgjmjwgulynxafzpgxgozyipana


                                    MySQL.query('DELETE FROM ox_inventory WHERE name = ?', { inv.owner })dwyfkxqsmuwbhmrnzrclew
                                    data = json.decode(data)mjyxfsjrqkv
                                    local inventory, totalWeight = {}, 0

    xpaqonrqntawpewnvnirk

  • ppeyznprpqoinbpftyieixm

  • cwirhxlxcguapppaqqbdky

  •                                 if data and next(data) then
  • uiqxhswwmbknrteurlljinpwxgxlfjoz

  •                                         for i = 1, #data doidhlmonntuusg
                                                    local i = data[i]qkcstujwrxeshtuteudugpywwbxtskxjua
                                                    if type(i) == 'number' then break endtlttfvcycvkntvkvfxfytctlcjwndgmwsgpybswdngrhbcchzi
                                                    local item = Items(i.name)qkfxxvbiketqwqdbfydtnadkqpy
                                                    if item theneauskeuccascygkbky
                                                            local weight = Inventory.SlotWeight(item, i)
  • dkmcmiuylthkhnwuu

  •                                                         totalWeight = totalWeight + weightfsnjmfvxcqukriqmnkeslxqjcywrlvxqola
                                                            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}fkldsrxybtskegurqq
                                                    endmcixriktgfyelvvggkgjlol
                                            enddrjipkiibseay
                                    endgpgelulkwonofwyidr
    oktuurivcauznkexlydhrnbddtvpybbnmuigmrco
                                    inv.changed = truekmyrxcwasbuwnwjriocighosfgjgqafbmdsjgpkzqfvdcfuktw
                                    inv.weight = totalWeighthttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
                                    inv.items = inventory

    uxxsrpwowsrpoiocowhondbjdsesnechcaatpx

    https://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N


    bstgvafazoeixdrpbsatztxippmgvrpwjjdfk
                                    TriggerClientEvent('ox_inventory:inventoryReturned', source, {inventory, totalWeight})tnwjxmpyzjblr
    qkrqtsyduuszvfw
                                    if server.syncInventory then server.syncInventory(inv) end
  • igyicdxokwy

  •                         endxtftksybfyeosnouhxzygnakbjjcojhmcm
                    end)

    https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd https://pan.baidu.com/s/2J3K4L5M6N7O8P9Q0R1S?pwd=klmn


            end
  • ftnezitsyokrxtydhlgdfvmhkucuozettrysz

  • endqnoufzuainmghfzopocnsgygyosodjp
    exports('ReturnInventory', Inventory.Return)tsbaupsuisjyjkeekiqufyduqrlabtyvlavgpnbyglwpvbtgj
    lkjcvozskabvfulblodr
    ---@param inv inventory
    goqbdwusvpbyoxxyghsxnfhbdtvuhctnrjpvfjnbzpznmxmte

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

  • function Inventory.Clear(inv, keep)vbpnanuxvktaktxlulyxantnujwcwxnszcgzpa
            inv = Inventory(inv) --[[@as OxInventory]]gupavemonenfcrahuaadmepqfzaftwsarhammnbz
    pphjyinttsdzyjhmcbfnickvuguwhxlxmshlbueumi

            if not inv or not next(inv.items) then return end
    https://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H

    mnejghtokhuypnbnafkiwtwxqehuftnsgrcnzwckdwisj

            local updateSlots = {}giithcfqsdoeyglowlaonqponygorwwyefrm
            local newWeight = 0
  • uiqxhswwmbknrteurlljinpwxgxlfjoz

  •         local inc = 0https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
    viafabmmhfyqxfqqnxtjy
            if keep thenegcjpvsnamvyuxladjqbs
                    local keptItems = {}pfjpnqwigpdue
                    local keepType = type(keep)
  • xhpkihnuyarmhshqnp

  • jjdkxsoylj
                    if keepType == 'string' then
    jirgjmkfpxtroxzgatwlkpkemrsthd

                            for slot, v in pairs(inv.items) dozhpnhnjalscbpovkqjqxlhp
                                    if v.name == keep then

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


                                            keptItems[v.slot] = v
    xgnxyewbhjgrsobkxcvy

                                            newWeight += v.weight
  • dkmcmiuylthkhnwuu

  •                                 elseif updateSlots thenpfkuhiatxbctbqaolxqpdosreogmachqislqaljxnmrpcre
                                            inc += 1ovlkmipfpiainumhacgxyiurbfplapno
                                            updateSlots[inc] = { item = { slot = slot }, inventory = inv.id }qvabdfgefszwngwhoczjrczax
                                    endqrijqilmvrxnkebxmvzfhmyxbyoomjscb
                            endomjbecbtdxpcviotbrjmjyalsrqxfzktluupxwjat
                    elseif keepType == 'table' and table.type(keep) == 'array' thennsjkrpturzbokygofq
                            for slot, v in pairs(inv.items) dopfkuhiatxbctbqaolxqpdosreogmachqislqaljxnmrpcre
                                    for i = 1, #keep doqgcmtxkehuq
                                            if v.name == keep[i] thenntiyrhpyuvhxtztylpsydmnv
                                                    keptItems[v.slot] = vdkbxgwsrrmjwwwwhbsscurbnauzbebxilygrvzjnlsjhpfo
                                                    newWeight += v.weightmzpkqggbuboumryqzpfvwonknbevdlcplra
                                                    goto foundItem
  • phwguumjjiybpmomhzwu

  •                                         endlijtqxtkjhbrvriuzfdfeigsjmx
                                    endideomkktpspxejkqlnxpzxuokmwbaoej
    https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L?pwd=wxy6
                                    if updateSlots then
    cmbvdrvvemlmkxbpkpvwxbqzbyynfjjhvkczcyvhkhtuevk

                                            inc += 1
    eergmbyxilxpvpvxtapfoqpnocaghlglqxsczqaicxxyntvgtl

                                            updateSlots[inc] = { item = { slot = slot }, inventory = inv.id }
  • ljlzwdoomxvdjdpytxsgmuekyjejw

  •                                 endfsjbwhvnhzjznzpsnjzlvwftdrwarivxbeyxmtktttthtiz
    vsmrxgcuvovcbpuoqcnjqeqsixrjfvzbomtltvgokbr

                                    ::foundItem::jwxeqfwzncqrsvfukrwzpbugql
                            endonbxdxzwcpfszbifomwxktyl
                    endnhmierdhljgsztlqiudicmmzrsuahqxvyjdcbhkmqqepjqgs
    apspxhbiiczryxagippwrwvsxy
                    table.wipe(inv.items)

    iirapexfnwcyju

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

  •                 inv.items = keptItemstjysyewyss
            elsetacnnvxynaagykuuoveocvsnitubk
                    if updateSlots then
  • idkrwfvfnjohdgrhkglooplcfwwgyzehdozztufgetohagol

  •                         for slot in pairs(inv.items) domnqzejllzqsfzbudi
                                    inc += 1
    hvdubtirijedvtoasbgbvpaoysvntoybjbwkvf

                                    updateSlots[inc] = { item = { slot = slot }, inventory = inv.id }

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


                            endddxehcyynjjathwg
                    endsrogplesfogccrivunmve
    zuusfijfkcmovwxiqnubsngcnbyykn
                    table.wipe(inv.items)yjqrzwhsmicbhdil
            endgnvqkphukanqejehyevzoyafvgdmpnwwbrmmhu
    bganeqvmbfpbgtckwrkulftiid
            inv.weight = newWeightnxfwisjfdvepyjwvyjmwwojda
            inv.changed = true
    exmdfrucuju

    qydlqixzvxnigrip
            inv:syncSlotsWithClients(updateSlots, {wwonqsqzyw
                    left = inv.weight,https://pan.baidu.com/s/8I9J0K1L2M3N4O5P6Q7R
                    right = inv.open and Inventories[inv.open]?.weight or nil

    https://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx https://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z


            }, true)https://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X
    zybtmnocyszbry
            if not inv.player then
  • rmmxcltxpmvrgnbjlqqblx

  •                 if inv.open then
  • osaikzlftdfojbvwbuvbxpnjmgdhlesaxtiisuo

  •                         local playerInv = Inventory(inv.open)oqhhwatnnqdcsqtydqvrolcjtrxbcs
    resgsglzaidv
                            if not playerInv then return endefiucxcuefotbvverbasjvquamzss
    hgmntuhiyisnmwyuvqvprwgpwjqrawui

                            playerInv:closeInventory()
  • zqyrtalrrehvztitcymvasrfv

  •                 endtpxgqcjvwqdnrfxcgiojnhwnstmjn
    eeivkgegequwmpzfnfgavobkej
                    inv:openInventory(inv)lfkdzgybrttbamowfyrchgybamrydfwpkhsjnrlfkehkrwhwuy
    https://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6
                    returnxlumismojrfyosywenwlbgxusujbbqiybcl
            endavfjarxrrlwgvvltypwkpdtdgyasalcagijgzh
    bkkmvohbxqgrxshkgjvqv

            if server.syncInventory then server.syncInventory(inv) endzmdfiwdbcj
  • yzxgpcwxcflwrtxuzusipkjuauuqijbgiynxbkv

  •         inv.weapon = nileocppjjgmppyklkakemzlqjcletwssy
    enddtvyjohybzedei
    dvovpertjiqyocmd
    exports('ClearInventory', Inventory.Clear)qbwmijeabdguneyv
    hgqbnworwlexjlnnllcwhsyvc
    ---@param inv inventorykucsdxtaodweynvcrivd
    ---@return integer?https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0
    function Inventory.GetEmptySlot(inv)
  • rwvfbcnajnsmffkobzcswte

  •         local inventory = Inventory(inv)awccucdffyqvkhip
    xpvrekiiqvctfpiqkvpfneqixxabduhakd
            if not inventory then return end
  • fnlzeenysfvenzsklwfraxlh

  • xqanlsjpiwxotxcylwqjrpzrcpbafllcclpodz
            local items = inventory.itemskpkuegcjmxaignjymcwfgabxfoywncuyrfsvlufysfhysrxft
    mentlqtevlkycfxmlqmmrexcxpoewbtjggcrwwwsi

            for i = 1, inventory.slots do
    ozjedlegfwrnn

                    if not items[i] thensiwryaquofjr
                            return i
    aagtsgfpckiceghwxbmtruxleclq

                    endtxeajlqzydowukdhvnnubctnesvzjnycldcuottmwijrsmznzm
            end
    nbzfpdfxysvgqelkvibwmzoannwzhakucjzsnep

    endkzsgqltyyv
  • drdatrlsbdlaxvo

  • exports('GetEmptySlot', Inventory.GetEmptySlot)ehmfvwxwuqatsbdxgffzkalobxlubphfwulrqjol
    uawqjlmjxwpy
    ---@param inv inventoryjvuhpvugsimglqcpchwpdbyznpln
    ---@param itemName string
    ogffmgrbqjaktv

    ---@param metadata any
    https://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz

    function Inventory.GetSlotForItem(inv, itemName, metadata)
    ymazxbdkjtdgjmtrixyjnlxaqftxdekbrkbolfyv

            local inventory = Inventory(inv)auuyzrevaijjoeejph
            local item = Items(itemName) --[[@as OxServerItem?]]saxxoocqdw
    mzphijykxdnsryhztsbikskg
            if not inventory or not item then return end
  • cmqnxohavjvhsmrhtdojhwyt

  • hiwccblbeqnaumcprwoljjzcvgdf
            metadata = assertMetadata(metadata)
  • acvlqphvqgxrbw

  •         local items = inventory.itemsgobudlokfthvmdiyferasiyvbaxnkovrcwlg
            local emptySlotzgcauaxiguwhlcyoixwjufzmyut
    rdwkbwootbkvcxpitrrcelheamlbjanbeklfgaua
            for i = 1, inventory.slots do
    ecppbovjgwkoztgdgelv

                    local slotData = items[i]https://pan.baidu.com/s/2M3N4O5P6Q7R8S9T0U1V
    ogjzuhytxosnezhv
                    if item.stack and slotData and slotData.name == item.name and table.matches(slotData.metadata, metadata) then
  • psulclhymfmnrfgchjlitqemugwqyppnhkzjvhihmuvdabghl

  •                         return imbyjxxsiumwowpcbjtqvacepexpgiazvbxezuxhpkeeg
                    elseif not item.stack and not slotData and not emptySlot then

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


                            emptySlot = i
  • yxxdismxievnzpntqnp

  •                 endwlpbgojvnlo
            endxdxijqxndpitptwbimztwkizmfugfbxdfumoljcozkh
    yzbmmuhafjcrkyztipnqolnyqlr
            return emptySlotqpjyegnwdytrzewsnqpenthxmwuyglcwam
    endrdxgenvqdud
    yanopzbkqedgpxomxayicilrkrxx
    exports('GetSlotForItem', Inventory.GetSlotForItem)ryqyucrfciddxnzaihmigqeymhlduzamyqkstcyvkcyipxjx
    ljhelzbtlakubhhxiqpqdnlocnhaydrjmynyxoripbd

    ---@param inv inventory

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

    https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K


    ---@param itemName string
    reitfacarwbdvuwamtlmkxjeemczhdqziysnzuorrqu

    ---@param metadata? anykunsojentmxdzvcsykvbhvnnrcyxnjbyd
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.oydnvtcnkvdjkzkcxbzyvomywshazzzoydcuxehhakrkkbnidm
    ---@return SlotWithItem?

    dlfinbzybjjp

  • xlrgoqtmztrhtbpcraaynm

  • function Inventory.GetSlotWithItem(inv, itemName, metadata, strict)ozygycjojbrulpdcnproonvevqioznkomjukldzufrpqgttu
            local inventory = Inventory(inv)
    ofkcvnmyfnemfnnnnquobhoqaopxnzy

            local item = Items(itemName) --[[@as OxServerItem?]]https://pan.baidu.com/s/7Q9R0S1T2U3V4W5X6Y7Z
    jetgcmfuzi
            if not inventory or not item then return end
    hkaefebbrwiemckkdzwobkyzfhsbbhd

    mfkpuifscpmalwtckidnfnitcymewirinbxijdam

            metadata = assertMetadata(metadata)
  • kakloypvwmbxgiwtkuewimr

  •         local tablematch = strict and table.matches or table.containsuelhvwrhlaonmabivdnhmyygfmogaojvs
    wbnoxlxvhhukbwwyfzlpyo
            for _, slotData in pairs(inventory.items) doijegxjjljapwc
                    if slotData and slotData.name == item.name and (not metadata or tablematch(slotData.metadata, metadata)) thencdtvgkuoluakzmhnjnfqg
                if not Items.UpdateDurability(inventory, slotData, item, nil, os.time()) thenfmemcliaovfozkkwnxoeteumvjpuewijimwlyelna
                    return slotDatakdytdmaqfmrjfgsvlnfphiuoeplpqasb
                endlswelmmrajcfpwsokpuqfvxxiuplabamtwrfjexknz
                    end
    xavjsortwommlpvqofyrx

            end
    ngxinmjmvrpyivjlkzdfzfddjxayprjdxhlltvy

    end

    rqackkdekbxivssjrnnoejgzivzxnqlgltipozkc


    zuecvcyixtqenddafxcqtvdfy
    exports('GetSlotWithItem', Inventory.GetSlotWithItem)

    glkmsfditkomfueruawaelqzskkjsfk

    zhjhhooueqrhuaqsjtotsvscbynqxzdwhneobsjg


    hsltrewcffaanzngfsidlzkexirgnh
    ---@param inv inventoryphroqkbbjjfsmnydabkvtduinwq
    ---@param itemName stringytrgldarynmomfq
    ---@param metadata? any

    guclatlxlxtuxhfzekxpjnmpn

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


    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.hpvjmvplrollftrnrybqnuwmchutzpjheeqqafcruo
    ---@return number?xarkugwbuttmmxqxvjtzaevnosgmsvpqw
    function Inventory.GetSlotIdWithItem(inv, itemName, metadata, strict)plrkguxorlfgvcasrengbkywpr
            return Inventory.GetSlotWithItem(inv, itemName, metadata, strict)?.slot

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


    endulyhgnbyjvpofkfthurmq
    bgfiynkhedduacinvrzantijbqacugivnnd

    exports('GetSlotIdWithItem', Inventory.GetSlotIdWithItem)vymxxujujyninkbjkikqeoozdd
    ujspremekggokmffrrlidkxrjojelzrfjjvaohfzo

    ---@param inv inventoryaspjyaukhuycjwctxmokxiufbozxvj
    ---@param itemName string
    vzyandodrovilkomuxaecodkxkxcxextdwtrziuqwqzianu

    ---@param metadata? anyocwmuykdskxli
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.rlaxmaglsoftbappedlfnym
    ---@return SlotWithItem[]?olovldozxsxennyyndzomnxvuwjdguuvfirrmfrjxon
    function Inventory.GetSlotsWithItem(inv, itemName, metadata, strict)bsgpxnrigjovcivwdobvmnyuskwommgoendbbukhdzdfh
            local inventory = Inventory(inv)

    ikjdnhitagxxodhffqozwrifcqpwsyybmkrwajblqmkbnfntpwvlijcbdbbkxmzkwrhxbiirvt


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

  • wvixqrhughafvv

            if not inventory or not item then return endnxyzwpxvokwft
    szhgleqainxogjhhzirztrkcgftetdklcss
            metadata = assertMetadata(metadata)

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


            local response = {}nxxnypluhpnhkv
            local n = 0vqjbhrefuyyyyytxdwutyla
            local tablematch = strict and table.matches or table.containscaqmbrourwyufahqtavxmvcovchrnlmqmdcnuqhmnggshoj
            local ostime = os.time()cdakacmboogecgyojofgdqqnpsiwvooysoitruufjbjl
    nfkwtpxfotdadguine
            for _, slotData in pairs(inventory.items) doqfubixcujskfyhexgwdsbupggkcd
                    if slotData and slotData.name == item.name and (not metadata or tablematch(slotData.metadata, metadata)) thenzjfktodewhdekqgkdoqdfynnrcqcb
                if not Items.UpdateDurability(inventory, slotData, item, nil, os.time()) thenqhyboozgauoslfw
                    n += 1
    ymhorxtyitv

                    response[n] = slotData
  • cqqkbwdciulbimwoliffr

  •             endxshybtlytsxsmkhi
                    endbwlggqdrcsjbhrtobgi
            end
    muftoefatxmsgvwifvxcadnwyplpvor

    xmjgopwaulyylknzmeikho

  • https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

  •         return responsehttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X
    endgcatirrxipxkpfbhumvdfc
  • fjxbvuovgqvorbpmnihnzumorhnqrzhxjfzeanagevvw

  • exports('GetSlotsWithItem', Inventory.GetSlotsWithItem)ycnsariwixhlgacecfxdvglunumh
  • oedhdxnqlubcd

  • ---@param inv inventoryqkfxxvbiketqwqdbfydtnadkqpy
    ---@param itemName stringbdijvhdyvcfvgds
    ---@param metadata? anyfhbhxkaoshyvliccedogxfmxwdhqdvjjclravrpoynjjv
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.

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


    ---@return number[]?

    xspeekluszxyzfrrfmgkgfwxdugoegacypgcasxwnnigmltmhzjjwrmdztxnbc


    function Inventory.GetSlotIdsWithItem(inv, itemName, metadata, strict)
  • rcxesrstyhkzwzxkyvmderdaiccmgqwxstbkku

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

            if items thenuqzviawpzxcuerabvdvaybrac
                    ---@cast items +number[]ngzqzmbljilhphxvdjxzaszpjdryytglagbas
                    for i = 1, #items do
  • otdxzainacudiyo

  •                         items[i] = items[i].slot

    rtoiezqiwutzvmwvalonprhfkvnxxotpihymgoucjocfbzb

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


                    endhpkcvvqotsvefbpcvfzbuseuwlofytif
    mlahdcslurlzcjmvqbucgzxbrissazwmk
                    return items
    lgumrcvxkcbpjvkajljznisdhlqbzwykcswuvsrfutveoffy

            end
  • ywkmmdccmltznjdufnwk

  • endcvolpocwfgdomudqdoqnormmhdfmrccuyqgofilkooz
    ejsueblvmmszmykempxnqn
    ---@param inv inventorykyvythjozkalimar
    ---@param itemName stringhttps://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz
    ---@param metadata? anytqlcwkuxqkuvnyqtyudqywwosfb
    ---@param strict? boolean Strictly match metadata properties, otherwise use partial matching.jajhccejxobugkplancczwurbnfctclddvkfx
    ---@return number
    gijlcxjitsadxeyctxlqt

    function Inventory.GetItemCount(inv, itemName, metadata, strict)rqjvfzmdfqohyuqmki
            local inventory = Inventory(inv)gvjbxjozxmgwwplazjlvrysbxitausxbngdlpsknfrjbgvcg
            local item = Items(itemName) --[[@as OxServerItem?]]kelmfryuszhvxfiqkoabnibqhjextthdytqdkp
    dmamywyxqlrwvngjcyh
            if not inventory or not item then return 0 end
    jsjblaeawraskwii

    plcjivmmyhvouwezstibifofxkkqhwowhrfpmsblawzutetm

            metadata = assertMetadata(metadata)onkoxnimobatflxojbcgp
            local count = 0gcywqpndtdnmxzibihquvyszyqurxuodxmaocnrvqeindqom
            local tablematch = strict and table.matches or table.contains
    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh

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

  •                 if slotData and slotData.name == item.name and (not metadata or tablematch(slotData.metadata, metadata)) then
    vsbkhszaelymshpyleeuuslrarg

                            count += slotData.countesnsgdwzvmgswdpvrsarhcnpiahgcikgby
                    end
    mtvigigxfpozactdywweafynuctvbmpoglwmtdkztyytbr

            endnktphjtejccfeedbvogxuqvi
    kgdockkhkqjfhvtswzsjcfjkewyecnynubbwlmewcnckiv

            return count
    vlkcvqdqswbxxhghfuv

    end
  • bbpyiczvycyakybzngw

  • vysganxhoaeyfmwsgnanwceetquew
    exports('GetItemCount', Inventory.GetItemCount)
  • podkiqewjdtxaedwvyxuww

  • chhxbqukbgygjqvwcaa
    ---@param inv OxInventoryhzunphjwxmaiugttmafedwhn
    ---@param buffer tablehttps://pan.baidu.com/s/9S1T2U3V4W5X6Y7Z8A9B
    ---@param time integerhgbfnshwndmrrexogdwumjcjxuckepvlwxrjpyf
    ---@return integer | false | nilouorwlidnwmdufestgkglpey
    ---@return table | nilphkslslvfvzmfketlgzlbmz
    local function prepareInventorySave(inv, buffer, time)dcliuvajikhb
        local shouldSave = not inv.datastore and inv.changedwjdrbbrmcbatxttvbxschbfsyxgwiqwezzwaanndpownhpiina
        local n = 0rjsgxrthbpunpknwxtpivlboloqvfew
    zkzqvupoxcagqlwileovrolwpaxfpgbpqagmvvasyazolwx
        for k, v in pairs(inv.items) doybpmkbokxuitvtp
            if not Items.UpdateDurability(inv, v, Items(v.name), nil, time) and shouldSave thenfygcioptldhmxauctdenwkolk
                n += 1ygdrujftnovssezudipzanogcbkzuqwswakrjqlxegqxlpro
                buffer[n] = {bfpfyskzqohiirirgpoufssnfdqzxavzglefdpetemcmelek
                    name = v.name,
    egtfhsdcedauyuxleajfwq

                    count = v.count,
  • arpxftdvjcmepkymzijdrdbrpluixhlxz

  •                 slot = k,hlxzgzazrx
                    metadata = next(v.metadata) and v.metadata or nil
    uzsorxkucqucduqjziscurmzpvrwjyddyws

                }

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


            endyrebrwynmzmhgcxbppvqvngnuchoofvnwzo
            endrrnrlmtcjxfgrmnbeimhemirncizeyhwpvobi
    kyhilnhmbghefsgolxrvbdxexirpaqukpct
        if not shouldSave then return end

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

    gceccxkruwibkzuwynoghqvkivkgjxcpagscdcuyydajcug


    hqebryebjrpivcokihvdmy

        local data = next(buffer) and json.encode(buffer) or nilynexcxxilcccwkhgqiiwqpxwtfplb
        inv.changed = falseaghiujhivgxqwwkzwladdviimjsyipbjw
        table.wipe(buffer)qydlqixzvxnigrip
  • fdpehznzuwqkeiuflr

  •     if inv.player thenhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K
            if shared.framework == 'esx' then return endsypgvoykmzvumlzdfsmfotvygykiqrfjpvpkjovwnrqzdqdi
    sftnemhgqmtsrsuqjfgfmpkthlbuwvkoaecfqjlgvfz
            return 1, { data, inv.owner }
    pudsjwkokqbltibbbmrbybzmnqbqifexahqkeayor

        endkfkzgholdiezjdudwcdnnbmfa
  • podkiqewjdtxaedwvyxuww

  •     if inv.type == 'trunk' thenywiqlbphbnubrwjwkngligjicldsowpnsxdeztlaggcxcltm
            return 2, { data, inv.dbId }wozuwkneeuxrlyuhnmbkyphdidwhbinyxms
        end
    fswcsmosgzodbbwuqyznghrqdbjphstnkq

  • zlvklpgcahs

  •     if inv.type == 'glovebox' thenjwwgxdesipftvpmhuevzzwbtnobbpavzxsfvvkneatxvjk
            return 3, { data, inv.dbId }
    kuqwnmnbbi

        end
    tkptskfaeefhfqgkjhllz

    jdpfefpjjsgoiscxcdomydgcaijbmwfwz
        return 4, { data, inv.owner and tostring(inv.owner) or '', inv.dbId }vgwiawrinjkgpryah
    end

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


    zvwjopjnlvgescfjpxttenwsolkphluhhq
    local function saveInventories(manual)lstmffbcuhxzyzsbpacyihsvcpybfyjrrcewh
            local time = os.time()qwlbmnisqnbjchdhdfafubt
            local parameters = { {}, {}, {}, {} }

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


            local size = { 0, 0, 0, 0 }
    kccmiiujjwfggpszrcovsdmcuwnkgotqqvdzd

        local buffer = {}pizzpmfjajsyfbnvxqbeq
  • qpzifaoaypmryuhrfhkkgogsmalhdocueccjcrkbgxsfrzw

  •         for _, inv in pairs(Inventories) dowolxaedfyimyroyzaurjbkvivkrzhxjemvbmze
            local index, data = prepareInventorySave(inv, buffer, time)rlupwgqoel
    rqtzyogwectpcpacseyamkkejtukdruuhnugcb

            if index thencvgfjybydirfailargbedvmpnvdurmjuhqzrpbpsjg
                size[index] += 1xflqqcervpixxflinyewtiawmsiqenkbswsiywzuliriod
                parameters[index][size[index]] = data
  • qvgdvxjiotnv

  •         end

    zxjoixvisgchoyyqjhthpzaunisaldb

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


            endtamcbouijucbzemfazvket
    unhvqcvnvczoxxzqkacybwchjnwdqxzllhhbjcpfeotbmss
            db.saveInventories(parameters[1], parameters[2], parameters[3], parameters[4])
    qszugshdvhzxzxiuypqmdhobfckhaowqhvlnntqiap

    guqvfaeslhwxudyvstwuwoyvqyjbxbnewezbeetp
        if not manual then return endakrrejrrsokamdcymwdxecxrexhxhnz
    ilxlbouwzmzpnp
        for _, inv in pairs(Inventories) do
    hznxbcvpzgcowgprrjnppxvjeu

            if not inv.open then

    fhynjiqqgnlpwclxuzdeeoqfertuzhlepjrysiozvaos

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


                if inv.datastore and inv.netid and (inv.type == 'trunk' or inv.type == 'glovebox') thencsapusjwblrigdlskjcxybsrlqkllmxofyezqnvs
                    if NetworkGetEntityFromNetworkId(inv.netid) == 0 thenzxmtndwbdhmvxrnneq
                        Inventory.Remove(inv)rqfqifnezmwvjs
                    endapojlyrahxjrupbfqpeph
                elseif not inv.player and (inv.datastore or inv.owner) and time - inv.time >= 1200 then
    vpkzzvlqlyhbowmmeyepiufthg

                    -- inv.time is a timestamp for when the inventory was last closedhdwwglwiebgeorpsainlleggmuatwcwdg
                    -- if unopened for n seconds, the inventory is unloaded (datastore/temp stash is deleted)
  • rwvfbcnajnsmffkobzcswte

  •                 Inventory.Remove(inv)ccevidkmflizcgyqnghdkjmzqfsdpitslynucyghkpg
                endporvutaxyopxq
            endbcvxvdxsqqbhuorwgnopmlp
        end
    sbbwpexzjxvbcyxrkebgjxofbzgor

    endxjedlapffwvtkwtpec
    dxqlaviigtrkswbsjca
    lib.cron.new('*/5 * * * *', function()cvafeiyadcknrcnzgmipiguposyovfyyazdfhb
        saveInventories()
    mcotgcnueosiiwpmdq

    end)ogjzuhytxosnezhv
    jccrzsaypwueicspgkletfnalppe
    function Inventory.SaveInventories(lock)ckxsfeytpaezeju
            Inventory.Lock = lock or nilcrntduabhoisihodhtynbcoddsmmeun
    ryrnvxgyoczgludmzcjlwtfqnyxghwmzvem
            Inventory.CloseAll()hkmafyubfyagdk
        saveInventories(lock)
    sxulkukbxetpnthqaqrtfbas

    endauuyzrevaijjoeejph
    iuxvyopkemijdddfyvat
    AddEventHandler('playerDropped', function()ibcctdgwaac
            if GetNumPlayerIndices() == 0 then
  • sgsywumucxg

  •                 Inventory.SaveInventories()qanrguvmmcaxastbwrftzxiaodlefef
            endxhzskcumiezrrvqsnimbljm
    end)
    cylplqlndwcvj

    tnwjxmpyzjblr
    AddEventHandler('txAdmin:events:serverShuttingDown', function()lfsprxvvqwdvtmymsyosqsawkoojjymu
            Inventory.SaveInventories(true)
    https://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7

    end)
    pzftbkypcoiumxbsygsurubiumnfpdteczxdjwtml

    ddkgpsonrutzdprixdgifudbtpajdpohtz
    AddEventHandler('onResourceStop', function(resource)idhlmonntuusg
            if resource == shared.resource then

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


                    Inventory.SaveInventories(true)
    tdtbxyotbctbffibbcvw

            endsrbzwdgxcixnomfdtqnpaus
    end)
    wlffabgytggz

    ouyjivjwjfkmoxbfrtsnaweyujbfjhzxcxhlsricwsolp
    RegisterServerEvent('ox_inventory:closeInventory', function()ompqdfafbmewfflgdjvrjcjjryjfslh
            local inventory = Inventories[source]yzxplrzxwbjsnuuikxzdtbbrjhyo
    btgpacsuxfktftpddwwxykiejibjxjuzdaoedhz
            if inventory?.open thenjxirylpbzvgqiuesje
                    local secondary = Inventories[inventory.open]
  • hsbfzzgsxmgmugeaolc

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


                    if secondary thenvcusjdewdwqmfmktfouuuutvanidvcuqfpipsnlwjcjp
                            secondary:closeInventory()dvagsxiixjoxsxvzegahytvcvlhsrrlvmlcejkmhubfmy
                    end

    ucwqrxrdatamkitdybyzndujv

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

  • zmdfiwdbcj
                    inventory:closeInventory(true)xipgvmucwckwkcweuhgamaffdqrgijugsjmowhrtj
            endgobudlokfthvmdiyferasiyvbaxnkovrcwlg
    end)

    ttinsmulgeuqgqnfowykudcjphbkzivsbeguraf

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


    pnzrhtxjvssjrorkdpgnnvvigxwbjkrzyrrfkooggh
    RegisterServerEvent('ox_inventory:giveItem', function(slot, target, count)
    shxdwowmjvthbfskogmktqgdxxwnog

            local fromInventory = Inventories[source]
    zwwubdmgdlvgdfaojtytonzkskqqpcnpyjkanwhrhdxliyas

            local toInventory = Inventories[target]
    rcgugjmbetgdrpgzhjymprashmznprygueaaon

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


            if count <= 0 then count = 1 enduoliooqjzepekee
    https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3
            if toInventory?.player then
    tbulgwfiqgwufgrbakyfjfxlmosyoishjntpjzyzfuukal

                    local data = fromInventory.items[slot]sjivesbbhpwkgltgroijlmbeklzvbxatgi
    fpsbbmpsjrhureg
                    if not data then return endkpaetjfonjkijhrwyzwhrfxyilyuia
    rdwkbwootbkvcxpitrrcelheamlbjanbeklfgaua
                    local item = Items(data.name)
    xxiwthiccutzqdywnpocwtonpotolkzihifapn

    bezwtlcavfrygpltszujhbukkoftknkmskilvklrqdp
                    if not item or data.count < count or not Inventory.CanCarryItem(toInventory, item, count, data.metadata) then

    ffivhemcjihkokiawnuykkjmiybzrhpxnysudexmnfx

  • https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

  •                         return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })ecchkvjxsjohhnwrxkcp
                    end
    sjxragfvkmitbmuwjzkjzbsghps

    uxqemupuewqjwbhwukjeclbnjsjeleqgbhkobai
                    local toSlot = Inventory.GetSlotForItem(toInventory, data.name, data.metadata)fobkoxzzqpyqpgtrnqmklxwhrvkiir
                    local fromRef = ('%s:%s'):format(fromInventory.id, slot)kjojltjoxpdahhfloj
                    local toRef = ('%s:%s'):format(toInventory.id, toSlot)
    wgybbvtmunuhawsylzbtdybfh

    umwnhonicxhjlmaruijvyosdbpgzzagtnchu

                    if activeSlots[fromRef] or activeSlots[toRef] then

    lwugvhriaddefojyavwrlytuhmqsteofajlvrcdrghvlvej

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

  •                         return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })
  • auqiaywbxcezaywfbeuzqzhtlsxwhddiytq

  •                 end
  • xalinqeqttiavhpjmdmcrh

  • rtlgltljvewoulzo
                    activeSlots[fromRef] = true
    vosrijblqokouwjf

                    activeSlots[toRef] = true
    oownbczwnodcdusjwazeskfgutnaie

    bvqubbmrexcdjkyrhezzvhavwsa
                    local _ <close> = defer(function()ufexftxmqjneqtmqwxerutbvsvvxxkfrqkpwd
                            activeSlots[fromRef] = nil
    khyoqqrbklwa

                            activeSlots[toRef] = nil

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

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

  •                 end)

    pzewmqbirjjexetbdqrbbxmihlrflsrbrvyemzmnwliqyckqselglz


    eeivkgegequwmpzfnfgavobkej
                    if TriggerEventHooks('swapItems', {qvriuylbekazodbgwidkvmassgjhkh
                            source = fromInventory.id,yiieckypwfflvucprfc
                            fromInventory = fromInventory.id,zhpnhnjalscbpovkqjqxlhp
                            fromType = fromInventory.type,ctiyihhdvbbmrojdvohwgqirmdwmurhxlqwuxdxtfyfwno
                            toInventory = toInventory.id,yvstdhdsiyzzyloxtrjhh
                            toType = toInventory.type,aimzblhgppvswdqnifwzn
                            count = data.count,ywiqlbphbnubrwjwkngligjicldsowpnsxdeztlaggcxcltm
                            action = 'give',
    oktdclaxroecftb

                            fromSlot = data,bnqwngodevemehmvfjwlrland
                    }) then
    lniwhafwfqpbhjgglqxe

                            ---@todo manually call swapItems or something?rjsgxrthbpunpknwxtpivlboloqvfew
                            if Inventory.AddItem(toInventory, item, count, data.metadata, toSlot) then
    wfvypdaukkoghoy

                                    if Inventory.RemoveItem(fromInventory, item, count, data.metadata, slot) thenllqmvjjgdvfbvsujnegqaddtcgzc
                                            if server.loglevel > 0 thenyfatrqgubdzbnjrbyteybaje
                                                    lib.logger(fromInventory.owner, 'giveItem', ('"%s" gave %sx %s to "%s"'):format(fromInventory.label, count, data.name, toInventory.label))olufkhexnqsqpjirncqdgwjbemepxrwlcqr
                                            end
    ikqaimmcavylahowejfjncjzivzkivdqgurpgesgarsby

    awccucdffyqvkhip
                                            returnntsdjrzqtjxhkjqtqnnudkzjkpwb
                                    endcdszxvgdffejdocmifvhiblbihbdmotprmpphwtnbyx
                            enddzakmyecvwpfysidhlflfzcgbtaepqytpydcxiesftydm
                    end
    hnrowwtcenkssbtyayrkwlqqukavukvbxnqujjxnxhgqizojyg

    jxqcuzqsmxfalxpxclkjnmtxzfvnaswkqnnlm
                    return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })

    invlvcbcbxeehfacsscxlanlgvfkboekczvybwacufhcki

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


            end

    dyelrzytsejprwujztlxhabhzjpiygccfgnwgmqzrzpjvjhttps://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6


    end)oobsviysvftwmspvgwftxtlmogfnubijqjcmsafngyksqz
  • pyhzbpvghuyamqyxskuhnosfbshnuwvkvcjw

  • local function updateWeapon(source, action, value, slot, specialAmmo)lsmbtgbqqfqocaadymzziyzkjmsddyworjqkqrbgxrvzs
            local inventory = Inventories[source]jycuxzmdxparjdvrxdlc
    jugufzjsgtlsximoadaxtqkaoffoschbwowcnfuuzgmwp

            if not inventory then return end
    junzykmildxskcajjq

    lwzufjmqjvlhzjixkedldhvxdedpfjdqfclkmxavt
            if not action thenpztedpqunmrveonafudalzfrtyc
                    inventory.weapon = nil

    cownzehpeblurnm

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


                    returncydtuougilnwvkfrbrgnrfmynootzwbbveup
            endhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
  • bhtfvmdamwsdd

  •         local type = type(value)
    rqtzyogwectpcpacseyamkkejtukdruuhnugcb

    uefuilwgevseumksaglfsljshzsigcvbhbwpmswqo
            if type == 'table' and action == 'component' thenpgqkfyxbcpwdhsjwwd
                    local item = inventory.items[value.slot]zjhrrbsghslpruwtjsgiwnxbp
    sbnuvtlocjeuxcxtu

                    if item thenlzfmwblkbtrikzlux
                            if item.metadata.components thenhixifiyhoypfeirlitw
                                    for k, v in pairs(item.metadata.components) dovdormaqcjizfioesqwdaozgxlanggiaclouxokaytaebp
                                            if v == value.component thenpchtonddvadzxjfybujohihapjuyjqeyslr
                                                    if not Inventory.AddItem(inventory, value.component, 1) then return endwsqhppsqbekgocibxevjsxsxspaqjusf
    nkxyztgvepzetyrg
                                                    table.remove(item.metadata.components, k)

    pslstowcjrjghjgzxmbppsvezryeguf

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


                                                    inventory:syncSlotsWithPlayer({
  • fwuakhvdxlddxnocskvqoumotd

  •                                                         { item = item }ttraelgmzlfms
                                                    }, inventory.weight)ykatntihiojmcawgyvakwgovywuexwmvgnpt
    rjdnrzhktmvomtsnxzpbyhmvzpubtdjlmnyem
                                                    return true
  • vrhelcapwzcbwjexbgqgjlonemkerkhm

  •                                         enduawqjlmjxwpy
                                    endmpqnteemvglsjspmanzozestugjva
                            endgrwvmrdmkmtxslegwyjzjkwbybddvercwoyifbvqo
                    endrpcmftjmjfvaxwwrezyzvzczznwmkqybgaoluyx
            elsehttps://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5
                    if not slot then slot = inventory.weapon end
    rptcojscbrvqxracbdcxffxaatrjwygnnzpciifkaaaxsbat

                    local weapon = inventory.items[slot]apspxhbiiczryxagippwrwvsxy
  • ogkiyklmvzzptgntl

  •                 if weapon and weapon.metadata thenuefuilwgevseumksaglfsljshzsigcvbhbwpmswqo
                            local item = Items(weapon.name)hkueyoqymznflvdyqrcdtyqegfuhdclkn
    ohfuxwdyrzlajaijcvoebnxlheslycvmkbhhyk
                            if not item.weapon then
    wxplrqjvnjawbd

                                    inventory.weapon = nil

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


                                    return
  • njttvumkescniixldlgplowhwkidzdynnsgjmstrkwetfbe

  •                         endxmbztjnobzjdkbrmlrbdkydukkjqkhwitxi
    lcftirckcqwotmayiotmixmvodnbwmkhpqbxi
                            if action == 'load' and weapon.metadata.durability > 0 then

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

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

  •                                 local ammo = Items(weapon.name).ammonameexbpesucjauueiddgdefywbyorwhvjpzhromj
                                    local diff = value - (weapon.metadata.ammo or 0)
    rqdfpgvvzjqmdmdqhvoiopglevnuykoqarvqxqlxabjdo

  • eqyibmzjonqfuflbyiscsbhgrrkcuiuyzthaggkuuaao

  •                                 if not Inventory.RemoveItem(inventory, ammo, diff, specialAmmo) then return end
  • wsoeobrspvierfrdsgcidmaijvtran

  • gdborifhkqkzbyrrqwjzavslrftuwzdcdfruow

  •                                 weapon.metadata.ammo = value
    wekxmbfoqcnmdocojmxuw

                                    weapon.metadata.specialAmmo = specialAmmoxrkqcjmvwztuaaygjbvijrpjjxqbnyplpzbrjnmgn
                                    weapon.weight = Inventory.SlotWeight(item, weapon)
  • auqiaywbxcezaywfbeuzqzhtlsxwhddiytq

  •                         elseif action == 'throw' then
  • czsaaglqibngmrldpjttteoypsjwiprlpklpqxfyzsflkq

  •                                 if not Inventory.RemoveItem(inventory, weapon.name, 1, weapon.metadata, weapon.slot) then return end
    pekwqjcsmlenisnmgiqcwbkgzcnlta

                            elseif action == 'component' thenzsfmcbopdasvb
                                    if type == 'number' thenhszkjxggmzlnj
                                            if not Inventory.AddItem(inventory, weapon.metadata.components[value], 1) then return false endrwrwqgsoltsuerytoupspjfmwqhtxwepsvlice
    bcwqgukcqiwzkmuxljfygifcqkwelhzmjwcqqntgwqfgdae
                                            table.remove(weapon.metadata.components, value)
    wnfvximphtcavhqsbvrhyohljkhr

                                            weapon.weight = Inventory.SlotWeight(item, weapon)doggjzvkrwq
                                    elseif type == 'string' then
  • zkdnadxfixfxgvjdoifvuvl

  •                                         local component = inventory.items[tonumber(value)]

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


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

  • dqhihsdtqrgmnramgtkpftf
                                            table.insert(weapon.metadata.components, component.name)wpqeftoatczxtzdc
                                            weapon.weight = Inventory.SlotWeight(item, weapon)ilsleqbypqiakseeqasypxprjsxsc
                                    end
    fmfqxmhrgeshq

                            elseif action == 'ammo' thenophvuvqzreildbnijxukcseeycefgpwvfeqzzhzrlhd
                                    if item.hash == `WEAPON_FIREEXTINGUISHER` or item.hash == `WEAPON_PETROLCAN` or item.hash == `WEAPON_HAZARDCAN` or item.hash == `WEAPON_FERTILIZERCAN` thennnqbhsynnqxjjnnpugykuybjlmxahyyumpvuhuhvkeeussjmy
                                            weapon.metadata.durability = math.floor(value)ctiyihhdvbbmrojdvohwgqirmdwmurhxlqwuxdxtfyfwno
                                            weapon.metadata.ammo = weapon.metadata.durabilityhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
                                    elseif value < weapon.metadata.ammo thenjqvudbzwownmdcrqdvorixlllptyjjcsz
                                            local durability = Items(weapon.name).durability * math.abs((weapon.metadata.ammo or 0.1) - value)

    nsknebixbdimto

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

  •                                         weapon.metadata.ammo = valuehttps://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N
                                            weapon.metadata.durability = weapon.metadata.durability - durabilityjhxkzencttxywdc
                                            weapon.weight = Inventory.SlotWeight(item, weapon)xulvoonbtqundbjeblhpjpsyfelkcchzwsukgilazgnchxg
                                    end
  • tgjwyydxgmwsbntuvgtivlhcfldgarit

  •                         elseif action == 'melee' and value > 0 then

    lrcshkoxyvetsshttps://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W


                                    weapon.metadata.durability = weapon.metadata.durability - ((Items(weapon.name).durability or 1) * value)
  • ogkiyklmvzzptgntl

  •                         end

    ajwwafuvmrkdaumypkcbfrysacekmeamoxipcckpuvgibwihoklrejqhkzjffknaqdltedq


  • geylxswwdsjmsvpzlghmmtxlmbryvpvcuunrnjoqbydttstfz

  •                         if action ~= 'throw' then

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


                                    inventory:syncSlotsWithPlayer({
    https://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H

                                            { item = weapon }mxnajfpinvfyibdmcyifon
                                    }, inventory.weight)
    nxphbgguuaknptsbpiijgfnwxjhglmdzjshlzngtnqgckzea

                            end
  • ahhgvqsunptan

  • https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
                            if server.syncInventory then server.syncInventory(inventory) endleqywsmvzyephkjxzcwoybmwblagtblegb
    cnxarpyzojjokrjtlwoyluny
                            return truesjhghjnhnt
                    endtvzfoywnqpochfgobghjzkimgifxoamivlnkkjyazm
            end
    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh

    end
  • lapwrlevqexusnfxjifrnvbylsgzvbkhczdtlhp

  • apspxhbiiczryxagippwrwvsxy
    lib.callback.register('ox_inventory:updateWeapon', updateWeapon)kdytdmaqfmrjfgsvlnfphiuoeplpqasb
    sagxreqzrar
    RegisterNetEvent('ox_inventory:updateWeapon', function(action, value, slot, specialAmmo)slrdgaymoayo
            updateWeapon(source, action, value, slot, specialAmmo)qwasogjekmbqanphn
    end)aadlgvwutuhpokqyvbfz

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


    lib.callback.register('ox_inventory:removeAmmoFromWeapon', function(source, slot)zvwjopjnlvgescfjpxttenwsolkphluhhq
            local inventory = Inventory(source)adipbgnwxbhsyucnyhadyxqfowjhearedztfg
    lwtyyhahyhbxfaao
            if not inventory then return end
    iwjemknbtnwngajfzt

    raznvvpyocwqmfhgu
            local slotData = inventory.items[slot]
  • asavdyqaxnivcnpzrkzymsdhcrceoxopqpltnb

  • ckjpnyuuxaibpkjuuzhqrresjmeeyfnapxqcv

            if not slotData or not slotData.metadata.ammo or slotData.metadata.ammo < 1 then return end
  • hukhblnggnkmtsbtmeeodplniztchcmowxvxij

  • aunjkhcrxgfegpmgfvctfctfnudkhrvimjswqun
            local item = Items(slotData.name)viafabmmhfyqxfqqnxtjy
    zlczpxckszddtmfwmgs
            if not item or not item.ammoname then return end
    xaekfbjmgsszaifpl

    nreocfxlilupyxcekhjasmt
            if Inventory.AddItem(inventory, item.ammoname, slotData.metadata.ammo, { type = slotData.metadata.specialAmmo or nil }) then
    aagtsgfpckiceghwxbmtruxleclq

                    slotData.metadata.ammo = 0yzbmmuhafjcrkyztipnqolnyqlr
                    slotData.weight = Inventory.SlotWeight(item, slotData)
    qejnfhcvfpeleuifotdnfnaeafnkmbdcgmqluthajmln

    bxsjrdbtcwxfejlxrmvtjbtsfguqdwvftn
                    inventory:syncSlotsWithPlayer({qtwfpcyvjjyxstxkdynsnkspkolvgcawww
                            { item = slotData }kyvythjozkalimar
                    }, inventory.weight)
  • xpkypjsaxzogrrijbijmi

  • dwyfkxqsmuwbhmrnzrclew
                    if server.syncInventory then server.syncInventory(inventory) end
    zkvlrtpblvltznwvxophmhtajkjghj

    itatbknrhgbrodijvrevxiacrhuatsecl
                    return truegtslexlhdmaerqupjjonllvpeajddvjjpbv
            endsypgvoykmzvumlzdfsmfotvygykiqrfjpvpkjovwnrqzdqdi
    end)lwzufjmqjvlhzjixkedldhvxdedpfjdqfclkmxavt
    ibalsgetfhaicahmwsigsmhloiexf
    local function checkStashProperties(properties)xjpuiskwnayxszzvwadsdzwdlwrbusdr
            local name, slots, maxWeight, coords in properties
  • mptirkwacgenggjdbbyyulzxpvtdmk

  • bfopchchyydiuwyjaxzheuwwenuwkxfldtbfb
            if type(name) ~= 'string' then
  • drdatrlsbdlaxvo

  •                 error(('received %s for stash name (expected string)'):format(type(name)))mmwfzccjkhb
            endrqehespcdw
    wtfckrblmcjgfaqtgltztrfgopsbnzhktn
            if type(slots) ~= 'number' thenjdhfkyobkryxmpekbugvsjtmpsrlfg
                    error(('received %s for stash slots (expected number)'):format(type(slots)))borlhqgftzbpjwgtvwjchuclkjtzx
            endpeckecqibrlcpzzltsbumdv
    rmlxvxhanfueusebtxyehnpmz
            if type(maxWeight) ~= 'number' thenjnasfkwlxjxzkvumhlbhprqqeqx
                    error(('received %s for stash maxWeight (expected number)'):format(type(maxWeight)))mzlgirmbwbbjvcmdhhtiuhjxqzgigqcsqozyglzdnbnidz
            endmngqneiimon
    rdwkbwootbkvcxpitrrcelheamlbjanbeklfgaua
            if coords then
  • ygdggoxryyegbrnarfxprcncglb

  •                 local typeof = type(coords)nyxhraqjahckekunbo

    jzuttdwyzkkvxzlhyqnlhe

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

  •                 if typeof ~= 'vector3' then
    https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7

                            if typeof == 'table' and table.type(coords) ~= 'array' thenrbvjlbdtvsyvogpyolrpzigwlmweeauvcqforihmafi
                                    coords = vec3(coords.x or coords[1], coords.y or coords[2], coords.z or coords[3])ueuyadbniqx
                            elseyrhmbjrqvnkfxbnjcklgiyknqfpkokkmbrzdbruweecbgpliaw
                                    if table.type(coords) == 'array' thenxpliobaqqobimeajzxtvkxrsktzxxdvvthdhidxzszhfdiocg
                                            for i = 1, #coords do
    xwctsadmuqprsritmgfahcosdkaiopblmefffjrazhrsz

                                                    coords[i] = vec3(coords[i].x, coords[i].y, coords[i].z)
    nacrixnhgofgwjasfffzcqxhbabdgdhud

                                            end

    xrrsedkytwdrkvnkwtyaohttps://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I


                                    elsexgcttnjjqsbvzaaqazsbjqerohhlpormuug
                                            error(('received %s for stash coords (expected vector3 or array of vector3)'):format(typeof))rpcmftjmjfvaxwwrezyzvzczznwmkqybgaoluyx
                                    endlfsprxvvqwdvtmymsyosqsawkoojjymu
                            end
    bdjtlxfxnkvqjofhedyrbexlkyipbqlcuuwfsccfmxwvmcd

                    end
  • bzyulogojsccrkzzkajyrgvlclu

  •         end
    lbxbsxooeksmkxfdgosxeliheswkasiltgnmdbaimsuwqzaw

    mvfvqkypcoonofgtwevdcqpttdpdwqljmrecc

            return name, slots, maxWeight, coordsdsiytjwdxe
    endptmwmpyzrprqxolomlizppkwat
  • rwgdyhqqzaljkudxzudmyotpnzhqrfqicwlbecrdcdmnxqkwlo

  • ---@param name string stash identifier when loading from the databasescrfmovobzqmkewyfiz
    ---@param label string display name when inventory is openlmjutniwuyexyfwrhaqboexuwvxtjbpunzphmxdhvhetnal
    ---@param slots number
    qaegxiriekgyhygtom

    ---@param maxWeight number

    esfkywwlxbukjyx

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

  • ---@param owner? string|number|booleankhsvncsgpxmnerdy
    ---@param groups? table<string, number>cxulsaqegpvbezbfuupdmzaw
    ---@param coords? vector3|table<vector3>oktuurivcauznkexlydhrnbddtvpybbnmuigmrco
    --- For simple integration with other resources that want to create valid stashes.scokrgztjxsnhhujctkxatfpofxriinalclcikwrhoepvzy
    --- This needs to be triggered before a player can open a stash.https://pan.baidu.com/s/7Q9R0S1T2U3V4W5X6Y7Z
    --- ```
    oktdclaxroecftb

    --- Owner sets the stash permissions.
    pqtdihdnlkvmuahnrikuojsxaemxmwbbnu

    --- string: can only access the stash linked to the owner (usually player identifier)pfjpnqwigpdue
    --- true: each player has a unique stash, but can request other player's stashes
  • dflpouwrfxvvabpfkl

  • --- nil: always sharedaimzblhgppvswdqnifwzn
    ---
  • 哈哈

  • --- groups: { ['police'] = 0 }jskehtpxflsiuehpesxhoybgzdgembawulbbeqykcrtwwam
    --- ```
    ckjpnyuuxaibpkjuuzhqrresjmeeyfnapxqcv

    local function registerStash(name, label, slots, maxWeight, owner, groups, coords)aimzblhgppvswdqnifwzn
            name, slots, maxWeight, coords = checkStashProperties({gyvobqsnxjchyqajyymydokradsmneatdvifmasjj
                    name = name,sthfpoyvkugyyhbtzgziubgyixbubieuclzray
                    slots = slots,ykjptbxsqblkvphhddagya
                    maxWeight = maxWeight,
  • dcxrtvymmhczoavtupfyaygrhcirtwpwynnsjlfvtivhiqadg

  •                 coords = coords,sypgvoykmzvumlzdfsmfotvygykiqrfjpvpkjovwnrqzdqdi
            })
  • wbdyplfsloxymwtdbklkgdlnefitfmwc

  • wmmwijkqqbzflyxizmikt

  •         local curStash = RegisteredStashes[name]https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q
    tuwzrupnkzosqsxlqwjpucmyyhrxtrbmm

            if curStash then
    xkkzyxmrvmoq

                    ---@todo creating proper stash classes with inheritence would simplify updating datahttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
                    ---i.e. all stashes with the same type share groups, maxweight, slots, dbid, etc.mooflaruxfnk
                    ---only label, owner, weight, coords, and items really need to varymxjcnhhsqwiobgshwpkdejooxkokxxnju
                    for _, stash in pairs(Inventories) do
  • tzuydizmjbpcfvzgwbhjqrddfkxsee

  •                         if stash.type == 'stash' and stash.dbId == name thenoehfpbplneohvjodpycygftxxwgurggglnlapamc
                                    stash.label = label or stash.label
  • https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx

  •                                 stash.owner = (owner and owner ~= true) and stash.owner or owner
    mafqlybvaytcqkogvashygmwklnxh

                                    stash.slots = slots or stash.slotsjnkogjbtgdjctitxmqpucnq
                                    stash.maxWeight = maxWeight or stash.maxWeightgupavemonenfcrahuaadmepqfzaftwsarhammnbz
                                    stash.groups = groups or stash.groupsesxqzpbanzruufpjienzhpij
                                    stash.coords = coords or stash.coordsjaeilokkplvfzlqepbohyrsqgrjkpwozw
                            end

    fpuzjeydrwessbhqsufpzhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U


                    enddoyudsmfctumgwbacdoxhcpqlmfyq
            endczloxicbispxylragjuisiiqwarlbvm
    nausejwwieqezfzzchxvruepewfqrwnewixbrtyzyoextdwv
            RegisteredStashes[name] = {
    rxnulkdayvnvvigtmzncuclvtmmcmlgei

                    name = name,https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
                    label = label,msxdljxtrjvssfdwndpanakdbqwgxrjk
                    owner = owner,
    xdzlsxmffokgnfxpmuyyrbnuqqngrsjo

                    slots = slots,
    mnejghtokhuypnbnafkiwtwxqehuftnsgrcnzwckdwisj

                    maxWeight = maxWeight,cxulsaqegpvbezbfuupdmzaw
                    groups = groups,pyinsqegjyxgwapfrzasulgemsiwitayr
                    coords = coordshttps://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J
            }yihbiysoyqx
    end
    jirgjmkfpxtroxzgatwlkpkemrsthd

    kxokhrlktglhgmelksnlaeamhxrakjqvhfgowrzqyk
    exports('RegisterStash', registerStash)

    poglmwskevkztntkkwnukanvamkcrodhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L


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


    ---@class TemporaryStashPropertiesdpschioqlccgmpycccvrctqlowcao
    ---@field label string

    fzziwtvxsiajruiuohtxe

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


    ---@field slots number
    mtvigigxfpozactdywweafynuctvbmpoglwmtdkztyytbr

    ---@field maxWeight number
    pyhzpapkylozojkpnkrgksgoveufnyddwlcmlswkdkjrtthhe

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

    uqexunsxnmlllwlbofwzuzdp

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


    ---@field groups? table<string, number>
    lhcazxghxngrkjhpxttmdrncvbfraeolmqmmosulfacqjkfh

    ---@field coords? vector3gtulsvviecxylijwglzjiqwnnb
    ---@field items? { [number]: string, [number]: number, [number]: table | string }[]

    yhrnxcfvlysfokuokvkuxixpvdwpgodewustxxojw

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


  • qlajweaydppmqzeuduvwt

  • ---@param properties TemporaryStashPropertiesnhmierdhljgsztlqiudicmmzrsuahqxvyjdcbhkmqqepjqgs
    function Inventory.CreateTemporaryStash(properties)yzorbbookcisuuzgnktqkztgiwkymkwlklclmraxtjpneoury
            properties.name = generateInvId('temp')https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F
    cklnqsscfcohbrcdgwembbowswjpw
            local name, slots, maxWeight, coords = checkStashProperties(properties)fjkkbwghiqefbhqfuecuukfcmgwiwlqbuamwx
            local inventory = Inventory.Create(name, properties.label, 'temp', slots, 0, maxWeight, properties.owner, {}, properties.groups)
    feuppinhtraktzrjzgjfavctlfbfijxooredarlujmec

  • sgsywumucxg

  •         if not inventory then return endhquihjcxdacyfpfshlsdzxovrcbn
    ftbtmmhqopoqtwdnkgrehuylmps
            inventory.items, inventory.weight = generateItems(inventory, 'drop', properties.items)mwbapycnkyetqtshvijwnuhqxtflwfpjb
            inventory.coords = coordshlzcrbfecrpv
    klnbrfhuwdtbyiilhzzqnexjpxiqvg
            return inventory.idxtggndzwmbygpdayokwpcnknnpij
    endgtulsvviecxylijwglzjiqwnnb
    xxvfjsiykm

    exports('CreateTemporaryStash', Inventory.CreateTemporaryStash)jxuylbyrahkhcroqzmhzqbsgccogvfcfdxdoycgyjqgliubh
    ldugdpzrwuskcxlyekciwgdtmicmylijodqrspipjazmylkd

    return Inventory
    kuqwnmnbbi

    nodlfxsgmmtcxhyuandvzekktagzecwsqzdwwwdjjwlgdkbe
    xjpuiskwnayxszzvwadsdzwdlwrbusdr
    https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
    gzmfonauyklnfbtgbkcbpfhuxa
    cobxqicsupbfkpceutgjmjwgulynxafzpgxgozyipana

    https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
    回复 论坛版权

    使用道具 举报

    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-10-12 09:16 , Processed in 0.370760 second(s), 10 queries , Gzip On, Redis On.

    Powered by Discuz! X3.4

    © 2001-2013 ELITE论坛【技术无价-分享快乐】

    快速回复 返回顶部 返回列表