How to spawn the player automatically after log in - 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: How to spawn the player automatically after log in (
/showthread.php?tid=628058)
How to spawn the player automatically after log in -
AndreiWow - 05.02.2017
I use a textdraw to log in, he clicks on login/register then he will enter his details, after that he is supposed to spawn to his last location, but this happens:
http://imgur.com/a/Uh3cl (the image with the guy in the air)
If the player will press SPAWN it will spawn him at his last location, I want this to happen automatically without him pressing SPAWN..

It worked before, not sure whats wrong now..
I use this after the player logs in
PHP код:
for(new i = 0; i < 26; i++)
{
PlayerTextDrawDestroy(playerid, loginscreen[i][playerid]);
}
SetCameraBehindPlayer(playerid);
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, 0);
CancelSelectTextDraw(playerid);
Re: How to spawn the player automatically after log in -
Eoussama - 05.02.2017
Trying toggling players spectating first, then spawn them
Re: How to spawn the player automatically after log in -
AndreiWow - 05.02.2017
I added a timer that is called at 200 ms after the player logs in, not sure if it is the best choice but the player is spawned atleast
Re: How to spawn the player automatically after log in -
GoldenLion - 05.02.2017
You don't need to use SpawnPlayer if you are using TogglePlayerSpectating. Removing player from spectating mode spawns them.
Re: How to spawn the player automatically after log in -
silverms - 05.02.2017
did u try to add SpawnPlayer(playerid); after he finish from the textdraws?