mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
24 lines
19 KiB
HTML
24 lines
19 KiB
HTML
<!doctype html>
|
|
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-ox_lib/index">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<meta name="generator" content="Docusaurus v2.0.0-beta.21">
|
|
<link rel="search" type="application/opensearchdescription+xml" title="Overextended" href="/opensearch.xml"><title data-rh="true">Getting Started | Overextended</title><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://overextended.github.io/docs/ox_lib/"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Getting Started | Overextended"><meta data-rh="true" name="description" content="ox_lib is a collection of Lua and UI functions to utilise in other resources."><meta data-rh="true" property="og:description" content="ox_lib is a collection of Lua and UI functions to utilise in other resources."><link data-rh="true" rel="icon" href="/img/ox.ico"><link data-rh="true" rel="canonical" href="https://overextended.github.io/docs/ox_lib/"><link data-rh="true" rel="alternate" href="https://overextended.github.io/docs/ox_lib/" hreflang="en"><link data-rh="true" rel="alternate" href="https://overextended.github.io/docs/ox_lib/" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://8XXXVNJ7UW-dsn.algolia.net" crossorigin="anonymous"><link rel="stylesheet" href="/assets/css/styles.a1a96c58.css">
|
|
<link rel="preload" href="/assets/js/runtime~main.47bcd1df.js" as="script">
|
|
<link rel="preload" href="/assets/js/main.a0ba4931.js" as="script">
|
|
</head>
|
|
<body class="navigation-with-keyboard">
|
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus">
|
|
<div role="region"><a href="#" class="skipToContent_AAs2">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle clean-btn" type="button" tabindex="0"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/ox_64.png" alt="Ox Logo" class="themedImage_TGiV themedImage--light_hEfu" height="32" width="32"><img src="/img/ox_64.png" alt="Ox Logo" class="themedImage_TGiV themedImage--dark_IVBJ" height="32" width="32"></div><b class="navbar__title text--truncate">Overextended</b></a><a href="https://www.github.com/overextended" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_HzUF"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://www.discord.gg/overextended" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_HzUF"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></div><div class="navbar__items navbar__items--right"><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/">Documentation</a><div class="searchBox_q3Mz"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div class="main-wrapper docsWrapper_HXQ2"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_AGDJ" type="button"></button><div class="docPage_UwMY"><aside class="theme-doc-sidebar-container docSidebarContainer_lBIm"><div class="sidebar_R2ge"><nav class="menu thin-scrollbar menu_nyNM"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/">Documentation</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/category/core">Core</a><button aria-label="Toggle the collapsible sidebar category 'Core'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/oxmysql/">MySQL</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/docs/ox_lib/">Library</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/ox_lib/">Getting Started</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/ACL/Server">ACL</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/AddCommand/Server">AddCommand</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Cache/Client">Cache</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Callback/Client">Callback</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/DisableControls/Client">DisableControls</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Interface/Client/alert">Interface</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Locale/Shared">Locale</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Logger/Server">Logger</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Points/Client">Points</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Streaming/Client">Streaming</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/VehicleProperties/Client">VehicleProperties</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Version/Server">Version</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/ox_lib/Zones/Client">Zones</a></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/ox_inventory/">Inventory</a></div></li></ul></nav></div></aside><main class="docMainContainer_ZqYE"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_MuR7"><div class="docItemContainer_LiKe"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_LqIV" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_qK7i"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Library</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Getting Started</span><meta itemprop="position" content="2"></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Getting Started</h1></header><p>ox_lib is a collection of Lua and UI functions to utilise in other resources.</p><p>The UI is built in React so the code needs to be compiled into standard JS.<br>
|
|
<!-- -->If you don't know how to do this then please download the <a href="https://github.com/overextended/ox_lib/releases/latest" target="_blank" rel="noopener noreferrer">release</a> (ox_lib.zip) which is <em>already</em> compiled into a working resource.</p><p>To enable the library inside of your resource just add <code>@ox_lib/init.lua</code> to <code>shared_scripts</code> or
|
|
a <code>shared_script</code> in your <code>fxmanifest.lua</code> file.</p><div class="language-lua codeBlockContainer_EKBf theme-code-block" style="--prism-background-color:#282c34;--prism-color:#ffffff"><div class="codeBlockContent_Qziw"><pre tabindex="0" class="prism-code language-lua codeBlock_zQxa thin-scrollbar"><code class="codeBlockLines_MubF"><span class="token-line" style="color:#ffffff"><span class="token function" style="color:#79b6f2">shared_scripts</span><span class="token plain"> </span><span class="token punctuation" style="color:#8dc891">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#ffffff"><span class="token plain"> </span><span class="token string" style="color:#8dc891">'@ox_lib/init.lua'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#ffffff"><span class="token plain"></span><span class="token punctuation" style="color:#8dc891">}</span><br></span></code></pre><div class="buttonGroup_gNTg"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_P8xP" aria-hidden="true"><svg class="copyButtonIcon_mBIP" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_MK8B" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Or if the library is the only shared script you use you can do:</p><div class="language-lua codeBlockContainer_EKBf theme-code-block" style="--prism-background-color:#282c34;--prism-color:#ffffff"><div class="codeBlockContent_Qziw"><pre tabindex="0" class="prism-code language-lua codeBlock_zQxa thin-scrollbar"><code class="codeBlockLines_MubF"><span class="token-line" style="color:#ffffff"><span class="token plain">shared_script </span><span class="token string" style="color:#8dc891">'@ox_lib/init.lua'</span><br></span></code></pre><div class="buttonGroup_gNTg"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_P8xP" aria-hidden="true"><svg class="copyButtonIcon_mBIP" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_MK8B" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>That's it!<br>
|
|
<!-- -->You can now use the library functions inside of your resource, check the rest of the
|
|
documentation to see how to utilise them.</p><h1>Building the UI</h1><p>If you wish to edit any of the UI elements you will need to download the <em>source</em> code, edit what you need and then
|
|
compile it.</p><div class="admonition admonition-danger alert alert--danger"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>danger</h5></div><div class="admonition-content"><p><strong>DO NOT</strong> debundle and unminify the release CSS and JS files to edit them.</p></div></div><p><strong>Requirements:</strong></p><ul><li><a href="https://nodejs.org/" target="_blank" rel="noopener noreferrer">Node.js (LTS)</a></li><li>pnpm</li></ul><p><strong>Installing Node.js:</strong></p><ul><li>Download the LTS version of Node.js.</li><li>Go through the install and make sure you install all of the features.</li><li>Run node --version in cmd and make sure that it gives you the version number. If it doesn't then you didn't install it correctly.</li></ul><p><strong>Installing pnpm:</strong></p><ul><li>After installing NodeJS you can install pnpm by running <code>npm install -g pnpm</code>.</li></ul><p><strong>Building the UI:</strong></p><ul><li>cd into the web directory.</li><li>run <code>pnpm i</code> to install the dependencies.</li><li>run <code>pnpm build</code> to build the source files.</li></ul><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Hot reloads</h5></div><div class="admonition-content"><p>When working in the browser you can run <code>pnpm start</code>, which supports hot reloads meaning that
|
|
you will see your changes after saving your file.</p><p>If you want to work in game you can run <code>pnpm start:game</code> which writes changes to disk, so
|
|
the only thing you have to do is restart the resource for it take affect.</p></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/overextended/overextended.github.io/tree/main/docs/ox_lib/index.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_YzTo" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_xdYa"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/oxmysql/Usage/update"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Update</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/ox_lib/ACL/Server"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Server</div></a></nav></div></div></div></div></main></div></div></div>
|
|
<script src="/assets/js/runtime~main.47bcd1df.js"></script>
|
|
<script src="/assets/js/main.a0ba4931.js"></script>
|
|
</body>
|
|
</html> |