Player can't spawn when logging in
#1

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.
Reply
#2

You forgot SetPlayerSpawnInfo.
Reply
#3

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;
}
Reply
#4

Fixed nvm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)