ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. call

Function

call

Server and clientResourcesIdentical to MTA:SA

Calls a function exported by another resource (<export function="name"/> in its meta.xml) and returns its results. exports.resource:function(...) does the same. If the resource does not exist or is not running, a clear message appears in the console.

Syntax

mixed call(resource theResource, string functionName [, any ...])

Arguments

theResourceresource
The resource (a handle or a name).
functionNamestring
The exported function name.
...any, optional
Function arguments.

Returns

The function's results or false.

Example

local money = call(getResourceFromName("bank"), "getBalance", player)
-- to samo krócej:
local same = exports.bank:getBalance(player)

See also