AddBoxZone - LiamDormon/bt-target GitHub Wiki
Description
Creates a BoxZone using PolyZone which can be interacted with.
Format
AddBoxZone(name: string, center: vector3, length: float, width: float, options: table, parameters: table)
options = {
name: string -- Name of BoxZone
heading: float -- Heading of BoxZone
debugPoly: boolean -- Toggle debug drawing for BoxZone
minZ: float -- Minimum Z coordinate for the BoxZone
maxZ: float -- Maximum Z coordinate for the BoxZone
}
parameters= {
options: table {event: string, icon: string, label: string, job:string, shouldShow: function}
distance: int -- distance between player and the model
}
Code Example
Citizen.CreateThread(function()
AddBoxZone("PoliceDuty", vector3(441.79, -982.07, 30.69), 0.4, 0.6, {
name="PoliceDuty",
heading=91,
debugPoly=false,
minZ=30.79,
maxZ=30.99
}, {
options = {
{
event = "signon",
icon = "far fa-clipboard",
label = "Sign On",
job = {"police", "ambulance", "mechanic"}
},
{
event = "signoff",
icon = "far fa-clipboard",
label = "Sign Off",
job = {"police", "ambulance", "mechanic"}
},
},
distance = 1.5
})
end)