mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 22:22:46 +00:00
low effort ox_target docs
This commit is contained in:
1 parent
40faff4ab8
commit
efbe5fe087
7 files changed
+306
No files matched your search
@@ -0,0 +1,40 @@
|
||||
```lua
|
||||
local options = {
|
||||
{
|
||||
name = 'ox:option1',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-road',
|
||||
label = 'Option 1',
|
||||
canInteract = function(entity, coords, distance)
|
||||
return math.random(0, 100) < 51
|
||||
end
|
||||
},
|
||||
{
|
||||
name = 'ox:option1',
|
||||
event = 'ox_target:debug',
|
||||
icon = 'fa-solid fa-road',
|
||||
label = 'Option 2',
|
||||
canInteract = function(entity, coords, distance)
|
||||
return math.random(0, 100) < 51
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
local optionNames = { 'ox:option1', 'ox:option2' }
|
||||
```
|
||||
|
||||
## Create Globals
|
||||
|
||||
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