[Ajuda] Salvamento DOF2
#1

Alguem ajuda ?

Eu fiz um sistema de Registo / Login , no entanto ele estб crashando o servidor quando o jogador se regista .

pawn Code:
//OnPlayerConnect
  new arquivo[MAX_PLAYER_NAME+10], nome[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nome, sizeof(nome));
  format(arquivo, sizeof(arquivo), "Contas/%s.ini", nome);
  if(DOF2_FileExists(arquivo))
  {
   ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,"Login :", "A sua conta jб se encontra\n registada , insira a sua password para fazer login. ", "Confirmar", "Sair");
  }
  if(!DOF2_FileExists(arquivo))
  {
   ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,"Registo :", "A sua conta nгo se encontra\n registada na nossa base de dados , por favor\n insira uma password para se registar.", "Confirmar", "Cancelar");
  }
pawn Code:
//Ondialogresponse
   new arquivo[MAX_PLAYER_NAME+10], nome[MAX_PLAYER_NAME];
   GetPlayerName(playerid, nome, sizeof(nome));
   format(arquivo, sizeof(arquivo), "Contas/%s.ini", nome);
   
    if(dialogid == 1)
    {
     if(!response)
      {
      SendClientMessage(playerid, COLOR_RED, "Vocк nгo efectuou o login , entгo foi kikado.");
      Kick(playerid);
      }
     if(response)
      {
      new password[MAX_PLAYERS];
      format(password, sizeof(password), "%s", inputtext);
      PlayerInfo[playerid][pSenha] = password[playerid];
      DOF2_CreateFile(arquivo);
      DOF2_SetString(arquivo, "Senha", PlayerInfo[playerid][pSenha]);
      DOF2_SaveFile();
      ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,"Login :", "A sua conta jб se encontra\n registada , insira a sua password para fazer login. ", "Confirmar", "Sair");
      }
    }
   
   
    if(dialogid == 2)
    {
     if(!response)
      {
      SendClientMessage(playerid, COLOR_RED, "Vocк nгo efectuou o login , entгo foi kikado.");
      Kick(playerid);
      }
     if(response)
     {
      new senha[128];
      format(senha, sizeof(senha), "%s", DOF2_GetString(arquivo, "Senha"));
      print(senha);
      PlayerInfo[playerid][pSenha] = senha[playerid];
      new password[MAX_PLAYERS];
      format(password, sizeof(password), "%s", inputtext);
      if(password[playerid] == PlayerInfo[playerid][pSenha])
       {
       SendClientMessage(playerid, COLOR_BLUE, "Vocк logou-se.");
       SpawnPlayer(playerid);
       }
      else
       {
       SendClientMessage(playerid, COLOR_BLUE, "Vocк errou a password , tente novamente");
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,"Login :", "A sua conta jб se encontra\n registada , insira a sua password para fazer login. ", "Confirmar", "Sair");
       }
     }
     }
Reply


Messages In This Thread
Salvamento DOF2 - by Tugamars - 17.12.2013, 19:59
Re: Salvamento DOF2 - by DannielCooper - 17.12.2013, 21:17
Re: Salvamento DOF2 - by PT - 17.12.2013, 21:19
Re: Salvamento DOF2 - by Tugamars - 17.12.2013, 21:30
Re: Salvamento DOF2 - by Don_Speed - 17.12.2013, 21:48
Re: Salvamento DOF2 - by Tugamars - 17.12.2013, 22:27

Forum Jump:


Users browsing this thread: 1 Guest(s)