View Issue Details

IDProjectCategoryView StatusLast Update
0009373Multi Theft Auto : San AndreasScriptingpublic2018-07-21 17:26
ReporterdrifterCZ Assigned Toqaisjp  
Status resolvedResolutionfixed 
Product Version1.5.5 
Target Version1.5.6Fixed in Version1.5.6 
Summary0009373: [Request] isPositionWithinColShape

this function would be very useful in some cases. I need it for checking if some vehicle part (not the vehicle itself) is in polygon. And i think some other scripters would also like this function

Steps To Reproduce

there is already isElementWithinColShape, where element position is retrieved, this function would contain the same, except it will get the position right in input and won't have to get position of element

Additional Information

Now I have to use a invisible dummy element and position it to the coordinates i want to check and then do isElementWithinColShape ( dummy, colshape ) which is kind a stupid way, but no better way actualy.

TagsNo tags attached.


child of 0003344 closed New Feature Requests Requested features tracker 



2016-09-11 21:50

viewer   ~~0025176

Last edited: 2018-05-17 18:07

function isPositionInColShape(x,y,z,col)
    local object = createObject(3003,x,y,z)
    local incol = isElementWithinColShape(object,col)
    return incol


2016-09-13 03:15

administrator   ~~0025187

How about renaming isElementWithinColShape/isElementWithinMarker to isWithin, and then allowing it to also take a Vector3 (as well as marker/shape)?


2016-09-13 12:04

administrator   ~~0025190

isWithin breaks consistency in my opinion.

Instead, what do you think about deprecating isElementWithinMarker and letting isElementWithinColShape accept both colshape and marker + adding something like queryColShapePosition (following the convention <verb> <element-type> <noun/action>)


2016-09-14 15:36

administrator   ~~0025198

I'm definitely up for deprecating isElementWithinMarker, and allowing markers to be used with isElementWithinColShape.

I'm not sure about adding another function that does essentially the same thing (but with different types)... how about "checkColShapeCollision" (checks if vectors/elements are inside a colshape/marker)?


2016-09-14 22:40

viewer   ~~0025201

Last edited: 2016-09-14 22:41

maybe just improve isElementWithinColShape (or implement isElementWithin for both markers/colshapes) and make it capable of accepting vectors or x,y,z. Well the "Element" in the name of function will be a bit confusing. But most people will still use the elements, instead of position, but they will have option to use the position, if they have to


2018-05-17 16:52

administrator   ~~0026529

Implemented here (without comments taken into consideration)


2018-07-01 16:05

administrator   ~~0026590

Merged in 0a7a28a5a66cc5712f296a3b404ce9f1a4510216 by PR #195.


Issue History

Date Modified Username Field Change