CancelEvent
Jump to navigation
Jump to search
This article needs checking. | |
Reason(s): I'm making assumptions here.. Erorr404 |
This function is used to stop events from occuring when they otherwise would. When a player walks over a pickup for example, this function can stop them from getting it. cancelEvent is not compatible with all events.
Syntax
bool cancelEvent ()
Usage
cancelEvent must be called from inside an event handler (a function that is called when an event is triggered).
Here is a list of compatible events:
- onVehicleStartEnter
Returns
Returns true if the event was canceled successfully, false if the event is incompatible.
Example
This example stops the player huntedPlayer from entering a vehicle:
-- call 'stopVehicleEntry' whenever hunterPlayer is about to enter a vehicle: addEventHandler ( "onVehicleStartEnter", huntedPlayer, "stopVehicleEntry" ) function stopVehicleEntry ( theplayer, seat, jacked ) cancelEvent () -- stop the event from occuring end
See Also
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled