options = { -- This is your options table, in this table all the options will be specified for the target to accept
{ -- This is the first table with options, you can make as many options inside the options table as you want
type = "client", -- This specifies the type of event the target has to trigger on click, this can be "client", "server", "command" or "qbcommand", this is OPTIONAL and will only work if the event is also specified
event = "Test:Event", -- This is the event it will trigger on click, this can be a client event, server event, command or qbcore registered command, NOTICE: Normal command can't have arguments passed through, QBCore registered ones can have arguments passed through
icon = 'fas fa-example', -- This is the icon that will display next to this trigger option
label = 'Test', -- This is the label of this option which you would be able to click on to trigger everything, this has to be a string
targeticon = 'fas fa-example', -- This is the icon of the target itself, the icon changes to this when it turns blue on this specific option, this is OPTIONAL
item = 'handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONAL
action = function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONAL
if IsPedAPlayer(entity) then return false end -- This will return false if the entity interacted with is a player and otherwise returns true
TriggerEvent('testing:event', 'test') -- Triggers a client event called testing:event and sends the argument 'test' with it
end,
canInteract = function(entity, distance, data) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONAL
if IsPedAPlayer(entity) then return false end -- This will return false if the entity interacted with is a player and otherwise returns true
return true
end,
job = 'police', -- This is the job, this option won't show up if the player doesn't have this job, this can also be done with multiple jobs and grades, if you want multiple jobs you always need a grade with it: job = {["police"] = 0, ["ambulance"] = 2},
gang = 'ballas', -- This is the gang, this option won't show up if the player doesn't have this gang, this can also be done with multiple gangs and grades, if you want multiple gangs you always need a grade with it: gang = {["ballas"] = 0, ["thelostmc"] = 2},
citizenid = 'JFD98238', -- This is the citizenid, this option won't show up if the player doesn't have this citizenid, this can also be done with multiple citizenid's, if you want multiple citizenid's there is a specific format to follow: citizenid = {["JFD98238"] = true, ["HJS29340"] = true},
}
},
distance = 2.5