cancelLatentEvent | Multi Theft Auto: Wiki Skip to content

cancelLatentEvent

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.


Stops a latent event from completing

Syntax

cancelLatentEvent ( )

Code Examples

server
-- Cancel triggerLatentServerEvent directly after execution.
addCommandHandler("cancelLatentEvent",
function ()
triggerLatentServerEvent("exampleEvent",3000,false,localPlayer)
-- Get all your active handles, when you executed the command: /cancelLatentEvent
local handles = getLatentEventHandles() -- Returns a table.
local handle = handles[#handles] -- Get the latest handle.
if cancelLatentEvent(handle) then -- Cancel it!
outputChatBox("Successfully cancelled!",0,200,0)
end
end)