Files

1 line
4.1 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4960],{9613:function(e,n,t){t.d(n,{Zo:function(){return s},kt:function(){return v}});var r=t(9496);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var u=r.createContext({}),l=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},s=function(e){var n=l(e.components);return r.createElement(u.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},f=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,i=e.originalType,u=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),f=l(t),v=o,y=f["".concat(u,".").concat(v)]||f[v]||p[v]||i;return t?r.createElement(y,a(a({ref:n},s),{},{components:t})):r.createElement(y,a({ref:n},s))}));function v(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var i=t.length,a=new Array(i);a[0]=f;var c={};for(var u in n)hasOwnProperty.call(n,u)&&(c[u]=n[u]);c.originalType=e,c.mdxType="string"==typeof e?e:o,a[1]=c;for(var l=2;l<i;l++)a[l]=t[l];return r.createElement.apply(null,a)}return r.createElement.apply(null,t)}f.displayName="MDXCreateElement"},5684:function(e,n,t){t.r(n),t.d(n,{assets:function(){return s},contentTitle:function(){return u},default:function(){return v},frontMatter:function(){return c},metadata:function(){return l},toc:function(){return p}});var r=t(5443),o=t(3010),i=(t(9496),t(9613)),a=["components"],c={},u=void 0,l={unversionedId:"ox_inventory/Functions/Server/Inventory/Search",id:"ox_inventory/Functions/Server/Inventory/Search",title:"Search",description:"Searches an inventory for a specified item.",source:"@site/docs/ox_inventory/Functions/Server/Inventory/Search.md",sourceDirName:"ox_inventory/Functions/Server/Inventory",slug:"/ox_inventory/Functions/Server/Inventory/Search",permalink:"/docs/ox_inventory/Functions/Server/Inventory/Search",draft:!1,editUrl:"https://github.com/overextended/overextended.github.io/tree/main/docs/ox_inventory/Functions/Server/Inventory/Search.md",tags:[],version:"current",lastUpdatedAt:1656578803,formattedLastUpdatedAt:"6/30/2022",frontMatter:{},sidebar:"ox_inventory",previous:{title:"ReturnInventory",permalink:"/docs/ox_inventory/Functions/Server/Inventory/ReturnInventory"},next:{title:"SetDurability",permalink:"/docs/ox_inventory/Functions/Server/Inventory/SetDurability"}},s={},p=[],f={toc:p};function v(e){var n=e.components,t=(0,o.Z)(e,a);return(0,i.kt)("wrapper",(0,r.Z)({},f,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"Searches an inventory for a specified item."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua"},"-- inv: string or number\n-- search: string\n-- item: table or string\n-- metadata: table or string (optional)\nexports.ox_inventory:Search(inv, search, item, metadata)\n")),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"search")," can be either ",(0,i.kt)("inlineCode",{parentName:"p"},"'slots'")," or ",(0,i.kt)("inlineCode",{parentName:"p"},"'count'"),", where slots will return a table of data\nand count will return the found amount of the specified item."))}v.isMDXComponent=!0}}]);