Guest User

GTA ONLINE

a guest
Aug 18th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.84 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3.     new pName[MAX_PLAYER_NAME], path[200];
  4.     GetPlayerName(playerid, pName, sizeof(pName));
  5.     format(path, sizeof(path), "/users/%s.ini", pName);
  6.    
  7.     switch(dialogid)
  8.     {
  9.         case DIALOG_REGISTER:
  10.         {
  11.             if(!response)
  12.             {
  13.                 Kick(playerid);
  14.             }
  15.             else
  16.             {
  17.                 new pwlength = strlen(inputtext);
  18.                 if(pwlength > 0)
  19.                 {
  20.                     dini_Create(path);
  21.                     dini_Set(path, "Mot de passe", inputtext);
  22.                     ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST,"Inscription", "Homme\r\nFemme", "Valider", "");
  23.                    
  24.                 }
  25.                 else
  26.                 {
  27.                     ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Inscription", "Entrez un mot de passe ici :", "Valider", "Annuler");
  28.                 }
  29.             }
  30.            
  31.         }
  32.         case DIALOG_REGISTER2:
  33.         {
  34.             if(!response)
  35.             {
  36.                 dini_Remove(path);
  37.                 Kick(playerid);
  38.             }
  39.             else
  40.             {
  41.                 dini_IntSet(path, "sex", listitem);
  42.                 ShowPlayerDialog(playerid,DIALOG_REGISTER3, DIALOG_STYLE_INPUT,"Inscription", "Votre âge ? :", "Valider", "");
  43.             }
  44.         }
  45.         case DIALOG_REGISTER3:
  46.         {
  47.             if(!response)
  48.             {
  49.                 dini_Remove(path);
  50.                 Kick(playerid);
  51.             }
  52.             else
  53.             {
  54.                 dini_Set(path, "age", inputtext);
  55.                 ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Inscription", "Votre inscription c'est très bien déroulé merci !", "Continuer", "");
  56.             }
  57.         }
  58.         case DIALOG_REGISTER4:
  59.         {
  60.             pInfo[playerid][sex] = dini_Int(path, "sex");
  61.             pInfo[playerid][age] = dini_Int(path, "age");
  62.             pInfo[playerid][cash] = dini_IntSet(path, "cash", 10000);
  63.             GivePlayerMoney(playerid, 10000);
  64.             pInfo[playerid][logged] = 1;
  65.         }
  66.         case DIALOG_LOGIN:
  67.         {
  68.             if(!response)
  69.             {
  70.                 Kick(playerid);
  71.             }
  72.             else
  73.             {
  74.                 new pwlength = strlen(inputtext);
  75.                 if(pwlength > 0)
  76.                 {
  77.                     new pw[100];
  78.                     format(pw, sizeof(pw), "%s", dini_Get(path, "Mot de passe"));
  79.                     if(strcmp(inputtext, pw) == 0)
  80.                     {
  81.                         pInfo[playerid][sex] = dini_Int(path, "sex");
  82.                         pInfo[playerid][age] = dini_Int(path, "age");
  83.                         GivePlayerMoney(playerid, pInfo[playerid][cash]);
  84.                         pInfo[playerid][logged] = 1;
  85.                     }
  86.                     else
  87.                     {
  88.                         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Connection", "Entrez votre mot de passe ici :", "Valider", "Annuler");
  89.                     }
  90.                 }
  91.             }
  92.         }
  93.     }
  94.     return 1;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment