C # How do I know when a player disconnects from the server?

Hello, I have a small problem, I program a plugin in C # for my FiveM server and I would like to know if it is possible to know when a player disconnects or know if he is disconnected from the server. Do you have answers to give me? thank you in advance

One magic word. Events.

You can add an event handler (like you can in Lua) to the playerDropped event.

Thank you for your reply ! I’ll try this right now