..:D&G:.. Posted March 21, 2016 Share Posted March 21, 2016 So, I am trying to do a protection item for a survival server, and it should protect stuff inside a colshape surrounding it but how do I find out if the colshapes isn't intersecting with other ones near it? Thanks. Link to comment
Captain Cody Posted March 21, 2016 Share Posted March 21, 2016 Turn development mode on https://wiki.multitheftauto.com/wiki/SetDevelopmentMode then use /showcol If that is what you are asking to see if they are intersecting. Link to comment
..:D&G:.. Posted March 21, 2016 Author Share Posted March 21, 2016 Turn development mode onhttps://wiki.multitheftauto.com/wiki/SetDevelopmentMode then use /showcol If that is what you are asking to see if they are intersecting. I don't want to see for myself if 2 colshapes are colliding, I want the script to check, and if 1 colshape is in another it should say something like "You cannot place your protection here"... Link to comment
Captain Cody Posted March 21, 2016 Share Posted March 21, 2016 https://wiki.multitheftauto.com/wiki/Is ... inColShape https://wiki.multitheftauto.com/wiki/Ge ... inColShape From what I know it should be able to detect other colshapes. Link to comment
..:D&G:.. Posted March 21, 2016 Author Share Posted March 21, 2016 https://wiki.multitheftauto.com/wiki/IsElementWithinColShapehttps://wiki.multitheftauto.com/wiki/Ge ... inColShape From what I know it should be able to detect other colshapes. Is there any way to detect if the colshape is hitting a colshape with a specific elementData? Because isElementWithinColShape requires a certain colshape at argument 2 and I want to avoid using ipairs to check all the colshapes from the server, so is there any other way? Link to comment
Captain Cody Posted March 21, 2016 Share Posted March 21, 2016 [url=https://wiki.multitheftauto.com/wiki/GetElementsWithinColShape]https://wiki.multitheftauto.com/wiki/Ge ... inColShape[/url] if [url=https://wiki.multitheftauto.com/wiki/GetElementData]https://wiki.multitheftauto.com/wiki/GetElementData[/url] ('dataname") == data then local cols = getElementsWithinColShape ( colshape, "colshape" ) for theKey,colshapes in ipairs(cols) do if getElementData ( colshapes , "datakey" ) == data jah want then outputDebugString("So and so col shape is in another colshape, oh focking no.") Link to comment
..:D&G:.. Posted March 21, 2016 Author Share Posted March 21, 2016 [url=https://wiki.multitheftauto.com/wiki/GetElementsWithinColShape]https://wiki.multitheftauto.com/wiki/Ge ... inColShape[/url] if [url=https://wiki.multitheftauto.com/wiki/GetElementData]https://wiki.multitheftauto.com/wiki/GetElementData[/url] ('dataname") == data then local cols = getElementsWithinColShape ( colshape, "colshape" ) for theKey,colshapes in ipairs(cols) do if getElementData ( colshapes , "datakey" ) == data jah want then outputDebugString("So and so col shape is in another colshape, oh focking no.") I know all this already lol, I wanted to avoid using ipairs loops to find the colshape, but I guess I'll have to use it Thanks for the help! Link to comment
Captain Cody Posted March 21, 2016 Share Posted March 21, 2016 If you're afraid to use it due to lag, from my experience stuff like this won't cause any lag. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now