mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 14:38:50 +00:00
1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1852],{9613:function(e,t,r){r.d(t,{Zo:function(){return u},kt:function(){return v}});var n=r(9496);function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,l=function(e,t){if(null==e)return{};var r,n,l={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}var i=n.createContext({}),s=function(e){var t=n.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},u=function(e){var t=s(e.components);return n.createElement(i.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},p=n.forwardRef((function(e,t){var r=e.components,l=e.mdxType,o=e.originalType,i=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=s(r),v=l,h=p["".concat(i,".").concat(v)]||p[v]||d[v]||o;return r?n.createElement(h,a(a({ref:t},u),{},{components:r})):n.createElement(h,a({ref:t},u))}));function v(e,t){var r=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var o=r.length,a=new Array(o);a[0]=p;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c.mdxType="string"==typeof e?e:l,a[1]=c;for(var s=2;s<o;s++)a[s]=r[s];return n.createElement.apply(null,a)}return n.createElement.apply(null,r)}p.displayName="MDXCreateElement"},4449:function(e,t,r){r.r(t),r.d(t,{assets:function(){return u},contentTitle:function(){return i},default:function(){return v},frontMatter:function(){return c},metadata:function(){return s},toc:function(){return d}});var n=r(5443),l=r(3010),o=(r(9496),r(9613)),a=["components"],c={title:"Methods"},i=void 0,s={unversionedId:"ox_core/Vehicle/Server/methods",id:"ox_core/Vehicle/Server/methods",title:"Methods",description:"These functions are inherited by instances of CVehicle.",source:"@site/docs/ox_core/Vehicle/Server/methods.md",sourceDirName:"ox_core/Vehicle/Server",slug:"/ox_core/Vehicle/Server/methods",permalink:"/docs/ox_core/Vehicle/Server/methods",draft:!1,editUrl:"https://github.com/overextended/overextended.github.io/tree/main/docs/ox_core/Vehicle/Server/methods.md",tags:[],version:"current",frontMatter:{title:"Methods"},sidebar:"docs",previous:{title:"Server",permalink:"/docs/ox_core/Vehicle/Server/"},next:{title:"Getting Started",permalink:"/docs/oxmysql/"}},u={},d=[{value:"vehicle.set",id:"vehicleset",level:2},{value:"vehicle.get",id:"vehicleget",level:2},{value:"vehicle.getCoords",id:"vehiclegetcoords",level:2},{value:"vehicle.delete",id:"vehicledelete",level:2},{value:"vehicle.store",id:"vehiclestore",level:2}],p={toc:d};function v(e){var t=e.components,r=(0,l.Z)(e,a);return(0,o.kt)("wrapper",(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"These functions are inherited by instances of CVehicle."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-lua"},"local vehicle = Ox.GetVehicle(entity)\n")),(0,o.kt)("h2",{id:"vehicleset"},"vehicle.set"),(0,o.kt)("p",null,"Sets the vehicle's metadata for key to the given value."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-lua"},"local key, value = 'vin', '1HGBH41JXMN109186'\nvehicle.set(key, value)\n")),(0,o.kt)("h2",{id:"vehicleget"},"vehicle.get"),(0,o.kt)("p",null,"Return the vehicle's metadata. Sending an argument will retrieve a specific metadata key."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-lua"},"local data = vehicle.get()\nlocal vin = vehicle.get('vin')\n")),(0,o.kt)("h2",{id:"vehiclegetcoords"},"vehicle.getCoords"),(0,o.kt)("p",null,"Return the vehicle's world position. The value will be cached for future calls, so send true for the first argument to update it."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-lua"},"local coords = vehicle.getCoords(update)\n")),(0,o.kt)("h2",{id:"vehicledelete"},"vehicle.delete"),(0,o.kt)("p",null,"Remove the vehicle from the database and despawns the entity."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-lua"},"vehicle.delete()\n")),(0,o.kt)("h2",{id:"vehiclestore"},"vehicle.store"),(0,o.kt)("p",null,"Save the vehicle to the database and despawns the entity."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-lua"},"local store = 'garagea'\nvehicle.store(store)\n")))}v.isMDXComponent=!0}}]); |