Adding filter that filters the same city I'm registered

Adding filter that filters the same city I'm registered, for example in the upper field where it appears all members I wanted to add another filter side written by me, this function would filter all users who are in the same city that I am a member. Could you help me, please?

Forgive me for misspellings, I am Brazilian and I have no knowledge of English, I need this help I found a related content on the link below:

https://premium.wpmudev.org/blog/how-to-create-a-custom-buddypress-members-directory/

Thank you very much for your help.