ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientExplosion

Event

onClientExplosion

ClientFireIdentical to MTA:SA

An explosion is about to happen in the player's game. You can cancel it only for yourself.

Handler

addEventHandler("onClientExplosion", root, function(x, y, z, theType) ... end)

Parameters

x, y, zfloat
Position.
theTypeint
Type 0-12.

Source

source is the explosion's creator or root.

cancelEvent() = no explosion in this game.

Example

addEventHandler("onClientExplosion", root, function(x, y, z)
    if getDistanceBetweenPoints3D(x, y, z, 2495, -1687, 13.5) < 30 then cancelEvent() end
end)

See also