mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
double space for line break
This commit is contained in:
1 parent
724c7e356d
commit
2b549c3d06
27 files changed
+63
-84
No files matched your search
@@ -1,4 +1,4 @@
|
||||
Wrapper around the built-in ACL system. Handles lib.addCommand and ox_groups permissions.
|
||||
Wrapper around the built-in ACL system. Handles lib.addCommand and ox_groups permissions.
|
||||
Refer to [Basic Aces & Principals overview/guide](https://forum.cfx.re/t/basic-aces-principals-overview-guide/90917) for more information.
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Caches data related to the player and handling some events or statebags.
|
||||
Caches data related to the player and handling some events or statebags.
|
||||
An interval runs every 100ms to update data that cannot be checked via handlers.
|
||||
|
||||
## States
|
||||
|
||||
@@ -5,7 +5,7 @@ title: Alert Dialog
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Simple alert dialog that can display a message to the player.
|
||||
Simple alert dialog that can display a message to the player.
|
||||
Returns whether the player pressed the confirm button or canceled the dialog.
|
||||
|
||||
### lib.alertDialog
|
||||
|
||||
@@ -77,10 +77,8 @@ lib.registerContext(context)
|
||||
You can register as many context menus in one `lib.registerContext` function
|
||||
as you'd like.
|
||||
|
||||
The menu can be either in the order you write it in, or sorted alphabetically.
|
||||
To sort the menu alphabetically the buttons (and/or metadata) need to be defined as keys,
|
||||
otherwise not using keys and instead using tables will make the menu be in the order you
|
||||
define it as.
|
||||
The menu can be either in the order you write it in, or sorted alphabetically.
|
||||
To sort the menu alphabetically the buttons (and/or metadata) need to be defined as keys, otherwise not using keys and instead using tables will make the menu be in the order you define it as.
|
||||
|
||||
### lib.showContext
|
||||
|
||||
@@ -283,8 +281,7 @@ RegisterCommand('testcontext', () => {
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
To trigger the event from the `Event button` and get it's data we first
|
||||
need to register the event properly:
|
||||
To trigger the event from the `Event button` and get it's data we first need to register the event properly:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value='Lua'>
|
||||
@@ -337,19 +334,15 @@ onNet('some_event', () => {
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The data from the `args` table in the menu is passed as a first argument to
|
||||
the event you register, in this case that argument is called `data`.
|
||||
The data from the `args` table in the menu is passed as a first argument to the event you register, in this case that argument is called `data`.
|
||||
|
||||
Using this event we also register a new context menu with it's own options.
|
||||
|
||||
By defining a `menu` param to be the id of the first menu we can get the
|
||||
neat back arrow button next to the menu title that will take us back.
|
||||
By defining a `menu` param to be the id of the first menu we can get the neat back arrow button next to the menu title that will take us back.
|
||||
|
||||
If we have a button that does not define either event, serverEvent or menu
|
||||
the button will do nothing upon being clicked.
|
||||
If we have a button that does not define either event, serverEvent or menu the button will do nothing upon being clicked.
|
||||
|
||||
Of course just registering the event won't do much so we need to display it
|
||||
with the `lib.showContext` function, passing in the menu's id.
|
||||
Of course just registering the event won't do much so we need to display it with the `lib.showContext` function, passing in the menu's id.
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -58,21 +58,15 @@ lib.inputDialog(heading, rows)
|
||||
* step?: `number`
|
||||
* Amount of change per slider step. Used only with `'slider'` type.
|
||||
|
||||
The callback data is promise based meaning that the thread will
|
||||
not continue executing until the user either sends the data
|
||||
or exits the popup.
|
||||
The callback data is promise based meaning that the thread will not continue executing until the user either sends the data or exits the popup.
|
||||
|
||||
The data returned will be a table (array), indexes represent the rows
|
||||
sent to the dialog, so if we want data from the first field that
|
||||
would be index `1` (`0`), if we want data from the third field, that would
|
||||
be index `3` (`2`), etc...
|
||||
The data returned will be a table (array), indexes represent the rows sent to the dialog, so if we want data from the first field that would be index `1` (`0`), if we want data from the third field, that would be index `3` (`2`), etc...
|
||||
|
||||
The standard input rows will always return a string, if you want a row to be of
|
||||
number data type, you can use set the `type` to `number`.
|
||||
The standard input rows will always return a string, if you want a row to be of number data type, you can use set the `type` to `number`.
|
||||
|
||||
If a user left an input field empty it will return `nil`.
|
||||
|
||||
You can also add checkboxes that will return `true` if checked and `nil` if unchecked.
|
||||
You can also add checkboxes that will return `true` if checked and `nil` if unchecked.
|
||||
Look at the *Advanced* example for it's usage.
|
||||
|
||||
:::caution
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Allows servers to set a preferred language and attempt to load locale files in any resources using the module.
|
||||
Allows servers to set a preferred language and attempt to load locale files in any resources using the module.
|
||||
Locale files should use the [ISO Language Code](http://www.lingoes.net/en/translator/langcode.htm) and be saved as `./locales/langcode.json`
|
||||
|
||||
To change the preferred language from English, add the convar to your server.cfg
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Submit logs to Datadog
|
||||
|
||||
Register an account with [datadog](https://www.datadoghq.com/). Once registered you need to create an [API key](https://app.datadoghq.com/organization-settings/api-keys).
|
||||
Register an account with [datadog](https://www.datadoghq.com/). Once registered you need to create an [API key](https://app.datadoghq.com/organization-settings/api-keys).
|
||||
Modify your `server.cfg` with the newly generated API key and [intake server](https://docs.datadoghq.com/api/latest/logs/#send-logs).
|
||||
|
||||
- datadoghq.com
|
||||
@@ -22,8 +22,8 @@ lib.logger(source, event, message, ...)
|
||||
- message: `string`
|
||||
- ...: `string`
|
||||
|
||||
Source is passed to `ddsource` and creates a tag. Could be playerId, identifier, -1, or server.
|
||||
Event is passed to `ddservice` and displays in the logs list.
|
||||
Source is passed to `ddsource` and creates a tag. Could be playerId, identifier, -1, or server.
|
||||
Event is passed to `ddservice` and displays in the logs list.
|
||||
Additional arguments are converted into tags for additional filtering and search options.
|
||||
|
||||
```lua
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Check if assets exist, such as models, and loads them into memory.
|
||||
Check if assets exist, such as models, and loads them into memory.
|
||||
Throws errors for invalid assets and returns true if the asset is loaded.
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Mostly follows the format used by ESX and QBCore, with extra data such as damaged/missing props.
|
||||
Mostly follows the format used by ESX and QBCore, with extra data such as damaged/missing props.
|
||||
https://github.com/overextended/ox_lib/blob/master/resource/vehicleProperties/client.lua#L5
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
|
||||
+8
-14
@@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem';
|
||||
|
||||
ox_lib is a collection of Lua and UI functions to utilise in other resources.
|
||||
|
||||
The UI is built in React so the code needs to be compiled into standard JS.
|
||||
The UI is built in React so the code needs to be compiled into standard JS.
|
||||
If you don't know how to do this then please download the [release](https://github.com/overextended/ox_lib/releases/latest) (ox_lib.zip) which is *already* compiled into a working resource.
|
||||
|
||||
<Tabs>
|
||||
@@ -40,9 +40,8 @@ All supported functions are located inside the `resource` folder in the lib.
|
||||
|
||||
You can get the npm package [here](https://npmjs.com/package/@overextended/ox_lib).
|
||||
|
||||
**Usage:**
|
||||
You can either import the whole library object which contains all the functions for that scope (client/server/shared) or
|
||||
you can deconstruct it and import the functions you find needed at the time.
|
||||
**Usage:**
|
||||
You can either import the whole library object which contains all the functions for that scope (client/server/shared) or you can deconstruct it and import the functions you find needed at the time.
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/server'
|
||||
@@ -64,17 +63,13 @@ add_ace resource.ox_lib command.add_principal allow
|
||||
add_ace resource.ox_lib command.remove_principal allow
|
||||
```
|
||||
|
||||
That's it!
|
||||
You can now use the library functions inside of your resource, check the rest of the
|
||||
documentation to see how to utilise them.
|
||||
That's it!
|
||||
You can now use the library functions inside of your resource, check the rest of the documentation to see how to utilise them.
|
||||
|
||||
## Using icons for interface functions
|
||||
|
||||
The icon library used is Font Awesome 6.0, if for the icon you define only a string
|
||||
the default icon type will be `solid`.
|
||||
If you want to use a different icon type, i.e
|
||||
apple as a brand, you need to define icon as a table (`array`) with the first value being
|
||||
the icon type (`fas`, `far`, `fab`) as a string, and the second being the icon name.
|
||||
The icon library used is Font Awesome 6.0, if for the icon you define only a string the default icon type will be `solid`.
|
||||
If you want to use a different icon type, i.e apple as a brand, you need to define icon as a table (`array`) with the first value being the icon type (`fas`, `far`, `fab`) as a string, and the second being the icon name.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value='Lua'>
|
||||
@@ -95,8 +90,7 @@ icon: ['fab', 'apple']
|
||||
|
||||
## Building the UI
|
||||
|
||||
If you wish to edit any of the UI elements you will need to download the *source* code, edit what you need and then
|
||||
compile it.
|
||||
If you wish to edit any of the UI elements you will need to download the *source* code, edit what you need and then compile it.
|
||||
|
||||
:::danger
|
||||
|
||||
|
||||
Reference in new issue
Block a user