[Release] Save/Respawn the last player position with MySQL

Many of you are trying to know how to record the position of the players in the MySQL database, that’s why I propose this script which I hope will help more than one.

UPDATE Version 1.5 - 14/06/2017

  • MySQL Async Updated ( Requested )
  • Save auto when player leave the server ( Requested )

UPDATE V.1.4 - 24/04/2017

  • Add toggle Manual or Automatic Saving
  • Add “AutoSaveEnabled” parameter to select Auto or Manual saving
  • Add “TimerAutoSave” parameter to configure the timer delay between automatic saving
  • Add “TimerManualSave” parameter to configure the timer between manual saving (Protect Spam)

UPDATE v1.3 - 24/04/2017 – Fix spawn to last player connected
UPDATE v1.2 - 24/04/2017 – Add function respawn to last position

Requirements
Essentialmode

Installation
Download the resource here :

18 Likes

It’s work , thank you :slight_smile:

1 Like

Gonna try this ! :slight_smile: Thanks :slight_smile:

1 Like

Getting this error when importing to my database

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘’ at line 1

1 Like

Not working for me, i always spawn at the spawn par default.
But its write Position sauvegardee
And i have the coordinates in my database

It’s a mistake, i fixed that in my repository … delete the last , after NULL into sql file :wink:

1 Like

This script it’s just for record the position, there are an example to get the position from database if you want include into your gamemode spawn.

1 Like

Copy this into lastpos.sql file to fix the 1064 issue

ALTER TABLE users ADD COLUMN lastpos VARCHAR(255) DEFAULT NULL

the change is remvoe the , and ;

Would you know how to make position save apply in games?

Because its only s save position in the DB not a release position in the server !

I don"t know ! We have to add the release of the position ourselves

I don’t know i asked ZeCreeps how to

Guess that explains why it will save position but not restore it when reconnecting.

Try and maybe Check that the player is connecting then if it is true then have it restore the position the second the player spawns.

Yeah you right we saw this but im a noob in LUA, i just want to know how to do that :slight_smile:

We all had to start somewhere lol

yes its this but where place it
and what input in : if v.lastpos ~= “HERE” then

thats is the question ^^

i m back sorry i m not at home … the function it’s SetEntityCoords …
When i back i give you one solution :wink:

2 Likes

It’s a french server !

Admin will ban you if you speak french here