AddType
AddType
This export does the equivalent of AddGlobalType, AddGlobalPed, AddGlobalVehicle, AddGlobalObject
Types
Type ID
Type
1
Peds (Not Players)
2
Vehicles
3
Objects (& Anything Else)
Arguments
Argument
Description
identifier
The unique string identifier of this target, in-case you want to remove it later
type id
The type of global target to add
options
The options for the target (see Options Formatting)
Usage
exports['nyx2_target']:AddType(identifier, type, options)
Example
exports['nyx2_target']:AddType('debug_global_vehicle', 2, {
{
title = 'Push Vehicle',
icon = 'fas fa-car',
action = function(vehicle)
-- push the vehicle
end,
canInteract = function(vehicle)
return true
end,
job = nil,
gang = nil,
citizenid = nil,
item = nil,
}
})
RemoveType
This export removes a global target that you have created.
Arguments
Argument
Description
identifier
The unique string identifier of the target you want to remove
Example
exports['nyx2_target']:RemoveType('debug_global_vehicle')
Last updated