cancellableEvent.preventDefault

Revision as of 20:36, 19 November 2022 by Mex (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Method Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Server 1.0.0, Client 1.0.0

void cancellableEvent.preventDefault(void)

The cancellableEvent.preventDefault method is used to prevent the default action for the current event which is triggering.

Parameters

void This method doesn't take any parameters.

Return

void This method doesn't return a value.

Types

Shared CancellableEvent

Notes

Examples

Example 1 - JavaScript - Client-Side:

addEventHandler('onPedInflictDamage', function(event, ped, responsibleEntity, weapon, loss, pedPiece)
{
    // Prevent the ped from being damaged.
    event.preventDefault();
});

Compatibility

There isn't any compatibility information for this method.

Related

Server Related

        addEvent
        addEventHandler
        bindEventHandler
        removeEventHandler
        triggerEvent
        triggerNetworkEvent
        unbindEventHandler


Client Related

        addEvent
        addEventHandler
        bindEventHandler
        removeEventHandler
        triggerEvent
        triggerNetworkEvent
        unbindEventHandler