Open benzon opened 3 years ago
Same issue with creating "AddPolyzone". Still finding a way to fix it.
The issue is, bt-target cant find Zones[_].center with vector2 math
The issue is, bt-target cant find Zones[_].center with vector2 math
Polyzones don't have a center param so there is no vector for it to work with, the vector2 has nothing to do with this. This is going to either need an exception specific to polyzones or add an addition center param to them
Hmm and how would you do that @Mojito-Fivem
I think the easiest way to ammend this would be to add a center param to the AddPolyZone function like so
function AddPolyzone(name, center, points, options, targetoptions)
Zones[name] = PolyZone:Create(points, options)
Zones[name].targetoptions = targetoptions
Zones[name].center = center
end
And then you can add an extra vector3 for the center of your PolyZone
exports["bt-target"]:AddPolyZone("ZoneName", vector3(0, 0, 0), points, options, {
options = {
{
event = "some_event",
icon = "fas fa-icon",
label = "A Label"
}
},
jobs = {"all"},
distance = 2.0,
}
If this works submit a PR to this repository or my maintained one.
Got some issues with Polyzones it throws an error, since it can't work with the vector2 values, if i do vector3's or even add a min and max height, it dos not react either.