SA-MP Forums Archive
Player can't spawn when logging 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: Player can't spawn when logging in (/showthread.php?tid=644461)



Player can't spawn when logging in - ItzColaBoi - 08.11.2017

The script we're making should contain a skin saving and skipping class selection when logging in.The issue with this is that when player tries to log in,nothing happens.Just like this: https://imgur.com/gallery/9PfVe
Login case:
Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SetPVarInt(playerid,"Alevel",PlayerInfo[playerid][pALevel]);
                    SetPVarInt(playerid,"VIP",PlayerInfo[playerid][pVIP]);
                    SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
OnPlayerSpawn:
Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerInterior(playerid, 0);
	if(PlayerInfo[playerid][NewReg] == 0)
	{
		SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
 		SetPlayerPos(playerid, PlayerInfo[playerid][Xpos], PlayerInfo[playerid][Ypos], PlayerInfo[playerid][Zpos]+0.3);
	}
	return 1;
}
Thanks in advance.


Re: Player can't spawn when logging in - ToiletDuck - 08.11.2017

You forgot SetPlayerSpawnInfo.


Re: Player can't spawn when logging in - TomRedlake - 08.11.2017

Yeah, that happend to me too.

Fix it with this:
Код:
public OnPlayerRequestClass(playerid, classid)
{
 	SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
	return 1;
}



Re: Player can't spawn when logging in - ItzColaBoi - 08.11.2017

Fixed nvm.