exportFunction
Function
Server and Client
Online and Offline
Available since Server 1.0.0, Client 1.0.0
void exportFunction(string name, function Function)
The exportFunction function is used to export a function so it can be used in other resources.
Parameters
1) | string | name | The name of the exported function. |
2) | function | Function | The function to export. |
Return
void | This function doesn't return a value. |
Notes
- To use this function in another resource, use findResourceByName in the other resource, which returns a resource object. You can then use resource.exports or resource.getExport to access exported functions.
Examples
Example 1 - JavaScript:
bindEventHandler("OnResourceStart", thisResource, function(event, resource) {
exportFunction("testFunc", testFunc);
});
function testFunc(foo, bar) {
return true;
}
Compatibility
There isn't any compatibility information for this function.
Related
Server Related
exportFunction
reflection.call
reflection.clone
reflection.createFunction
reflection.move
reflection.tostring
Client Related
exportFunction
reflection.call
reflection.clone
reflection.createFunction
reflection.move
reflection.tostring