s2sk Posted February 19, 2018 Share Posted February 19, 2018 Hello. Sry for my english. I creating object: local element_object = createObject(13025, 123.123, 123.123, 123.123, 123.123, 123.123, 123.123) I creating collision: local element_col = createColCircle(0.0, 0.0, 25.0) I attach collision to object attachElements(element_col, element_object) And when i hit collision onElementColShapeHit not call. wtf? what i doing wrong? But i attach object to collision then everything works. attachElements(element_object, element_col) -- change variables Link to comment
NeXuS™ Posted February 19, 2018 Share Posted February 19, 2018 I dont know if you can attach colshapes at all. Try to use setDevelopmentMode and showcol. 1 Link to comment
s2sk Posted February 19, 2018 Author Share Posted February 19, 2018 lol. In debug mode collision attach on object. Why not call onElementColShapeHit? 20 minutes ago, NeXuS™ said: I dont know if you can attach colshapes at all. Try to use setDevelopmentMode and showcol. function onCollision(colShapeHit) outputChatBox("COLLISION") end addEventHandler("onElementColShapeHit", getRootElement(), onCollision) Link to comment
NeXuS™ Posted February 19, 2018 Share Posted February 19, 2018 Are you using this on server-side? Link to comment
s2sk Posted February 19, 2018 Author Share Posted February 19, 2018 1 minute ago, NeXuS™ said: Are you using this on server-side? Yes Link to comment
NeXuS™ Posted February 19, 2018 Share Posted February 19, 2018 After my testings, it seems like MTA still cant use colshape events after the colshape is attached. Just don't use attachElements and use setElementPosition instead. Link to comment
s2sk Posted February 19, 2018 Author Share Posted February 19, 2018 1 minute ago, NeXuS™ said: After my testings, it seems like MTA still cant use colshape events after the colshape is attached. Just don't use attachElements and use setElementPosition instead. But, in vehicle attach - work. If i use offset in attachElemnts and me lazy to consider the rotation angle? Link to comment
NeXuS™ Posted February 19, 2018 Share Posted February 19, 2018 (edited) At vehicles, it works. But on objects, it is totally useless. It says I just entered a colshape which is about 40 units away. Edited February 19, 2018 by NeXuS™ 1 Link to comment
s2sk Posted February 19, 2018 Author Share Posted February 19, 2018 4 minutes ago, NeXuS™ said: At vehicles, it works. But on objects, it is totally useless. It says I just entered a colshape which is about 40 units away. when the streamer you can attach.... more API in the MTA they said.... Link to comment
NeXuS™ Posted February 19, 2018 Share Posted February 19, 2018 And it seems like upon reconnecting, the collisions position is fixed, and it is at the position it should be, with the event working just fine. Link to comment
s2sk Posted February 19, 2018 Author Share Posted February 19, 2018 3 minutes ago, NeXuS™ said: And it seems like upon reconnecting, the collisions position is fixed, and it is at the position it should be, with the event working just fine. nice bug. admins fix pls in 1.5.6 Link to comment
Moderators IIYAMA Posted February 19, 2018 Moderators Share Posted February 19, 2018 An object isn't a streamed able element. There is no way for server-side to know where this colshape is located in the world. (Especially when the client moves the object) It might be possible based on last set position but even so it is very inaccurate. 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