qb-core
qb-core copied to clipboard
feat(core): add functions to retrieve online players by job name or type with optional on-duty check
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.