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:
Here is my OnPlayerConnect:
My Player Spawn:
An finally, my LOGIN dialog:
It has been 2 days since I tried desperately to solve this problem, so please, help me.
Here is my OnPlayerRequestClass:
Code:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return 1;
TogglePlayerSpectating(playerid, 1);
return 1;
}
Code:
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;
}
Code:
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;
}
}
Code:
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");
}
}
}