Jump to content

Object


TorNix~|nR

Recommended Posts

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
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.

  • Like 1
Link to comment
  • Moderators
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.

 

  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...