AbortRemoteRequest: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(initial)
 
(Fix syntax)
Line 15: Line 15:


==Example==
==Example==
<section name="Shared" class="shared" show="true">
this example aborts all pending requests of currently running resource.
this example aborts all pending requests of currently running resource.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Revision as of 06:40, 8 October 2019

Aborts a fetchRemote or callRemote request.

Syntax

table 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)

</section>


This template will be deleted.

See Also