SA-MP Forums Archive
Spawn Last Location - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Spawn Last Location (/showthread.php?tid=531636)



Spawn Last Location - RayC - 13.08.2014

Hello, I've been looking for a FS or some sort of coding that allows players to return to their last location when they login, can somebody help me please?


Re: Spawn Last Location - Faisal_khan - 13.08.2014

Wiki and ****** is your friend. Go learn scripting and then you will get it. Plus, if you scroll down to the bottom, you will see some related threads on this topic.

P.S. Its very easy but I am not gonna tell it to you. Best of Luck.


Re: Spawn Last Location - Sawalha - 13.08.2014

As Faisal told you, You could do search, i will not code it for you to make you script it yourself :P, Just details:
1. In your user's variable, Insert X, Y, Z Coordinates with Float tag (at the enum)

2. OnPlayerDisconnect, Save them with your saving system you use and use GetPlayerPos to get last position of player

3.OnPlayerSpawn Load the coordinates with your saving / loading system and Set player position with them ( SetPlayerPos )

easy :P


Re: Spawn Last Location - RayC - 13.08.2014

Thank you once again to both of you, I just wanted to know the basics, I didn't expect anybody to code it for me :P


Re: Spawn Last Location - GGW - 13.08.2014

here check this Post out , it will gonna help you : https://sampforum.blast.hk/showthread.php?tid=299791