Oblivion_UFF

this...

Sep 21st, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1.  
  2. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3. {
  4. switch( dialogid )
  5. {
  6. case DIALOG_REGISTER:
  7. {
  8. if (!response) return Kick(playerid);
  9. if(response)
  10. {
  11. if(!strlen(inputtext))
  12. return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "You have entered an invalid password.\n\nType your password below to register a new account.","Register","Quit");
  13.  
  14. new Hpass[129];
  15. WP_Hash(Hpass,sizeof(Hpass), inputtext);
  16.  
  17. new INI:File = INI_Open(UserPath(playerid));
  18. INI_SetTag(File,"data");
  19. INI_WriteString(File,"Password", Hpass);
  20. INI_Close(File);
  21. PlayerInfo[playerid][posX] = 1981.6018;
  22. PlayerInfo[playerid][posY] = -2484.5366;
  23. PlayerInfo[playerid][posZ] = 13.5391;
  24. PlayerInfo[playerid][pVW] = 0;
  25. PlayerInfo[playerid][pInterior] = 0;
  26. PlayerInfo[playerid][pMoney] = 2500;
  27. PlayerInfo[playerid][pHealth] = 100;
  28. PlayerInfo[playerid][pSkin] = 299;
  29.  
  30. SetSpawnInfo(playerid, 0, 0, 1981.6018,-2484.5366,13.5391, 0, 0, 0, 0, 0, 0, 0);
  31. SpawnPlayer(playerid);
  32.  
  33. SendClientMessage(playerid, -1, "Congratulation, you have successfully registered on our server!");
  34. SendClientMessage(playerid, -1, "You have been given 2500$ to start in the city!");
  35. SendClientMessage(playerid, -1, "Use /help for more information!");
  36. }
  37. }
  38.  
  39. case DIALOG_LOGIN:
  40. {
  41. new
  42. String[100];
  43.  
  44. if(!response) return Kick(playerid);
  45. if(response)
  46. {
  47. new Hpass[129];
  48. WP_Hash(Hpass,sizeof(Hpass),inputtext);
  49. if(!strcmp(Hpass, PlayerInfo[playerid][pPass], false))
  50. {
  51. if(PlayerInfo[playerid][pBan] == 1)
  52. {
  53. Kick(playerid);
  54. }
  55. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  56. SetSpawnInfo(playerid, 0, 0, PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ], PlayerInfo[playerid][posA], 0, 0, 0, 0, 0, 0);
  57. SpawnPlayer(playerid);
  58. SendClientMessage(playerid, -1, "You have successfully logged in.");
  59. }
  60. else
  61. {
  62. format(String, sizeof(String), "Welcome back, %s. \n\nYou have entered an incorrect password.\n\nType your password below to login.", GetName(playerid));
  63. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login", String,"Login","Quit");
  64. }
  65. return 1;
  66. }
  67. }
  68. }
  69. return 1;
  70. }
Add Comment
Please, Sign In to add comment