Called after a resource starts.
string resourceName
This example prints the name of the resource it was in, upon start.
AddEventHandler('onClientResourceStart', function (resourceName)
if(GetCurrentResourceName() ~= resourceName) then
return
end
print('The resource ' .. resourceName .. ' has been started on the client.')
end)
// In class constructor
EventHandlers["onClientResourceStart"] += new Action<string>(OnClientResourceStart);
// Delegate method
// - assuming `using static CitizenFX.Core.Native.API`
private void OnClientResourceStart(string resourceName)
{
if(GetCurrentResourceName() != resourceName) return;
Debug.WriteLine($"The resource {resourceName} has been started on the client.");
}
on("onClientResourceStart", (resourceName) => {
if(GetCurrentResourceName() != resourceName) {
return;
}
console.log(`The resource ${resourceName} has been started on the client.`)
});