GetRemoteRequestInfo
Jump to navigation
Jump to search
Gets informations of an fetchRemote or callRemote request info.
Syntax
bool GetRemoteRequestInfo ( request theRequest )
Required Arguments
- theRequest: the element returned from fetchRemote or callRemote
Returns
Returns a table when valid, false otherwise
Example
Click to collapse [-]
ServerThis example gets infos about all pending requests
function CMD_requestInfo(player, _, resourceName) local res = resourceName and getResourceFromName(resourceName) or not resourceName and nil if(res == false) then outputServerLog("There is no resource named '" .. resourceName .. "'") return elseif(res and getResourceState(res) ~= "running") then outputServerLog("The provided resource '" .. resourceName .. "' is not running") return end local requests = getRemoteRequests(res) for _, request in ipairs(requests) do local requestInfo = getRemoteRequestInfo(request) if(requestInfo) then iprint(requestInfo) end end end addCommandHandler("requestinfo", CMD_requestInfo) end addCommandHandler("requestinfo", CMD_requestInfo)
Click to collapse [-]
ClientThis example gets infos about all pending requests
function CMD_requestInfo(player, _, resourceName) local res = resourceName and getResourceFromName(resourceName) or not resourceName and nil if(res == false) then outputChatBox("There is no resource named '" .. resourceName .. "'") return elseif(res and getResourceState(res) ~= "running") then outputChatBox("The provided resource '" .. resourceName .. "' is not running") return end local requests = getRemoteRequests(res) for _, request in ipairs(requests) do local requestInfo = getRemoteRequestInfo(request) if(requestInfo) then iprint(requestInfo) end end end addCommandHandler("requestinfo", CMD_requestInfo)
This template will be deleted.
See Also
- abortRemoteRequest
- call
- fetchRemote
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceName
- getResourceRootElement
- getResourceState
- getThisResource
- getRemoteRequests
- getRemoteRequestInfo