Problems with Tutorial
#1

When a player disconnect as he passes the tutorial and he reconnects afterwards, I would like him to be re-tp at the beginning of the tutorial. But, when I re-tp him after he login, he is teleported in the air.

It has been 2 days since I tried desperately to solve this problem, so please, help me.

Here is my OnPlayerRequestClass:
Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    TogglePlayerSpectating(playerid, 1);
	return 1;
}
Here is my OnPlayerConnect:
Код:
public OnPlayerConnect(playerid)
{
    new titlestring[50];
	PlayerLogged[playerid] = false;
	PlayAudioStreamForPlayer(playerid, "http://listen.radionomy.com/-top20-radio");
    for(new i = 0; i < 100; i++) { SendClientMessage(playerid, 0x00000000," "); }
	if(fexist(UserPath(playerid)))
	{
	    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
		format(titlestring, sizeof(titlestring), "{3091DB}Bienvenue %s !", GetPlayerNameEx(playerid));
   		SafeDialogEx(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, titlestring, "\n{69A9D8}Bienvenue sur Real Life Rфleplay !\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n    "MOTD_LOGIN"", "Connexion","Quitter");
	}
	else
	{
		format(titlestring, sizeof(titlestring), "{3091DB}Inscription:");
		SafeDialogEx(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, titlestring, "\n{69A9D8}Bienvenue sur Real Life Rфleplay !\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n    "MOTD_LOGIN"", "Inscription","Quitter");
	}
	TimerLogin[playerid] = SetTimerEx("Login", 30, 0, "d", playerid);
 	return 1;
}
My Player Spawn:
Код:
public OnPlayerSpawn(playerid)
{
	if(PlayerInfo[playerid][pInscri] == 1) return 0;
	{
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00);
		}
		SetCameraBehindPlayer(playerid);
	 	SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
	 	return 1;
 	}
}
An finally, my LOGIN dialog:
Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
            	new psswrdhashed[129];
                whp_hash(psswrdhashed, sizeof(psswrdhashed), inputtext);
                strdel(psswrdhashed, 127, 128);
                if(strcmp(psswrdhashed, PlayerInfo[playerid][pPass]) == 0)
                {
                    PlayerLogged[playerid] = true;
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pArgent]);
                    if(PlayerInfo[playerid][pTuto] == 1)
					{
					    TimerTuto[playerid] = SetTimerEx("Tuto", 500, 0, "d", playerid);
						SpawnPlayer(playerid);
				 	}
				 	if(PlayerInfo[playerid][pInscri] == 1)
				 	{
				 	    TimerCreation[playerid] = SetTimerEx("Creation", 500, 0, "d", playerid);
 	    			}
				 	return 1;
                }
                else
                {
                    format(titlestring, sizeof(titlestring), "{3091DB}Erreur d'authentification!");
                    SafeDialogEx(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, titlestring, "\n{DD2D2D}[Erreur] {EE3A3A}Mot de passe incorrect, rйessayez.\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n    "MOTD_LOGIN"", "Connexion","Quitter");
                }
            }
        }
Reply


Messages In This Thread
Problems with Tutorial - by ErwinK - 11.05.2017, 16:07
Re: Problems with Tutorial - by kloning1 - 11.05.2017, 16:14
Re: Problems with Tutorial - by elhanan - 11.05.2017, 16:17
Re: Problems with Tutorial - by ErwinK - 11.05.2017, 16:37
Re: Problems with Tutorial - by GoldenLion - 11.05.2017, 17:31
Re: Problems with Tutorial - by ErwinK - 11.05.2017, 18:03
Re: Problems with Tutorial - by GoldenLion - 11.05.2017, 18:06
Re: Problems with Tutorial - by ErwinK - 11.05.2017, 19:26
Re: Problems with Tutorial - by kloning1 - 11.05.2017, 23:52
Re: Problems with Tutorial - by ErwinK - 20.05.2017, 23:51

Forum Jump:


Users browsing this thread: 2 Guest(s)