mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
12f92e33a4c1cf564682723da7b637331fb2e31a
Core.SavePlayer already refuses to save a player whose spawned flag is not set,
because an unspawned player has no server-side ped and getCoords/health return
0,0,0 / 0. Core.SavePlayers, the bulk autosave that runs every few minutes and on
restart/shutdown, had no such guard and saved every player in ESX.Players.
A player still in the load or character-selection window when the autosave fires
gets their row overwritten with position 0,0,0 and health 0. On the next load the
default-spawn fallback does not kick in, since a decoded {"x":0.0,...} is truthy,
so they spawn at the world origin, and with SaveDeathStatus on, dead.
Guard the loop with the same spawned check, and skip the query entirely when no
spawned player remains.
Tested on artifact 25770: forced a connected player to spawned=false and ran
saveall. Before, the player's row was overwritten (the save ran); after, the row
was left untouched and no save was issued.
ESX Legacy
Discord - Website - Documentation
Want more resources? You can browse the Cfx.re Releases board for more!
ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM
💗 Supporters
Interested in helping us? Take a look at our patreon
| We would like to sincerely thank the following donors who helped fund the development of ESX. |
|---|
| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong |
| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol |
| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum |
| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community |
Description
Languages
JavaScript
62.3%
Lua
34.8%
TypeScript
1.2%
HTML
0.8%
CSS
0.7%
Other
0.2%