Loading system failing
#10

Quote:
Originally Posted by Aly
Посмотреть сообщение
Now about the money and the skin, you'll have to set them after you confirm that the password is correct.
Something like:
Код:
case DIALOG_LOGIN:
		{
			if(!response)
				return Kick(playerid);
			else
			{
				if(!strlen(inputtext))
					return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Server - Login", "Wrong password\nTry again!", "Login", "Exit");
				if(PlayerInfo[playerid][pPass] == udb_hash(inputtext))
				{
					GivePlayerMoney(playerid, PlayerInfo[playerid][Cartera]);
					SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
					//Other part of your code
				}
				else
					return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Server - Login", "Wrong password\nTry again!", "Login", "Exit");
			}
		}
I have them like this:
Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    new Float:x, Float:y, Float:z, skin;
			 		skin = PlayerInfo[playerid][Skin];
			 		x = PlayerInfo[playerid][pPos_x];
			 		y = PlayerInfo[playerid][pPos_y];
			 		z = PlayerInfo[playerid][pPos_z];

					SetSpawnInfo(playerid, 0, skin, x, y, z, 0, 0, 0, 0, 0, 0, 0);
					StopAudioStreamForPlayer(playerid);
                    PlayerInfo[playerid][logged] = 1;
                    TogglePlayerSpectating(playerid, false);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][Cartera]);

				}
                else
                {
                    return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Server - Login", "Wrong password\nTry again!", "Login", "Exit");
                }
                return 1;
            }
        }
Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][logged]==1)
	{
		SetPlayerScore(playerid, PlayerInfo[playerid][Nivel]);
		SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
		GivePlayerMoney(playerid, PlayerInfo[playerid][Cartera]);
		StopAudioStreamForPlayer(playerid);
		SetPlayerPos(playerid, 1271.3654,181.0756,19.4705);
		SetCameraBehindPlayer(playerid);
    	PlayerInfo[playerid][logged] = 0;
	}
   	if(IsPlayerConnected(playerid))
	{
    	SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
    	SetPlayerToTeamColor(playerid);
    	TogglePlayerSpectating(playerid, 0);
        StopAudioStreamForPlayer(playerid);
     	SetCameraBehindPlayer(playerid);
     	SetTimerEx("payday", 60000, false, "f", playerid);
	}
	if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
    {
        SetPlayerPos(playerid, 1271.3654,181.0756,19.4705);
    }
    else
	{
		SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
 	}
    return 1;
}
Also, the PJ appears in the air, flying, where the cinematic has ended.
Reply


Messages In This Thread
Loading system failing - by Antenastyle - 19.05.2017, 17:33
Re: Loading system failing - by Aly - 19.05.2017, 17:39
Re: Loading system failing - by Antenastyle - 19.05.2017, 17:50
Re: Loading system failing - by Aly - 19.05.2017, 18:33
Re: Loading system failing - by Vince - 19.05.2017, 18:56
Re: Loading system failing - by Antenastyle - 19.05.2017, 21:37
Re: Loading system failing - by Aly - 19.05.2017, 22:52
Re: Loading system failing - by Antenastyle - 20.05.2017, 11:16
Re: Loading system failing - by Aly - 20.05.2017, 11:24
Re: Loading system failing - by Antenastyle - 20.05.2017, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)