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