OnWeaponFire

From Multi Theft Auto: Wiki
Revision as of 19:23, 30 January 2013 by UniOnDennis (talk | contribs) (Created page with "__NOTOC__ {{Server event}} This event is triggered when a weapon gets fired. This can be either by a player or vehicle. ==Source== The source of t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered when a weapon gets fired. This can be either by a player or vehicle.

Source

The source of this event is the element that fired the event. If the server is the creator it returns 'NULL'.

Cancel effect

If this event is canceled, the bullet(s) won't be synced with other players.

Requirements

This template will be deleted.

Example

addEventHandler( "onWeaponFire", root,
    function ()
        if ( isElement( source ) ) and ( getElementType( source ) == "player ) then
            outputChatBox( "You fired a weapon!", source, 0, 225 0 )
        end
    end
)

See Also

Player events


Event functions