h4x7o0r Posted March 9, 2014 Share Posted March 9, 2014 Hey there, How can i detect if an element is broken or not ? like glass panes, some wooden platforms etc. I tried using IsElementOnScreen (and other functions) but it's returning false if the element isn't in near when map starts. Is there any event or any method to detect that ? Thanks in advance. Link to comment
Bonsai Posted March 9, 2014 Share Posted March 9, 2014 EDIT: The Problem seems to be the glass objects. Hay e.g. works with some other function. But glass also doesn't work with breakObject function, so whats the difference between glass and hay? Link to comment
arezu Posted March 9, 2014 Share Posted March 9, 2014 Maybe try this? https://wiki.multitheftauto.com/wiki/OnClientObjectBreak And if you have to, sync with server the broken state for an object (maybe by using getElementSyncer to prevent all players that see the object breaking to sync with server?) I haven't tried but, maybe isObjectBreakable returns false if the object is broken? Link to comment
Bonsai Posted March 9, 2014 Share Posted March 9, 2014 That Event doesn't trigger for glass. Link to comment
h4x7o0r Posted March 11, 2014 Author Share Posted March 11, 2014 Just seen this : http://bugs.mtasa.com/view.php?id=7782 Maybe if I attach another object to the glass that will break together when glass shatters. (tried smth but didn't work as it should) Any other opinions ? Link to comment
arezu Posted March 11, 2014 Share Posted March 11, 2014 Depending on the content in which you want to use this, you could find other solutions. If you write what you are trying to do, then maybe we can find another solution. 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