Advertisement
Guest User

Register/Login code

a guest
Nov 2nd, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.34 KB | None | 0 0
  1. // En haut du script
  2.  
  3. new incorrect_password = 0;  // j'initialise la variable
  4.  
  5.  
  6.  
  7. // Dans OnDialogResponse :
  8.  
  9. case DIALOG_LOGGER:
  10.         {
  11.             if ( !response ) return Kick ( playerid );
  12.             if( response )
  13.             {
  14.                 while(udb_hash(inputtext) != PlayerInfo[playerid][pPasse])
  15.                 {
  16.                   incorrect_password++;  // J'ajoute 1 à chaque fois que le mot de passe est incorrect
  17.                  
  18.                   if(incorrect_password==4) // Si la variable vaut 4 on kick le joueur :
  19.                   {
  20.                      Kick(playerid);
  21.                   }
  22.                  
  23.                   else // Sinon on lui redemande le mot de passe
  24.                   {
  25.                     ShowPlayerDialog(playerid,  DIALOG_LOGGER, DIALOG_STYLE_INPUT, "Connexion", "Mot de passe incorrect. Réessayez:", "Connexion", "Quitter");
  26.                   }
  27.                
  28.                
  29.                
  30.                
  31.                 }
  32.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPasse])
  33.                 {
  34.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  35.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pArgent]);
  36.                     EstLogger[playerid]=1;
  37.                     ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Connexion", "Vous êtes maintenant connecté à votre compte.", "Ok", "");
  38.                 }
  39.                
  40.                 return 1;
  41.             }
  42.  
  43.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement