--------------------------------------------------
-- Cleanup ---------------------------------------
-- Always leave a space cleaner than you found it.
--------------------------------------------------
AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
ClearPedTasksImmediately(PlayerPedId())
--- do something on startup
end
end)