Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MrNewb
Copy link

@MrNewb MrNewb commented May 23, 2025

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

  • 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.

…ype with optional on-duty check

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant