mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 14:38:50 +00:00
new docs
This commit is contained in:
1 parent
3cebaf7fa5
commit
b5eba8423f
229 files changed
+6238
-10690
No files matched your search
@@ -0,0 +1,55 @@
|
||||
---
|
||||
keywords:
|
||||
[
|
||||
'addGlobalObject',
|
||||
'addGlobalPed',
|
||||
'addGlobalPlayer',
|
||||
'addGlobalVehicle',
|
||||
'removeGlobalObject',
|
||||
'removeGlobalPed',
|
||||
'removeGlobalPlayer',
|
||||
'removeGlobalVehicle',
|
||||
]
|
||||
---
|
||||
|
||||
Registers options that will apply to all entities of that type (object, ped, player, vehicle).
|
||||
|
||||
```lua
|
||||
local options = {
|
||||
{
|
||||
name = 'ox:option1',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-road',
|
||||
label = 'Option 1',
|
||||
},
|
||||
{
|
||||
name = 'ox:option2',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-road',
|
||||
label = 'Option 2',
|
||||
canInteract = function(entity, distance, coords, name, bone)
|
||||
return not IsEntityDead(entity)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
local optionNames = { 'ox:option1', 'ox:option2' }
|
||||
```
|
||||
|
||||
## Create Globals
|
||||
|
||||
```lua
|
||||
exports.ox_target:addGlobalObject(options)
|
||||
exports.ox_target:addGlobalPed(options)
|
||||
exports.ox_target:addGlobalPlayer(options)
|
||||
exports.ox_target:addGlobalVehicle(options)
|
||||
```
|
||||
|
||||
## Remove Globals
|
||||
|
||||
```lua
|
||||
exports.ox_target:removeGlobalObject(optionNames)
|
||||
exports.ox_target:removeGlobalPed(optionNames)
|
||||
exports.ox_target:removeGlobalPlayer(optionNames)
|
||||
exports.ox_target:removeGlobalVehicle(optionNames)
|
||||
```
|
||||
@@ -0,0 +1,80 @@
|
||||
```lua
|
||||
local options = {
|
||||
{
|
||||
name = 'ox:option1',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-road',
|
||||
label = 'Option 1',
|
||||
},
|
||||
{
|
||||
name = 'ox:option2',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-road',
|
||||
label = 'Option 2',
|
||||
canInteract = function(entity, distance, coords, name, bone)
|
||||
return not IsEntityDead(entity)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
local models = { `prop_atm_01`, `prop_atm_02` }
|
||||
local optionsNames = { 'ox:option1', 'ox:option2' }
|
||||
```
|
||||
|
||||
## disableTargeting
|
||||
|
||||
Toggles the state on being able to target. true/false
|
||||
|
||||
```lua
|
||||
exports.ox_target:disableTargeting(state)
|
||||
```
|
||||
|
||||
## addModel
|
||||
|
||||
Add new options when targeting a specific model or list of models.
|
||||
|
||||
```lua
|
||||
exports.ox_target:addModel(models, options)
|
||||
```
|
||||
|
||||
## removeModel
|
||||
|
||||
Remove options from a specific model or list of models.
|
||||
|
||||
```lua
|
||||
exports.ox_target:removeModel(models, optionNames)
|
||||
```
|
||||
|
||||
## addEntity
|
||||
|
||||
Add new options when targeting a networked entity matching the given netid or list of netIds.
|
||||
Requires the use of [NetworkGetNetworkIdFromEntity](https://docs.fivem.net/natives/?_0x9E35DAB6) on an entity id.
|
||||
|
||||
```lua
|
||||
exports.ox_target:addEntity(netIds, options)
|
||||
```
|
||||
|
||||
## removeEntity
|
||||
|
||||
Remove options from a networked entity matching the given netid or list of netIds.
|
||||
Requires the use of [NetworkGetNetworkIdFromEntity](https://docs.fivem.net/natives/?_0x9E35DAB6) on an entity id.
|
||||
|
||||
```lua
|
||||
exports.ox_target:removeEntity(netIds, optionNames)
|
||||
```
|
||||
|
||||
## addLocalEntity
|
||||
|
||||
Add new options when targeting a local entity or list of entities.
|
||||
|
||||
```lua
|
||||
exports.ox_target:addLocalEntity(entities, options)
|
||||
```
|
||||
|
||||
## removeLocalEntity
|
||||
|
||||
Remove options from a local entity or list of entities.
|
||||
|
||||
```lua
|
||||
exports.ox_target:removeLocalEntity(entities, optionNames)
|
||||
```
|
||||
@@ -0,0 +1,83 @@
|
||||
The input for zones differs slightly from all other options, instead taking the [zone](../../ox_lib/Modules/Zones/Shared.md) properties and two additional properties (drawSprite, and options).
|
||||
|
||||
## addSphereZone
|
||||
|
||||
```lua
|
||||
exports.ox_target:addSphereZone(parameters)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
```lua
|
||||
{
|
||||
coords = vector3,
|
||||
radius = number,
|
||||
debug? = boolean,
|
||||
drawSprite? = boolean,
|
||||
options = options,
|
||||
}
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
```lua
|
||||
exports.ox_target:addSphereZone({
|
||||
coords = vec3(440.5363, -1015.666, 28.85637),
|
||||
radius = 1,
|
||||
debug = drawZones,
|
||||
options = {
|
||||
{
|
||||
name = 'sphere',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-circle',
|
||||
label = '(Debug) Sphere',
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## addBoxZone
|
||||
|
||||
```lua
|
||||
exports.ox_target:addBoxZone(parameters)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
```lua
|
||||
{
|
||||
coords = vector3,
|
||||
size = vector3,
|
||||
rotation = number,
|
||||
debug? = boolean,
|
||||
drawSprite? = boolean,
|
||||
options = options,
|
||||
}
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
```lua
|
||||
exports.ox_target:addBoxZone({
|
||||
coords = vec3(442.5363, -1017.666, 28.85637),
|
||||
size = vec3(2, 2, 2),
|
||||
rotation = 45,
|
||||
debug = drawZones,
|
||||
options = {
|
||||
{
|
||||
name = 'box',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-cube',
|
||||
label = '(Debug) Box',
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## removeZone
|
||||
|
||||
```lua
|
||||
exports.ox_target:removeZone(id)
|
||||
```
|
||||
|
||||
The `id` passed to removeZone is the return value from addBoxZone / addSphereZone.
|
||||
Reference in new issue
Block a user