OnClientWeaponFire: Difference between revisions
Jump to navigation
Jump to search
m (Added outdated template with link to onClientPlayerWeaponFire) |
(New) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Weapon creation event. | |||
Called post firing so properties can be changed per shot | |||
Source is the weapon that fired | |||
Can be cancelled with cancelEvent to prevent the shot. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
onClientWeaponFire ( entity hitEntity, posX, posY, posZ, normalX, normalY, normalZ, int materialType, int lighting, int pieceHit ) | |||
- hitEntity the entity it will hit | |||
- posX the position it will hit | |||
- posY the position it will hit | |||
- posZ the position it will hit | |||
- normalX the normal it hit ( see processLineOfSight ) | |||
- normalY the normal it hit ( see processLineOfSight ) | |||
- normalZ the normal it hit ( see processLineOfSight ) | |||
- materialType the material type it hit ( see processLineOfSight ) | |||
- lighting the lighting of the entity it hit ( see processLineOfSight ) | |||
- pieceHit the piece of the entity it hit ( see processLineOfSight ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==Example== | ==Example== | ||
This example calls server events, when an object was hit, or the player shot at something with a special gun. | This example calls server events, when an object was hit, or the player shot at something with a special gun. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Event_functions}} | {{Event_functions}} |
Revision as of 22:46, 25 August 2012
Weapon creation event.
Called post firing so properties can be changed per shot
Source is the weapon that fired
Can be cancelled with cancelEvent to prevent the shot.
Syntax
onClientWeaponFire ( entity hitEntity, posX, posY, posZ, normalX, normalY, normalZ, int materialType, int lighting, int pieceHit ) - hitEntity the entity it will hit - posX the position it will hit - posY the position it will hit - posZ the position it will hit - normalX the normal it hit ( see processLineOfSight ) - normalY the normal it hit ( see processLineOfSight ) - normalZ the normal it hit ( see processLineOfSight ) - materialType the material type it hit ( see processLineOfSight ) - lighting the lighting of the entity it hit ( see processLineOfSight ) - pieceHit the piece of the entity it hit ( see processLineOfSight )
Example
This example calls server events, when an object was hit, or the player shot at something with a special gun.
See Also
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled