You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are Templates for all the functions in qb-target
AddCircleZone
Function Format
-- This is the function from how you would use it inside qb-target/client/main.luaFunctions:AddCircleZone(name: string, center: vector3, radius: float, options: table, targetoptions: table)
options= {
name: string (UNIQUE),
debugPoly: boolean,
}
targetoptions= {
options= {
{
type: string,
event: string,
icon: string,
label: string,
style: string,
targeticon: string,
item: string,
action: function,
canInteract: function,
job: string
}
},
distance: float
}
Config option, this will go into the Config.CircleZones table
["index"] = { -- This can be a string or a numbername="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonescoords=vector3(x, y, z), -- These are the coords for the zone, this has to be a vector3 and the coords have to be a float value, fill in x, y and z with the coordsradius=1.5, -- The radius of the circlezone calculated from the center of the zone, this has to be a float valuedebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in greenoptions= { -- 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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
exports['qb-target']:AddCircleZone("name", vector3(x, y, z), 1.5, { -- The name has to be unique, the coords a vector3 as shown and the 1.5 is the radius which has to be a float valuename="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonesdebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in green
}, {
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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
})
AddBoxZone
Function Format
-- This is the function from how you would use it inside qb-target/client/main.luaFunctions:AddBoxZone(name: string, center: vector3, length: float, width: float, options: table, targetoptions: table)
options= {
name: string (UNIQUE),
heading: float,
debugPoly: boolean,
minZ: float,
maxZ: float,
}
targetoptions= {
options= {
{
type: string,
event: string,
icon: string,
label: string,
style: string,
targeticon: string,
item: string,
action: function,
canInteract: function,
job: string
}
},
distance: float
}
Config option, this will go into the Config.BoxZones table
["index"] = { -- This can be a string or a numbername="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonescoords=vector3(x, y, z), -- These are the coords for the zone, this has to be a vector3 and the coords have to be a float value, fill in x, y and z with the coordslength=1.5, -- The length of the boxzone calculated from the center of the zone, this has to be a float valuewidth=1.6, -- The width of the boxzone calculated from the center of the zone, this has to be a float valueheading=12.0, -- The heading of the boxzone, this has to be a float valuedebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in greenminZ=36.7, -- This is the bottom of the boxzone, this can be different from the Z value in the coords, this has to be a float valuemaxZ=38.9, -- This is the top of the boxzone, this can be different from the Z value in the coords, this has to be a float valueoptions= { -- 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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
exports['qb-target']:AddBoxZone("name", vector3(x, y, z), 1.5, 1.6, { -- The name has to be unique, the coords a vector3 as shown, the 1.5 is the length of the boxzone and the 1.6 is the width of the boxzone, the length and width have to be float valuesname="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonesheading=12.0, -- The heading of the boxzone, this has to be a float valuedebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in greenminZ=36.7, -- This is the bottom of the boxzone, this can be different from the Z value in the coords, this has to be a float valuemaxZ=38.9, -- This is the top of the boxzone, this can be different from the Z value in the coords, this has to be a float value
}, {
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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
})
AddPolyZone
Function Format
-- This is the function from how you would use it inside qb-target/client/main.luaFunctions:AddPolyZone(name: string, points: table, options: table, targetoptions: table)
points= {
vector2(x, y), vector2(x, y), -- Add a minimum of 3 points for this to work and they have to be in order of drawing
}
options= {
name: string (UNIQUE),
debugPoly: boolean,
minZ: float,
maxZ: float
}
targetoptions= {
options= {
{
type: string,
event: string,
icon: string,
label: string,
style: string,
targeticon: string,
item: string,
action: function,
canInteract: function,
job: string
}
},
distance: float
}
Config option, this will go into the Config.BoxZones table
["index"] = { -- This can be a string or a numbername="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonespoints= { -- This will draw the polyzones in order on the specific coords, every coord is a point that it will draw onvector2(x, y), vector2(x, y), vector2(x, y), vector2(x, y),
}
debugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in greenminZ=36.7, -- This is the bottom of the boxzone, this can be different from the Z value in the coords, this has to be a float valuemaxZ=38.9, -- This is the top of the boxzone, this can be different from the Z value in the coords, this has to be a float valueoptions= { -- 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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
localpoints= {
vector2(x, y, z), vector2(x, y, z), vector2(x, y, z)
}
exports['qb-target']:AddPolyZone("name", points, {
name="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonesdebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in greenminZ=36.7, -- This is the bottom of the polyzone, this can be different from the Z value in the coords, this has to be a float valuemaxZ=38.9, -- This is the top of the polyzone, this can be different from the Z value in the coords, this has to be a float value
})
AddTargetBone
Function Format
-- This is the function from how you would use it inside qb-target/client/main.luaFunctions:AddTargetBone(bones: tableorstring, parameters: table)
parameters= {
options= {
{
type: string,
event: string,
icon: string,
label: string,
style: string,
targeticon: string,
item: string,
action: function,
canInteract: function,
job: string
}
},
distance: float
}
Config option, this will go into the Config.TargetBones table
["index"] = { -- This can be a string or a numberbones= {'boot', 'bonnet'} -- This is your bones table, this specifies all the bones that have to be added to the targetoptions, this can be a string or a tableoptions= { -- 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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
localbones= {
'boot',
'bonnet'
}
exports['qb-target']:AddTargetBone(bones, { -- The bones can be a string or a tableoptions= {
{ -- This is the first table with options, you can make as many options inside the options table as you wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
})
Config option, this will go into the Config.TargetEntities table
["index"] = { -- This can be a string or a numberentity=5939885-- This is the specified entity, this is not intended for the config as these numbers are randomized per entity but it's there, you'd have to get the entity's number and make them networked so it can be targetedoptions= { -- 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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
localentity=CreatePed(2, `a_m_m_indian_01`, 500.0, 500.0, 100.0, 12.0, true, false)
exports['qb-target']:AddTargetEntity(entity, { -- The specified entity numberoptions= {
{ -- This is the first table with options, you can make as many options inside the options table as you wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
})
Config option, this will go into the Config.EntityZones table
["index"] = { -- This can be a string or a numbername="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonesdebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in greenentity=5939885-- This is the specified entity, this is not intended for the config as these numbers are randomized per entity but it's there, you'd have to get the entity's number and make them networked so it can be targetedoptions= { -- 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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
localentity=CreatePed(2, `a_m_m_indian_01`, 500.0, 500.0, 100.0, 12.0, true, false)
exports['qb-target']:AddEntityZone("name", entity, { -- The specified entity number
{
name="name", -- This is the name of the zone recognized by PolyZone, this has to be unique so it doesn't mess up with other zonesdebugPoly=false, -- This is for enabling/disabling the drawing of the box, it accepts only a boolean value (true or false), when true it will draw the polyzone in green
}, {
options= {
{ -- This is the first table with options, you can make as many options inside the options table as you wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
}
})
Config option, this will go into the Config.TargetModels table
["index"] = { -- This can be a string or a numbermodels= { -- This is your models table, here you define all the target models to be interacted with, this can be a string or a table'a_m_m_indian_01',
}
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 wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
},
Export option, this will go into any client side resource file aside from qb-target's one
localmodels= {
'a_m_m_indian_01',
}
exports['qb-target']:AddTargetModel(models { -- This defines the models, can be a string or a tableoptions= {
{ -- This is the first table with options, you can make as many options inside the options table as you wanttype="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 specifiedevent="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 throughicon='fas fa-example', -- This is the icon that will display next to this trigger option, all the icons can be found on fontawesome.comstyle="", -- This is where you can add the following to edit the color of the icon example: "--fa-primary-color: brown; --fa-secondary-color: tan; --fa-secondary-opacity: 1.0;",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 stringtargeticon='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 OPTIONALitem='handcuffs', -- This is the item it has to check for, this option will only show up if the player has this item, this is OPTIONALaction=function(entity) -- This is the action it has to perform, this REPLACES the event and this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns trueTriggerEvent('testing:event', 'test')
returntrueend,
canInteract=function(entity) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONALifIsPedAPlayer(entity) thenreturnfalseend-- This will return false if the entity interacted with is a player and otherwise returns truereturntrueend,
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}
}
},
distance=2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
}
})