Skip to content
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

[SUGGESTION] Return to closest configured hospital on respawn #53

Open
nzkfc opened this issue Jun 5, 2023 · 4 comments
Open

[SUGGESTION] Return to closest configured hospital on respawn #53

nzkfc opened this issue Jun 5, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@nzkfc
Copy link

nzkfc commented Jun 5, 2023

The problem

When you die, you go to one hospital

Ideal solution

Game should calculate closest hospital and send you there to the configured beds.

Alternative solutions

No

Additional context

Similar to this: qbcore-framework/qb-ambulancejob#299

But also include going to nearest hospital when a player holds E to re-spawn.

@nzkfc nzkfc added the enhancement New feature or request label Jun 5, 2023
@ChatDisabled
Copy link
Member

You are suggesting we steal QBCore code?! Deal

@nzkfc
Copy link
Author

nzkfc commented Jun 5, 2023 via email

@YvanCywan
Copy link
Member

YvanCywan commented Jun 6, 2023

Rip, didn't work.

But I should be able to take a look at this within the next few days.

@YvanCywan YvanCywan self-assigned this Jun 6, 2023
@Manason
Copy link
Member

Manason commented Jun 6, 2023

To give some context on this issue, there are two different code paths for re-spawning at the hospital. One is client side, when the client checks-in at the front desk, they search for the nearest bed and go to it.

The second code path is server side when respawning. The server checks the list of beds for the first one not taken and spawns the client there. Some refactoring to bring these two code paths in alignment would clean-up some tech debt and fix this issue.

Things to keep in mind

  • players not in jail should not respawn at the jail hospital, but it does make sense that they can check-in there.
  • players should otherwise respawn in closest bed not taken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

4 participants