Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.22 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. //REGISTER
  4. //Enter password
  5.  
  6.  
  7.  
  8. if(dialogid == REGISTER_DIALOG_INPUT)
  9. {
  10. if(response == 1)
  11. {
  12. if(!inputtext[0])
  13. {
  14. ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Registracija", "Upisi zeljenu lozinku u mjesto za pisanje.","Registriraj","Odustani");
  15. return 1;
  16. }
  17.  
  18. new FilePath[128];
  19. format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", PlayerName(playerid));
  20.  
  21. new strdate[20], year,month,day;
  22. getdate(year, month, day);
  23.  
  24. new Ip[16];
  25. GetPlayerIp(playerid,Ip,sizeof(Ip));
  26.  
  27. new password = num_hash(inputtext);
  28. PlayerInfo[playerid][Password] = password;
  29. PlayerInfo[playerid][Registered] = 1;
  30. PlayerInfo[playerid][LoggedIn] = 1;
  31.  
  32. dini_Create(FilePath);
  33.  
  34. dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
  35.  
  36. dini_Set(FilePath,"Ip",Ip);
  37.  
  38. format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
  39. dini_Set(FilePath,"RegisteredDate",strdate);
  40.  
  41. dini_IntSet(FilePath,"Level",0);
  42.  
  43. dini_IntSet(FilePath,"Jailed",0);
  44. dini_IntSet(FilePath,"Frozen",0);
  45. dini_IntSet(FilePath,"Warnings", 0);
  46.  
  47. dini_IntSet(FilePath,"Money",0);
  48. dini_IntSet(FilePath,"Score",0);
  49. dini_IntSet(FilePath,"kills",0);
  50.  
  51.  
  52.  
  53. SendClientMessage(playerid, COLOR_GREY, " ");
  54. SendClientMessage(playerid, COLOR_GREY, "Registracija: Jedan korak je dovrsen (1/3 zavrseno)");
  55.  
  56. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Nova lozinka je uspjesno spremljena.");
  57. new string[256];
  58. format(string, sizeof(string), "Tvoja .NOVA. lozinka je: \'%s\'.", inputtext);
  59. SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
  60.  
  61. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  62. SendClientMessage(playerid, COLOR_LIGHTGREEN, "2 korak, sigurnosno pitanje");
  63. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Napisi svoje pitanje npr. moj datum rodjenja, u slucaju ako zaboravis lozinku!");
  64.  
  65.  
  66.  
  67. ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY, DIALOG_STYLE_INPUT, "Sigurnosno pitanje", "Napisi neko pitanje na koje ces znati odg. \nTocan odgovor ce biti trazen u sljedecem koraku", "OK", "Odustani");
  68.  
  69. return 1;
  70. }
  71. return ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Registracija", "Upisi svoju NOVU lozinku.","OK","Odustani");}
  72.  
  73. //Enter Safety Question
  74.  
  75. if(dialogid == REGISTER_DIALOG_SAFETY)
  76. {
  77. if(response == 1)
  78. {
  79. new FilePath[128];
  80. format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", PlayerName(playerid));
  81.  
  82. new string[128];
  83. format(string, sizeof(string), "%s", inputtext);
  84. SendClientMessage(playerid, COLOR_GREY, " ");
  85. SendClientMessage(playerid, COLOR_GREY, "Safety question:");
  86. SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
  87. SendClientMessage(playerid, COLOR_GREY, " ");
  88.  
  89. dini_Set(FilePath,"SafetyQuestion", string);
  90.  
  91.  
  92.  
  93. SendClientMessage(playerid, COLOR_GREY, "Registracija: Korak 2 Zavrsen! (2/3 zavrseno)");
  94. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  95. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Korak 3 odg. na sigurnosno pitanje");
  96. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Napisi odg. na pitanje koje si napisao prije par sekundi!");
  97.  
  98. ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY_ANSWER, DIALOG_STYLE_INPUT, "Sigurnosno pitanje", "Upisi tocan odgovor na pitanje koje si postavio", "OK", "Odustani");
  99.  
  100. return 1;
  101. }
  102. return 1;
  103. }
  104.  
  105. //Enter Answer for Safety Question
  106.  
  107. if(dialogid == REGISTER_DIALOG_SAFETY_ANSWER)
  108. {
  109.  
  110.  
  111.  
  112. if(response == 1)
  113. {
  114. new answer = num_hash(inputtext);
  115.  
  116. if(!inputtext[0])
  117. {
  118. ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY_ANSWER, DIALOG_STYLE_INPUT, "Sigurnosno pitanje", "Upisi tocan odgovor na pitanje koje si postavio", "OK", "Odustani");
  119. return 1;
  120. }
  121.  
  122. new FilePath[128];
  123. format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", PlayerName(playerid));
  124.  
  125. new string[128];
  126. format(string, sizeof(string), "%s", inputtext);
  127. SendClientMessage(playerid, COLOR_GREY, " ");
  128. SendClientMessage(playerid, COLOR_GREY, "Sigurnosno pitanje odgovor:");
  129. SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
  130. SendClientMessage(playerid, COLOR_GREY, " ");
  131.  
  132. PlayerInfo[playerid][SafetyAnswer] = answer;
  133. dini_IntSet(FilePath,"SafetyAnswer",PlayerInfo[playerid][SafetyAnswer]);
  134.  
  135.  
  136.  
  137. TextDrawHideForPlayer(playerid, Textdraw0);
  138. TextDrawHideForPlayer(playerid, Textdraw1);
  139. TextDrawHideForPlayer(playerid, Textdraw2);
  140. TextDrawHideForPlayer(playerid, Textdraw3);
  141. TextDrawHideForPlayer(playerid, Textdraw6);
  142. TextDrawHideForPlayer(playerid, Textdraw7);
  143.  
  144. SendClientMessage(playerid, COLOR_GREY, "Registracija korak 3 (3/3 zavrseno)");
  145. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Cestitamo uspijesno si kreirao svoj account/racun!");
  146. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Sljedeci put kada dodes na server morati ces se ulogirati sa svojom lozinkom!");
  147. SendClientMessage(playerid, COLOR_LIGHTGREEN, "Uzivaj na serveru!");
  148.  
  149. return 1;
  150. }
  151. return 1;
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement