From my experience what I would do is listen to these events on a server script (make sure its on the server side because I think these events only work on server side scripts):
- baseevents:onPlayerWasted
- baseevents:onPlayerKilled
- baseevents:onPlayerDied
and when they get triggered, I get all the on duty EMS/Firefighters sources and send a client event to them and from there you either display it with a dispatch or with a simple notification.
I did not test these baseevents yet, if they did not work then you can use on the client side a script that checks every 10 seconds (to keep it optimized) in a while loop if the player is dead or not, and when it comes back true you trigger a server event that get all the on duty EMS/Firefighters sources and send a client event to them and from there you either display it with a dispatch or with a simple notification.
I hope I helped, I am still new to fivem development and learning
1 Like