Files
overextended.github.io/docs/ox_core/Getting Started/imports.md
T
2022-07-14 15:07:31 +10:00

1.2 KiB

Importing the core functions

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import IconButton from '@site/src/components/IconButton'; import { FaNpm } from 'react-icons/fa';

Lua

Lua imports can be defined as part of fxmanifest, or loaded with the load function.

client_scripts {
	'@ox_core/imports/client.lua',
	'client/main.lua',
}

server_scripts {
	'@oxmysql/lib/MySQL.lua',
	'@ox_core/imports/server.lua',
	'server/main.lua',
}
local file = ('imports/%s.lua'):format(IsDuplicityVersion() and 'server' or 'client')
local import = LoadResourceFile('ox_core', file)
local chunk = assert(load(import, ('@@ox_core/%s'):format(file)))
chunk()

JS/TS

If in case you want to write resources in JS/TS you will need to install our node client and server wrapper package, which will allow you to use the core's functions with full type and intellisense support.

}>Package