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

[Bug] - es_extended- Default Spawn Random Coords problem #1345

Closed
DARKAOFF opened this issue Apr 14, 2024 · 7 comments · Fixed by #1356
Closed

[Bug] - es_extended- Default Spawn Random Coords problem #1345

DARKAOFF opened this issue Apr 14, 2024 · 7 comments · Fixed by #1356
Assignees
Labels
bug Something isn't working

Comments

@DARKAOFF
Copy link

Esx/fivem last version

Es_extended

the default spawn configuration of players at creation does not work badly several positions configure, the players all spawn in the same place

@DARKAOFF DARKAOFF added the bug Something isn't working label Apr 14, 2024
@DARKAOFF DARKAOFF changed the title [Bug] - esx_script - Issue [Bug] - es_extended - Issue Apr 14, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in ESX Roadmap Apr 14, 2024
@Thekuca
Copy link
Contributor

Thekuca commented Apr 15, 2024

Send me your config.lua in es_extended and also check if you have a default value set on position in table users in database

@DARKAOFF
Copy link
Author

config.txt

@DARKAOFF
Copy link
Author

userData.coords = json.decode(result.position) or Config.DefaultSpawns[math.random(1, #Config.DefaultSpawns)]

with our correction it works now but there remains a problem, as this is random it is possible that a player spawns in the same place as another

@Gellipapa
Copy link
Contributor

userData.coords = json.decode(result.position) or Config.DefaultSpawns[math.random(1, #Config.DefaultSpawns)]

with our correction it works now but there remains a problem, as this is random it is possible that a player spawns in the same place as another

Hi! Exactly because it can happen randomly that the two numbers are entered twice, such a solution is not integrated in es_extended to always have a different number.

However, you should check your user table in the database to see if position is not set by default because if it is, it won't use this random coordinate logic.

@DARKAOFF
Copy link
Author

image

no I have nothing in the users table

@Gellipapa
Copy link
Contributor

@DARKAOFF Hi! Do you always spawn there or is there a case where you spawn somewhere else?

Because if you have few coordinates you might get the same coordinate every time during testing, it's not guaranteed that math.random will be random in the current implementation, so it might be the same coordinate twice or three times or x times depending on the length of the table.

It might be worth trying with 8-10 coordinates to see what happens.

@Gellipapa Gellipapa changed the title [Bug] - es_extended - Issue [Bug] - es_extended- Default Spawn Random Coords problem May 3, 2024
@Gellipapa
Copy link
Contributor

Hi! @DARKAOFF The fix will be available soon on the main branch. Thanks for your patience.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in ESX Roadmap May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants