mtasa-blue
mtasa-blue copied to clipboard
Add new function testSphereAgainstWorld (Close #646)
This PR adds a new function testSphereAgainstWorld, which allows checking if there are any obstacles within a given radius.
Syntax
bool hit, element hitElement, int modelID, float elementPositionX, float elementPositionY, float elementPositionZ, float elementRotationX, float elementRotationY, float elementRotationZ, int lodID, string type = testSphereAgainstWorld(float x, float y, float z, float radius [, element ignoredElement = nil, bool checkBuildings = true, checkVehicles = true, checkPeds = true, checkObjects = true, checkDummies = true, ignoreSomeObjectsForCamera = false ] )
hit - Indicates whether a collision was detected. hitElement - The element that was detected. If it wasn't created in MTA, it will be nil. elementPositionX, elementPositionY, elementPositionZ - World position of the detected element elementRotationX, elementRotationY, elementRotationZ - World rotation of the element modelID - The ID of the element. lodID - The ID of the element's LOD (or 0). entityType - The type of the element (building, vehicle, ped, object, dummy)
The modelID, lodID, and entityType parameters are returned even if hitElement is nil.
Closes #646