6,834
edits
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |name = preventDefault | ||
|side = shared | |||
|type = method | |type = method | ||
|class = | |class = CancellableEvent | ||
| | |games = iii vc sa iv | ||
| | |desc = prevent the default action for the current event which is triggering | ||
|return = void | |||
|freturn = void | |||
|note = See also: [[event.isDefaultPrevented|event.isDefaultPrevented]] | |||
| | |exampleJSCS = addEventHandler('onPedInflictDamage', function(event, ped, responsibleEntity, weapon, loss, pedPiece) | ||
{ | |||
// Prevent the ped from being damaged. | |||
event.preventDefault(); | |||
}); | |||
}} | }} |
edits