mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
210 lines
3.0 KiB
Plaintext
210 lines
3.0 KiB
Plaintext
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, Tab } from 'nextra-theme-docs';
|
|
|
|
### lib.requestAnimDict
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestAnimDict(dict, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestAnimDict(dict, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* dict: `string`
|
|
* timeout: `number`
|
|
* Default: `100`
|
|
|
|
### lib.requestAnimSet
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestAnimSet(set, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestAnimSet(set, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* set: `string`
|
|
* timeout: `number`
|
|
* Default: `100`
|
|
|
|
### lib.requestModel
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestModel(model, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestModel(model, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* model: `string`
|
|
* timeout: `number`
|
|
* Default: `100`
|
|
|
|
### lib.requestStreamedTextureDict
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestStreamedTextureDict(dict, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestStreamedTextureDict(dict, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* dict: `string`
|
|
* timeout: `number`
|
|
* Default: `100`
|
|
|
|
### lib.requestNamedPtfxAsset
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestNamedPtfxAsset(fxName, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestNamedPtfxAsset(fxName, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* fxName: `string`
|
|
* timeout: `number`
|
|
* Default: `100`
|
|
|
|
### lib.requestScaleformMovie
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestScaleformMovie(scaleformMovie, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestScaleformMovie(scaleformMovie, timeout)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* dict: `string`
|
|
* timeout: `number`
|
|
* Default: `100`
|
|
|
|
### lib.requestWeaponAsset
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
|
|
```lua
|
|
lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComponentFlags)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab>
|
|
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client'
|
|
|
|
lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraWeaponComponentFlags)
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
* weaponType: `string | number`
|
|
* timeout: `number?`
|
|
* Number of ticks to wait for the asset to load. Default is `500`
|
|
* weaponResourceFlags: `WeaponResourceFlags?`
|
|
* Default is `31`
|
|
* extraWeaponComponentFlags: `ExtraWeaponComponentFlags?`
|
|
* Default is `0`
|
|
|
|
Return:
|
|
* `string | number?` weaponType
|
|
|
|
### WeaponResourceFlags
|
|
|
|
```
|
|
1 WRF_REQUEST_BASE_ANIMS
|
|
2 WRF_REQUEST_COVER_ANIMS
|
|
4 WRF_REQUEST_MELEE_ANIMS
|
|
8 WRF_REQUEST_MOTION_ANIMS
|
|
16 WRF_REQUEST_STEALTH_ANIMS
|
|
32 WRF_REQUEST_ALL_MOVEMENT_VARIATION_ANIMS
|
|
31 WRF_REQUEST_ALL_ANIMS
|
|
```
|
|
|
|
### ExtraWeaponComponentFlags
|
|
|
|
```
|
|
0 WEAPON_COMPONENT_NONE
|
|
1 WEAPON_COMPONENT_FLASH
|
|
2 WEAPON_COMPONENT_SCOPE
|
|
4 WEAPON_COMPONENT_SUPP
|
|
8 WEAPON_COMPONENT_SCLIP2
|
|
16 WEAPON_COMPONENT_GRIP
|
|
```
|