Called while a resource stops.
string resourceName
This example prints the name of the current resource, when stopped.
AddEventHandler('onResourceStop', function(resourceName)
if (GetCurrentResourceName() ~= resourceName) then
return
end
print('The resource ' .. resourceName .. ' was stopped.')
end)
// in the class constructor
EventHandlers["onResourceStop"] += new Action<string>(OnResourceStop);
// delegate method
private void OnResourceStop(string resourceName)
{
if(GetCurrentResourceName() != resourceName) return;
Debug.WriteLine($"The resource {resourceName} was stopped.");
}
on("onResourceStop", (resourceName) => {
if(GetCurrentResourceName() != resourceName) {
return;
}
console.log(`The resource ${resourceName} has been stopped.`)
});