mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-03 14:38:49 +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)
|
||||
```
|
||||
Reference in new issue
Block a user