Colshapes
Colshapes — серверные trigger volumes в форме sphere, circle, cuboid или cylinder. Detection работает по авторитетным position updates и учитывает dimensions.
ts
const garage = vimp.colshapes.createSphere(100, -1900, 21, 3, {
key: 'garage:entrance',
dimension: 0,
})
vimp.on('playerEnterColshape', (player, colshape) => {
if (!colshape || colshape.id !== garage?.id) return
player.emit('hud:toast', { text: 'Press E to open the garage' })
})Event payload допускает null: shape может быть удалена между появлением native event и JavaScript dispatch. Всегда делайте null-check.
playersInside — живой cached list. isPointInside выполняет локальную геометрическую проверку. Ни один из них не заменяет permissions check для последующего client request.
Размеры cuboid — half-extents: {x: 2, y: 3, z: 1} означает вдвое больший полный span вокруг центра.