AbortRemoteRequest: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 5: Line 5:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
table abortRemoteRequest( request theRequest )
bool abortRemoteRequest( request theRequest )
</syntaxhighlight>
</syntaxhighlight>



Revision as of 13:33, 11 October 2019

Aborts a fetchRemote or callRemote request.

Syntax

bool abortRemoteRequest( request theRequest )

Required Arguments

Returns

Returns true on success, false when invalid request was provided

Example

this example aborts all pending requests of currently running resource.

function CMD_abortRequests()
    local requests = getRemoteRequests()
	
    for _, request in ipairs(requests) do
        abortRemoteRequest()
    end
end

addCommandHandler("abortrequests", CMD_abortRequests)


This template will be deleted.

See Also