qb-core icon indicating copy to clipboard operation
qb-core copied to clipboard

feat(core): add functions to retrieve online players by job name or type with optional on-duty check

Open MrNewb opened this issue 6 months ago • 0 comments

Description

Adds two utility functions to retrieve online players by either job name or job type, with optional filtering for on-duty status. While the logic is a bit nested, this approach avoids unnecessary function splitting and keeps related behavior in a single place. Although I'm not entirely satisfied with the nesting, this structure felt like a reasonable trade-off between readability and reusability.

This method could also serve as a foundation for deprecating older job-check functions, should the maintainer choose to consolidate similar logic in the future.

Checklist

  • [X] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [] My code fits the style guidelines.
  • [ ] My PR fits the contribution guidelines.

MrNewb avatar May 23 '25 08:05 MrNewb