Skip to content

Fixed iterating over online players for qb-core#12

Open
LordChunk wants to merge 1 commit intonpwd-community:mainfrom
LordChunk:fix/get-players
Open

Fixed iterating over online players for qb-core#12
LordChunk wants to merge 1 commit intonpwd-community:mainfrom
LordChunk:fix/get-players

Conversation

@LordChunk
Copy link

@LordChunk LordChunk commented Mar 19, 2023

npwd_services currently doesn't iterate over online players correctly when using qb-core. This PR correctly iterates over all online players by using for _, Player in pairs(players) do instead of for i = 1, #players do.

The problem can be reproduced on your own by joining, leaving and then joining a server while doing this, you should have a job which is listed in the app and be on duty. The first time you join, you will be listed in the app, but the second time you will not be listed.

@LordChunk
Copy link
Author

@project-error could someone be assigned to review these changes?

@BackSH00TER
Copy link

✅Tested this on my end and confirmed it does fix the issue.

Without this fix the Players are incorrectly being iterated over which results in no results rendering.

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.

2 participants