Options Formatting

When setting up a target, you will need to provide a list of options that you wish to be shown to the user. It is worth noting, that NYX Target only supports showing 8 targets at one time.

Example

{
    {
        -- These options determine what is shown when the user looks at the target
        title = 'Option 1', -- The label of the option
        icon = 'fas fa-cube', -- The FontAwesome icon to show
        
        -- These options determine what happens when the user chooses an option
        action = function(args)
            -- If it is a zone target, the args will be the zone
            -- If it is an entity target, the args will be the entity
            -- If it is a player target, the args will be the player's server id
        end,
        
        -- If you use an event, the whole option is provided as the first argument to the event
        event = 'your_event', -- the event that should be triggered
        isServer = true, -- if it should be a server event, or a client event
        
        -- All of these are OPTIONAL, and determine who can see the option
        canInteract = function(args) -- This determines if the target should be shown
            -- If it is a zone target, the args will be the zone
            -- If it is an entity target, the args will be the entity
            -- If it is a player target, the args will be the player's server id
            
            return true -- return true to show, false to hide
        end,
        job = {'police', 'ambulance'}, -- a table of jobs that the target is for
        gang = {'ballas', 'gsf'}, -- a table of gangs that the target is for
        citizenid = {'AWJ1313', 'DWA4141'}, -- a table of citizenids the target is for
        item = {'handcuffs', 'lockpick'}, -- a table of items that are required for the target to show
        
        distance = 2.5, -- the distance that the player must be for the target to show
        drawDistance = 5.0, -- the distance that the circle sprite should be drawn
        hintDistance = 10.0, -- the distance that the blue hint circle should show
        
        
        --- ANY OTHER ARGUMENTS YOU WANT TO PROVIDE TO THE EVENT
    },
    {
        -- These options determine what is shown when the user looks at the target
        title = 'Option 2', -- The label of the option
        icon = 'fas fa-user', -- The FontAwesome icon to show
        
        -- These options determine what happens when the user chooses an option
        action = function(args)
            -- If it is a zone target, the args will be the zone
            -- If it is an entity target, the args will be the entity
            -- If it is a player target, the args will be the player's server id
        end,
        
        -- If you use an event, the whole option is provided as the first argument to the event
        event = 'your_event', -- the event that should be triggered
        isServer = true, -- if it should be a server event, or a client event
        
        -- All of these are OPTIONAL, and determine who can see the option
        canInteract = function(args) -- This determines if the target should be shown
            -- If it is a zone target, the args will be the zone
            -- If it is an entity target, the args will be the entity
            -- If it is a player target, the args will be the player's server id
            
            return true -- return true to show, false to hide
        end,
        job = {'police', 'ambulance'}, -- a table of jobs that the target is for
        gang = {'ballas', 'gsf'}, -- a table of gangs that the target is for
        citizenid = {'AWJ1313', 'DWA4141'}, -- a table of citizenids the target is for
        item = {'handcuffs', 'lockpick'}, -- a table of items that are required for the target to show
        
        distance = 2.5, -- the distance that the player must be for the target to show
        drawDistance = 5.0, -- the distance that the circle sprite should be drawn
        hintDistance = 10.0, -- the distance that the blue hint circle should show
        
        
        --- ANY OTHER ARGUMENTS YOU WANT TO PROVIDE TO THE EVENT
    },
}

Last updated