TorNix~|nR Posted January 5, 2022 Share Posted January 5, 2022 Hello everyone, I want to know how to make the object frozen like in the editor I'm using createObject is there anyway to make it frozen? Link to comment
The_GTA Posted January 5, 2022 Share Posted January 5, 2022 Hello TorNix~|nR, could you explain the problem that you are facing? I would like to know why you need to freeze an object. Is there something wrong with how the object is interacting with game world entity collisions? By default GTA SA objects are not moving unless they are touched by other entities. Link to comment
TorNix~|nR Posted January 5, 2022 Author Share Posted January 5, 2022 (edited) I made a gate using the object number (990) it can be broken for example by a car, I want to fix it when I used the editor resource just to test it, I made it frozen and it worked (it can not be damaged) Edited January 5, 2022 by TorNix~|nR Link to comment
The_GTA Posted January 5, 2022 Share Posted January 5, 2022 28 minutes ago, TorNix~|nR said: (...) it can be broken (...) (...) I made it frozen (...) You might be using the wrong terminology here. Did you know what "frozen" and "breakable" are two different things? I think you mean "breakable" instead of "frozen". To set an object unbreakable, you should try using the setObjectBreakable function. Link to comment
TorNix~|nR Posted January 5, 2022 Author Share Posted January 5, 2022 is there anyway to use the setObjectBreakable function. in server-side? Link to comment
The_GTA Posted January 5, 2022 Share Posted January 5, 2022 2 minutes ago, TorNix~|nR said: is there anyway to use the setObjectBreakable function. in server-side? The breakable-property of objects does not appear to be synchronized by the MTA server based on the Lua functions. In that case you should try manually triggering a remote clientside event handler with the object as source parameter which would set your object unbreakable on each connected client. You should do that for each connected and each connecting client. 1 Link to comment
Moderators IIYAMA Posted January 5, 2022 Moderators Share Posted January 5, 2022 2 hours ago, TorNix~|nR said: is there anyway to use the setObjectBreakable function. in server-side? You can also cancel the object-break of the current resource. -- clientside addEventHandler("onClientObjectBreak", resourceRoot, -- resourceRoot so that it only triggers for elements of the same resource function() cancelEvent() setObjectBreakable ( source, false ) -- optional end ) Or make use of a propagation call for all elements of the whole resource: -- clientside (important for this method here is that you create the elements on serverside without delay > not on onResourceStart) addEventHandler("onClientResourceStart", resourceRoot, function () setObjectBreakable ( source, false ) end, false) Options enough. 1 Link to comment
TorNix~|nR Posted January 5, 2022 Author Share Posted January 5, 2022 @The_GTA, thank you @IIYAMA your method worked, thank you so much 1 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