mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
refactor: Add h1 headers to all pages missing it (#137)
* refactor: Add h1 headers to all pages missing it * refactor: missed example h3 * change hooks example heading to bold text --------- Co-authored-by: Luke <[email protected]>
This commit is contained in:
1 parent
74227cc262
commit
1d2c490b26
95 files changed
+2167
-2289
No files matched your search
@@ -5,134 +5,128 @@ title: Progress
|
||||
import { Tabs, Tab } from 'nextra-theme-docs';
|
||||
import { Callout } from 'nextra/components';
|
||||
|
||||
# Progress
|
||||
|
||||
## lib.progressBar
|
||||
|
||||
Displays a running progress bar.
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
lib.progressBar(data)
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
```lua
|
||||
lib.progressBar(data)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
lib.progressBar(data)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
lib.progressBar(data)
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
* duration: `number`
|
||||
* label: `string`
|
||||
* useWhileDead?: `boolean`
|
||||
* allowRagdoll?: `boolean`
|
||||
* allowCuffed?: `boolean`
|
||||
* allowFalling?: `boolean`
|
||||
* canCancel?: `boolean`
|
||||
* anim?: `table` (`object`)
|
||||
* dict?: `string`
|
||||
* Must specify either scenario or dict
|
||||
* clip: `string`
|
||||
* flag?: `number`
|
||||
* Default: `49`
|
||||
* blendIn?: `float`
|
||||
* Default: `3.0`
|
||||
* blendOut?: `float`
|
||||
* Default: `1.0`
|
||||
* duration?: `number`
|
||||
Default: `-1`
|
||||
* playbackRate?: `number`
|
||||
Default: `0`
|
||||
* lockX?: `boolean`
|
||||
* lockY?: `boolean`
|
||||
* lockZ?: `boolean`
|
||||
* scenario?: `string`
|
||||
* Must specify either scenario or dict
|
||||
* playEnter?: `boolean`
|
||||
* Default: `true`
|
||||
* prop?: `table` (`object` or `array`)
|
||||
* [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
|
||||
* model: `hash`
|
||||
* bone?: `number`
|
||||
* Default: `60309`
|
||||
* pos: `table`
|
||||
* x: `number`
|
||||
* y: `number`
|
||||
* z: `number`
|
||||
* rot: `table` (`object`)
|
||||
* x: `number`
|
||||
* y: `number`
|
||||
* z: `number`
|
||||
* disable?: `table` (`object`)
|
||||
* move?: `boolean`
|
||||
* car?: `boolean`
|
||||
* combat?: `boolean`
|
||||
* mouse?: `boolean`
|
||||
- duration: `number`
|
||||
- label: `string`
|
||||
- useWhileDead?: `boolean`
|
||||
- allowRagdoll?: `boolean`
|
||||
- allowCuffed?: `boolean`
|
||||
- allowFalling?: `boolean`
|
||||
- canCancel?: `boolean`
|
||||
- anim?: `table` (`object`)
|
||||
- dict?: `string`
|
||||
- Must specify either scenario or dict
|
||||
- clip: `string`
|
||||
- flag?: `number`
|
||||
- Default: `49`
|
||||
- blendIn?: `float`
|
||||
- Default: `3.0`
|
||||
- blendOut?: `float`
|
||||
- Default: `1.0`
|
||||
- duration?: `number`
|
||||
- Default: `-1`
|
||||
- playbackRate?: `number`
|
||||
- Default: `0`
|
||||
- lockX?: `boolean`
|
||||
- lockY?: `boolean`
|
||||
- lockZ?: `boolean`
|
||||
- scenario?: `string`
|
||||
- Must specify either scenario or dict
|
||||
- playEnter?: `boolean`
|
||||
- Default: `true`
|
||||
- prop?: `table` (`object` or `array`)
|
||||
- [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
|
||||
- model: `hash`
|
||||
- bone?: `number`
|
||||
- Default: `60309`
|
||||
- pos: `table`
|
||||
- x: `number`
|
||||
- y: `number`
|
||||
- z: `number`
|
||||
- rot: `table` (`object`)
|
||||
- x: `number`
|
||||
- y: `number`
|
||||
- z: `number`
|
||||
- disable?: `table` (`object`)
|
||||
- move?: `boolean`
|
||||
- car?: `boolean`
|
||||
- combat?: `boolean`
|
||||
- mouse?: `boolean`
|
||||
|
||||
### Usage Example
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
if lib.progressBar({
|
||||
duration = 2000,
|
||||
label = 'Drinking water',
|
||||
useWhileDead = false,
|
||||
canCancel = true,
|
||||
disable = {
|
||||
car = true,
|
||||
},
|
||||
anim = {
|
||||
dict = 'mp_player_intdrink',
|
||||
clip = 'loop_bottle'
|
||||
},
|
||||
prop = {
|
||||
model = `prop_ld_flow_bottle`,
|
||||
pos = vec3(0.03, 0.03, 0.02),
|
||||
rot = vec3(0.0, 0.0, -1.5)
|
||||
},
|
||||
}) then print('Do stuff when complete') else print('Do stuff when cancelled') end
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
<Callout>
|
||||
This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
|
||||
</Callout>
|
||||
|
||||
```lua
|
||||
if lib.progressBar({
|
||||
duration = 2000,
|
||||
label = 'Drinking water',
|
||||
useWhileDead = false,
|
||||
canCancel = true,
|
||||
disable = {
|
||||
car = true,
|
||||
},
|
||||
anim = {
|
||||
dict = 'mp_player_intdrink',
|
||||
clip = 'loop_bottle'
|
||||
},
|
||||
prop = {
|
||||
model = `prop_ld_flow_bottle`,
|
||||
pos = vec3(0.03, 0.03, 0.02),
|
||||
rot = vec3(0.0, 0.0, -1.5)
|
||||
},
|
||||
}) then print('Do stuff when complete') else print('Do stuff when cancelled') end
|
||||
```
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
<Callout>
|
||||
This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
|
||||
</Callout>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
if (await lib.progressBar({
|
||||
duration: 2000,
|
||||
label: 'Drinking water',
|
||||
useWhileDead: false,
|
||||
canCancel: true,
|
||||
disable: {
|
||||
car: true,
|
||||
},
|
||||
anim: {
|
||||
dict: 'mp_player_intdrink',
|
||||
clip: 'loop_bottle'
|
||||
},
|
||||
prop: {
|
||||
model: `prop_ld_flow_bottle`,
|
||||
pos: {x: 0.03, y: 0.03, z: 0.02},
|
||||
rot: {x: 0.0, y: 0.0, z: -1.5}
|
||||
},
|
||||
})) console.log('Do stuff when complete');
|
||||
else console.log('Do stuff when cancelled')
|
||||
```
|
||||
|
||||
</Tab>
|
||||
if (await lib.progressBar({
|
||||
duration: 2000,
|
||||
label: 'Drinking water',
|
||||
useWhileDead: false,
|
||||
canCancel: true,
|
||||
disable: {
|
||||
car: true,
|
||||
},
|
||||
anim: {
|
||||
dict: 'mp_player_intdrink',
|
||||
clip: 'loop_bottle'
|
||||
},
|
||||
prop: {
|
||||
model: `prop_ld_flow_bottle`,
|
||||
pos: {x: 0.03, y: 0.03, z: 0.02},
|
||||
rot: {x: 0.0, y: 0.0, z: -1.5}
|
||||
},
|
||||
})) console.log('Do stuff when complete');
|
||||
else console.log('Do stuff when cancelled')
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||

|
||||
@@ -142,131 +136,123 @@ else console.log('Do stuff when cancelled')
|
||||
Similar to `lib.progressBar` except it displays a circle and you can define a position.
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
lib.progressCircle(data)
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
```lua
|
||||
lib.progressCircle(data)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
lib.progressCircle(data)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
lib.progressCircle(data)
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
* duration: `number`
|
||||
* label?: `string`
|
||||
* position?: `'middle'` or `'bottom'`
|
||||
* Default: `'middle'`
|
||||
* useWhileDead?: `boolean`
|
||||
* allowRagdoll?: `boolean`
|
||||
* allowCuffed?: `boolean`
|
||||
* allowFalling?: `boolean`
|
||||
* canCancel?: `boolean`
|
||||
* anim?: `table` (`object`)
|
||||
* dict?: `string`
|
||||
* Must specify either scenario or dict
|
||||
* clip: `string`
|
||||
* flag?: `number`
|
||||
* Default: `49`
|
||||
* blendIn?: `float`
|
||||
* Default: `3.0`
|
||||
* blendOut?: `float`
|
||||
* Default: `1.0`
|
||||
* duration?: `number`
|
||||
Default: `-1`
|
||||
* playbackRate?: `number`
|
||||
Default: `0`
|
||||
* lockX?: `boolean`
|
||||
* lockY?: `boolean`
|
||||
* lockZ?: `boolean`
|
||||
* scenario?: `string`
|
||||
* Must specify either scenario or dict
|
||||
* playEnter?: `boolean`
|
||||
* Default: `true`
|
||||
* prop?: `table` (`object` or `array`)
|
||||
* [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
|
||||
* model: `hash`
|
||||
* bone?: `number`
|
||||
* Default: `60309`
|
||||
* pos: `table`
|
||||
* x: `number`
|
||||
* y: `number`
|
||||
* z: `number`
|
||||
* rot: `table` (`object`)
|
||||
* x: `number`
|
||||
* y: `number`
|
||||
* z: `number`
|
||||
* disable?: `table` (`object`)
|
||||
* move?: `boolean`
|
||||
* car?: `boolean`
|
||||
* combat?: `boolean`
|
||||
* mouse?: `boolean`
|
||||
- duration: `number`
|
||||
- label?: `string`
|
||||
- position?: `'middle'` or `'bottom'`
|
||||
- Default: `'middle'`
|
||||
- useWhileDead?: `boolean`
|
||||
- allowRagdoll?: `boolean`
|
||||
- allowCuffed?: `boolean`
|
||||
- allowFalling?: `boolean`
|
||||
- canCancel?: `boolean`
|
||||
- anim?: `table` (`object`)
|
||||
- dict?: `string`
|
||||
- Must specify either scenario or dict
|
||||
- clip: `string`
|
||||
- flag?: `number`
|
||||
- Default: `49`
|
||||
- blendIn?: `float`
|
||||
- Default: `3.0`
|
||||
- blendOut?: `float`
|
||||
- Default: `1.0`
|
||||
- duration?: `number`
|
||||
- Default: `-1`
|
||||
- playbackRate?: `number`
|
||||
- Default: `0`
|
||||
- lockX?: `boolean`
|
||||
- lockY?: `boolean`
|
||||
- lockZ?: `boolean`
|
||||
- scenario?: `string`
|
||||
- Must specify either scenario or dict
|
||||
- playEnter?: `boolean`
|
||||
- Default: `true`
|
||||
- prop?: `table` (`object` or `array`)
|
||||
- [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
|
||||
- model: `hash`
|
||||
- bone?: `number`
|
||||
- Default: `60309`
|
||||
- pos: `table`
|
||||
- x: `number`
|
||||
- y: `number`
|
||||
- z: `number`
|
||||
- rot: `table` (`object`)
|
||||
- x: `number`
|
||||
- y: `number`
|
||||
- z: `number`
|
||||
- disable?: `table` (`object`)
|
||||
- move?: `boolean`
|
||||
- car?: `boolean`
|
||||
- combat?: `boolean`
|
||||
- mouse?: `boolean`
|
||||
|
||||
### Usage Example
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
if lib.progressCircle({
|
||||
duration = 2000,
|
||||
position = 'bottom',
|
||||
useWhileDead = false,
|
||||
canCancel = true,
|
||||
disable = {
|
||||
car = true,
|
||||
},
|
||||
anim = {
|
||||
dict = 'mp_player_intdrink',
|
||||
clip = 'loop_bottle'
|
||||
},
|
||||
prop = {
|
||||
model = `prop_ld_flow_bottle`,
|
||||
pos = vec3(0.03, 0.03, 0.02),
|
||||
rot = vec3(0.0, 0.0, -1.5)
|
||||
},
|
||||
}) then print('Do stuff when complete') else print('Do stuff when cancelled') end
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
<Callout>
|
||||
This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
|
||||
</Callout>
|
||||
|
||||
```lua
|
||||
if lib.progressCircle({
|
||||
duration = 2000,
|
||||
position = 'bottom',
|
||||
useWhileDead = false,
|
||||
canCancel = true,
|
||||
disable = {
|
||||
car = true,
|
||||
},
|
||||
anim = {
|
||||
dict = 'mp_player_intdrink',
|
||||
clip = 'loop_bottle'
|
||||
},
|
||||
prop = {
|
||||
model = `prop_ld_flow_bottle`,
|
||||
pos = vec3(0.03, 0.03, 0.02),
|
||||
rot = vec3(0.0, 0.0, -1.5)
|
||||
},
|
||||
}) then print('Do stuff when complete') else print('Do stuff when cancelled') end
|
||||
```
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
<Callout>
|
||||
This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
|
||||
</Callout>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
if (await lib.progressCircle({
|
||||
duration: 2000,
|
||||
position: 'bottom',
|
||||
useWhileDead: false,
|
||||
canCancel: true,
|
||||
disable: {
|
||||
car: true,
|
||||
},
|
||||
anim: {
|
||||
dict: 'mp_player_intdrink',
|
||||
clip: 'loop_bottle'
|
||||
},
|
||||
prop: {
|
||||
model: `prop_ld_flow_bottle`,
|
||||
pos: {x: 0.03, y: 0.03, z: 0.02},
|
||||
rot: {x: 0.0, y: 0.0, z: -1.5}
|
||||
},
|
||||
})) console.log('Do stuff when complete')
|
||||
else console.log('Do stuff when cancelled')
|
||||
```
|
||||
|
||||
</Tab>
|
||||
if (await lib.progressCircle({
|
||||
duration: 2000,
|
||||
position: 'bottom',
|
||||
useWhileDead: false,
|
||||
canCancel: true,
|
||||
disable: {
|
||||
car: true,
|
||||
},
|
||||
anim: {
|
||||
dict: 'mp_player_intdrink',
|
||||
clip: 'loop_bottle'
|
||||
},
|
||||
prop: {
|
||||
model: `prop_ld_flow_bottle`,
|
||||
pos: {x: 0.03, y: 0.03, z: 0.02},
|
||||
rot: {x: 0.0, y: 0.0, z: -1.5}
|
||||
},
|
||||
})) console.log('Do stuff when complete')
|
||||
else console.log('Do stuff when cancelled')
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||

|
||||
@@ -276,22 +262,18 @@ else console.log('Do stuff when cancelled')
|
||||
Returns true if a progress bar is currently active.
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
lib.progressActive()
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
```lua
|
||||
lib.progressActive()
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
lib.progressActive()
|
||||
```
|
||||
|
||||
</Tab>
|
||||
lib.progressActive()
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## lib.cancelProgress
|
||||
@@ -300,20 +282,16 @@ If there is a progress bar active and the
|
||||
progress bar can be cancelled then it cancels it.
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
lib.cancelProgress()
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
```lua
|
||||
lib.cancelProgress()
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
lib.cancelProgress()
|
||||
```
|
||||
|
||||
</Tab>
|
||||
lib.cancelProgress()
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
Reference in new issue
Block a user