er2.resetCallback 44
Unassign a callback by it's Id.
Return value
Return Type | Description |
---|---|
bool | True if the callback was correctly unassigned |
Parameters
Parameter | Type | Description |
---|---|---|
1 | string | Id of the callback to unassign |
Examples
Example 175
-- Define any Lua function as your callback.
function MyCustomCallback(spawnedUnit)
print('MyCustomCallback called with parameter: ' .. spawnedUnit)
end
-- Register the callback from Lua. In this example the callback will be called every time a soldier is spawned.
er2.setCallback("soldier_spawned", MyCustomCallback)
-- Do something...
-- Reset the callback, so it will no longer be called
er2.resetCallback("soldier_spawned")