mtasa-blue
mtasa-blue copied to clipboard
Add server-side object events onObjectBreak & onObjectDamage
This PR adds onObjectBreak and onObjectDamage events on the server side.
addEventHandler('onObjectBreak', root, function(attacker)
print('Object: ', source)
print('Attacker: ', attacker)
end)
addEventHandler('onObjectDamage', root, function(loss,attacker)
print('Object: ', source)
print('Attacker: ', attacker)
print('Loss: ', loss)
end)
Idea is very good, but what you "forgot" to include are functions to enable these events, for example, SetDamageStateOnObject and GetDamageStateOnObject
Idea is very good, but what you "forgot" to include are functions to enable these events, for example,
SetDamageStateOnObjectandGetDamageStateOnObject
I do not understand what you mean. If you don't want the object to take damage or be destroyed, you can cancel client-side events or use setObjectBreakable & isObjectBreakable
I removed the onObjectDamage event. I wanted to do it in the same way as it is done with onPlayerDamage, i.e. in the synchronization package, but object synchronization does not seem to work. I haven't found a definition anywhere for "WITH_OBJECTS_SYNC", which is a condition for this synchronization.
Objects sync has been disabled in https://github.com/multitheftauto/mtasa-blue/issues/460