OnClientExplosion: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Update explosion types.) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
float x, float y, float z, int theType | float x, float y, float z, int theType | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''x:''' | *'''x:''' X coordinate of where the explosion was created | ||
*'''y:''' | *'''y:''' Y coordinate of where the explosion was created | ||
*'''z:''' | *'''z:''' Z coordinate of where the explosion was created | ||
*'''theType:''' the type of explosion created, | *'''theType:''' the type of explosion created, see: [[Explosion types]] | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the | The [[event system#Event source|source]] of this event is the [[player]] who created the explosion. | ||
If the explosion is from a [[vehicle]] the source is the [[player]] who syncs the vehicle. | |||
===Canceling=== | ===Canceling=== | ||
Line 20: | Line 20: | ||
This example outputs the type of element that created the explosion into the chatbox. | This example outputs the type of element that created the explosion into the chatbox. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function onClientExplosion(x, y, z, theType) | ||
outputChatBox("Explosion created by a "..getElementType(source)) | outputChatBox("Explosion created by a "..getElementType(source)) | ||
end | end | ||
addEventHandler("onClientExplosion", | addEventHandler("onClientExplosion", root, onClientExplosion) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 11:43, 11 January 2024
This event is triggered every time an explosion is created on the current clients scene (inside the streamer).
Parameters
float x, float y, float z, int theType
- x: X coordinate of where the explosion was created
- y: Y coordinate of where the explosion was created
- z: Z coordinate of where the explosion was created
- theType: the type of explosion created, see: Explosion types
Source
The source of this event is the player who created the explosion. If the explosion is from a vehicle the source is the player who syncs the vehicle.
Canceling
If this event is canceled, the explosion will not occur.
Example
This example outputs the type of element that created the explosion into the chatbox.
function onClientExplosion(x, y, z, theType) outputChatBox("Explosion created by a "..getElementType(source)) end addEventHandler("onClientExplosion", root, onClientExplosion)
See Also
Other client events
- onClientChatMessage
- onClientConsole
- onClientDebugMessage
- onClientExplosion
- onClientFileDownloadComplete
- onClientHUDRender
- onClientMinimize
- onClientMTAFocusChange
- onClientPedsProcessed
- onClientPlayerNetworkStatus
- onClientPreRender
- onClientRender
- onClientRestore
- onClientTransferBoxProgressChange
- onClientTransferBoxVisibilityChange
- onClientWorldSound
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled