OnClientObjectBreak

From Multi Theft Auto: Wiki
Revision as of 18:53, 10 March 2013 by Jusonex (talk | contribs) (Added onClientObjectBreak documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is fired before an object breaks. Also note that this event is only triggered for players nearby the local player's camera. This is due to elements far away being streamed out.

Parameters

element attacker
  • attacker: the vehicle/ped/player who is breaking the object

Source

The source of this event is the object which will break.

Cancel effect

If this event is canceled, the object will not break.

Example

Click to collapse [-]
Client

This example prevents objects from beeing broken in interiors.

addEventHandler("onClientObjectBreak", root,
    function()
        if getElementInterior(source) ~= 0 then
            cancelEvent()
        end
    end
)

Requirements

This template will be deleted.

See Also

Client object events


Client event functions