OnClientWeaponFire: Difference between revisions
Jump to navigation
Jump to search
(New) |
Gunslinger (talk | contribs) (→Syntax) |
||
Line 9: | Line 9: | ||
Can be cancelled with cancelEvent to prevent the shot. | Can be cancelled with cancelEvent to prevent the shot. | ||
== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
element hitElement, float posX, float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit | |||
</syntaxhighlight> | |||
*'''hitElement:''' the element that was 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== | ==Example== |
Revision as of 15:05, 25 April 2013
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.
Parameters
element hitElement, float posX, float posY, float posZ, float normalX, float normalY, float normalZ, int materialType, int lighting, int pieceHit
- hitElement: the element that was 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