ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. wasEventCancelled

Function

wasEventCancelled

Server and clientEventsIdentical to MTA:SA

Checks whether the current event was cancelled with cancelEvent in an earlier handler; outside an event - whether the last event was cancelled.

Syntax

bool wasEventCancelled()

Returns

true when cancelled.

Example

addEventHandler("onPlayerChat", root, function(message)
    if wasEventCancelled() then return end
    outputServerLog("CZAT: " .. getPlayerName(source) .. ": " .. message)
end, true, "low")

See also