Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onResourceLoadStateChange not triggering #3304

Closed
1 task done
TracerDS opened this issue Jan 30, 2024 · 4 comments
Closed
1 task done

onResourceLoadStateChange not triggering #3304

TracerDS opened this issue Jan 30, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@TracerDS
Copy link
Contributor

Describe the bug

onResourceLoadStateChange event is not triggering at all

Steps to reproduce

  1. Create 2 resources
  2. Paste this codeblock into resource1
addEventHandler('onResourceLoadStateChange', root, function(res, oldState, newState)
    iprint(res, 'changed. Old state:', oldState, 'New state:', newState)
end)
  1. Start resource1
  2. Start resource2
  3. No output

Version

Server: MTA:SA Server v1.6-release-22351
Client: Multi Theft Auto v1.6-release-22385

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@TracerDS TracerDS added the bug Something isn't working label Jan 30, 2024
@bum8hj
Copy link
Contributor

bum8hj commented Jan 30, 2024

I believe loading/unloading is different from starting/stopping. As far as I know, it's referring to when (for example) a resource is removed from the resources directory and the resources are refreshed with refreshResources()

@TracerDS
Copy link
Contributor Author

I believe loading/unloading is different from starting/stopping. As far as I know, it's referring to when (for example) a resource is removed from the resources directory and the resources are refreshed with refreshResources()

Oh, yeah. After physically removing the resource from the resources folder it triggered. So its only when a resource is removed or added to the resources folder.
But it should still trigger for resource stopping/starting nonetheless

@bum8hj
Copy link
Contributor

bum8hj commented Jan 30, 2024

But it should still trigger for resource stopping/starting nonetheless

Well, stopping and starting a resource doesn't change the load state (i.e. the resource folder is still there).
We have onResourceStop and onResourceStart for that.

@TracerDS
Copy link
Contributor Author

But it should still trigger for resource stopping/starting nonetheless

Well, stopping and starting a resource doesn't change the load state (i.e. the resource folder is still there). We have onResourceStop and onResourceStart for that.

Right, forgot it just changes the state and not the loading state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants