This is a highly optimized script compared to others that can be found that manages the player’s position at disconnection and reconnection. Where other scripts make a SQL query, this one saves them intelligently.
The basic configuration performs a backup of all players every 10 minutes. Other backups are mainly handled when the player logs off or when the /save command is executed in the console (useful for restarting the server). You can change the configuration as you wish.
He is compatible with all SQL databases. You just will need to enter the name of your lastPos column of your database inside the server/config.lua file. It will also treat your lastPos field to use it (be it an array, a string, a null value, etc …) Don’t be unhappy because you don’t have the same type of column as the others!
The script will automatically look for the latest version and notify you when a new update is available (possibility to disable this).
Set the configuration in the server/config.lua file.
Have fun !
Do you have a problem with the script ?
If you encounter a general problem or a personal problem, contact me and I will try to help you!
About me
I am a French developer.
Programming languages that I know: Html5 / Css3 / Php / MySQL / Lua.
I’m currently training to become a php / symfony application developer
I’m currently looking for a developer who can help me develop some scripts because i’m short of time.
I can also help you learn development on fivem because i’m generous.
You can customize the configuration of the time between the updates in the config.lua file.
But every 10 seconds it is not recommended :
To explain the operation in more detail:
All players have their own object. The position of the object (for each player) is saved every 6 seconds. This is the system for saving SQL queries to the database.
To save the position in the database this happens every 10 minutes (by default), when a player disconnects or when the server administrator executes the save command in the console.
It needs to be around 10 secs or less, im making a dispatch system for fiveM(To monitor cars on screen) so i need to update the position every 10 seconds or less.