OnClientExplosion: Difference between revisions
Jump to navigation
Jump to search
m (See Also for other client events) |
No edit summary |
||
Line 18: | Line 18: | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the explosions creator element (object/vehicle) | The [[event system#Event source|source]] of this event is the explosions creator element (object/vehicle/player) | ||
==Example== | ==Example== | ||
This example outputs the type of element that created the explosion into the chatbox. | |||
<syntaxhighlight lang="lua"> | |||
function ClientExplosionFunction(x,y,z,type) | |||
outputChatBox("Explosion created by a "..getElementType(source)) | |||
end | |||
addEventHandler("onClientExplosion",getRootElement(),ClientExplosionFunction) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== |
Revision as of 02:05, 12 April 2008
This is a new feature in DP2.
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 type
- x: the X Coordinate of where the explosion was created
- y: the Y Coordinate of where the explosion was created
- z: the z Coordinate of where the explosion was created
- type: the type of explosion created, Values are:
- 0: Grenade
- 1: Molotov
- 2: Rocket
- 3: Rocket Weak
- 4: Car
- 5: Car Quick
- 6: Boat
- 7: Heli
- 8: Mine
- 9: Object
- 10: Tank Grenade
- 11: Small
- 12: Tiny
Source
The source of this event is the explosions creator element (object/vehicle/player)
Example
This example outputs the type of element that created the explosion into the chatbox.
function ClientExplosionFunction(x,y,z,type) outputChatBox("Explosion created by a "..getElementType(source)) end addEventHandler("onClientExplosion",getRootElement(),ClientExplosionFunction)
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