Called before a resource starts. This event can be canceled to prevent this resource from starting.
string resourceName
This example prevents any resource called 'pineapple' from starting.
AddEventHandler('onResourceStarting', function(resourceName)
if resourceName == 'pineapple' then
CancelEvent()
end
end)
// in the class constructor
EventHandlers["onResourceStarting"] += new Action<string>(OnResourceStarting);
// delegate method
private void OnResourceStarting(string resourceName)
{
if (resourceName == "pineapple")
{
CancelEvent();
}
}
on("onResourceStarting", (resourceName) => {
if (resourceName === "pineapple") {
CancelEvent();
}
});