Guest User

Untitled

a guest
Jul 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.70 KB | None | 0 0
  1. {
  2.     new pName[MAX_PLAYER_NAME];
  3.     GetPlayerName(playerid, pName, sizeof(pName));
  4.     new string[300];
  5.     format(string, sizeof(string), PointSauvegardes, pName);
  6.     if(dialogid == 1)
  7.     {
  8.         if(response == 1)
  9.         {
  10.             if(strlen(inputtext) == 0)
  11.             {
  12.                 ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "{Inscription}", "Veuillez choisir un mot de passe.", "Continuer", "Annuler");
  13.             }
  14.             else
  15.             {
  16.                 dini_Create(string);
  17.                 dini_Set(string, "Mot de passe", inputtext);
  18.                 dini_IntSet(string, "Admin", 0);
  19.                 dini_IntSet(string, "Level", 0);
  20.                 dini_IntSet(string, "Cash", 1000);
  21.                 dini_IntSet(string, "Vitesse", 0);
  22.                 dini_IntSet(string, "Saut", 0);
  23.                 pInfo[playerid][pLogged] = 1;
  24.                 pInfo[playerid][pAdmin] = dini_Int(string, "Admin");
  25.                 pInfo[playerid][pLevel] = dini_Int(string, "Level");
  26.                 pInfo[playerid][pCash] = dini_Int(string, "Cash");
  27.                 pInfo[playerid][pVitesse] = dini_Int(string, "Vitesse");
  28.                 pInfo[playerid][pSaut] = dini_Int(string, "Saut");
  29.                 SetPlayerScore(playerid, pInfo[playerid][pLevel]);
  30.                 GivePlayerMoney(playerid, pInfo[playerid][pCash]);
  31.             }
  32.         }
  33.         else
  34.         {
  35.             SendClientMessage(playerid, Blanc, "[Inscription] Vous avez décider d'annuler votre inscription. A bientôt.");
  36.             Kick(playerid);
  37.         }
  38.         return 1;
  39.     }
  40.     if(dialogid == 2)
  41.     {
  42.         if(response == 1)
  43.         {
  44.             if(strlen(inputtext) == 0)
  45.             {
  46.                 ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{Connexion}", "Veuillez saisir votre mot de passe.", "Continuer", "Annuler");
  47.             }
  48.             else
  49.             {
  50.                 new pw[450];
  51.                 pw = dini_Get(string, "Pass");
  52.                 if(strcmp(inputtext, pw) == 0)
  53.                 {
  54.                     pInfo[playerid][pLogged] = 1;
  55.                     pInfo[playerid][pAdmin] = dini_Int(string, "Admin");
  56.                     pInfo[playerid][pLevel] = dini_Int(string, "Level");
  57.                     pInfo[playerid][pCash] = dini_Int(string, "Cash");
  58.                     pInfo[playerid][pVitesse] = dini_Int(string, "Vitesse");
  59.                     pInfo[playerid][pSaut] = dini_Int(string, "Saut");
  60.                     SetPlayerScore(playerid, pInfo[playerid][pLevel]);
  61.                     GivePlayerMoney(playerid, pInfo[playerid][pCash]);
  62.                 }
  63.                 else
  64.                 {
  65.                     SendClientMessage(playerid, Rouge, "[ERREUR] Le mot de passe est incorrect !");
  66.                     ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{Connexion}", "Veuillez saisir votre mot de passe.", "Continuer", "Annuler");
  67.                 }
  68.             }
  69.         }
  70.         else
  71.         {
  72.             SendClientMessage(playerid, Blanc, "[Inscription] Vous avez décider d'annuler votre inscription. A bientôt.");
  73.             Kick(playerid);
  74.         }
  75.         return 1;
  76.     }
  77.     return 1;
  78. }
Add Comment
Please, Sign In to add comment