cancelEvent | Multi Theft Auto: Wiki Skip to content

cancelEvent

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is used to stop the automatic internal handling of events, for example this can be used to prevent an item being given to a player when they walk over a pickup, by canceling the onPickupUse event.

Syntax

cancelEvent ( )

Code Examples

server

This example stops the player from entering a vehicle.

function onVehicleStartEnter()
cancelEvent()
end
addEventHandler("onVehicleStartEnter", root, onVehicleStartEnter)