OnClientExplosion: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 5: Line 5:
==Parameters==
==Parameters==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
float x, float y, float z, int type
float x, float y, float z, int theType
</syntaxhighlight>
</syntaxhighlight>
*'''x:''' the X Coordinate of where the explosion was created
*'''x:''' the X Coordinate of where the explosion was created
*'''y:''' the Y 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
*'''z:''' the z Coordinate of where the explosion was created
*'''type:''' the type of explosion created, Values are:
*'''theType:''' the type of explosion created, Values are:
{{Explosions}}
{{Explosions}}


Line 19: Line 19:
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 ClientExplosionFunction(x,y,z,type)
function ClientExplosionFunction(x,y,z,theType)
outputChatBox("Explosion created by a "..getElementType(source))
outputChatBox("Explosion created by a "..getElementType(source))
end
end

Revision as of 10:10, 19 September 2009

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: 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
  • theType: 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,theType)
	outputChatBox("Explosion created by a "..getElementType(source))
end
addEventHandler("onClientExplosion",getRootElement(),ClientExplosionFunction)

See Also

Other client events


Client event functions