AbortRemoteRequest: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix rev)
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0158|1.5.7|20307|
Aborts a [[FetchRemote|fetchRemote]] or [[CallRemote|callRemote]] request.
Aborts a [[FetchRemote|fetchRemote]] or [[CallRemote|callRemote]] request.
 
}}
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Revision as of 19:52, 10 October 2020

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)
Minimum server version 1.5.7-9.20307
Minimum client version 1.5.7-9.20307

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.5.7-9.20307" client="1.5.7-9.20307" />

See Also