Function
call
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
getResourceFromNameReturns the handle of the resource with the given name (the folder name inresources/), also when the resource is not running. Pass the handle tostartResource,getResourceState,calland other resource functions.getResourceExportedFunctionsReturns the names of functions a resource exports inmeta.xml(<export function="..."/>). In the current server version the list is empty.