Advertisement
Guest User

fullcode

a guest
Jul 15th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. switch(dialogid)
  4. {
  5. case DIALOG_REGISTER:
  6. {
  7. if(!response) return Kick(playerid);
  8. if(response)
  9. {
  10. if(!strlen(inputtext))
  11. {
  12. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Regisztráció", "Adj meg egy jelszót:", "Rendben", "Mégsem");
  13. return 1;
  14. }
  15. new hash[129];
  16. WP_Hash(hash, sizeof(hash), inputtext);
  17. new INI:file = INI_Open(Path(playerid));
  18. INI_WriteString(file, "Password", hash);
  19. INI_WriteInt(file, "AdminLevel", 0);
  20. INI_WriteInt(file, "Money", 0);
  21. INI_WriteInt(file, "Score", 0);
  22. INI_WriteInt(file, "Muted", 0);
  23. INI_WriteInt(file, "Frozen", 0);
  24. INI_WriteInt(file, "Warnings", 0);
  25. INI_WriteInt(file, "Duty", 0);
  26. INI_WriteInt(file, "NoPM", 0);
  27. INI_WriteInt(file, "Kills", 0);
  28. INI_WriteInt(file, "Deaths", 0);
  29. INI_Close(file);
  30. RepeatedAttempts[playerid] = 0;
  31. return 1;
  32. }
  33. }
  34. case DIALOG_LOGIN:
  35. {
  36. if(!response) return Kick(playerid);
  37. if(response)
  38. {
  39. new hash[129];
  40. WP_Hash(hash, sizeof(hash), inputtext);
  41. if(!strcmp(hash, pInfo[playerid][pPass]))
  42. {
  43. INI_ParseFile(Path(playerid), "loadaccount_%s", .bExtra = true, .extra = playerid);
  44. SetPlayerScore(playerid, pInfo[playerid][pScore]);
  45. // GivePlayerMoney(playerid, pInfo[playerid][Penz]);
  46. pInfo[playerid][Penz] += pInfo[playerid][Penz];
  47. if(pInfo[playerid][pWarns] >= MAX_WARNS)
  48. {
  49. new string[100];
  50. format(string, sizeof(string), "[Server]: Kickelve lettél! Túl sok figyelmeztetés! Maximum: %d", MAX_WARNS);
  51. SCM(playerid, COLOR_RED, string);
  52. Kick(playerid);
  53. }
  54. }
  55. else
  56. {
  57. if(RepeatedAttempts[playerid] >= 3)
  58. {
  59. Kick(playerid);
  60. return 1;
  61. }
  62. else
  63. {
  64. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Bejelentkezés", "Írd be a jelszavad:", "Mehet", "Mégse");
  65. RepeatedAttempts[playerid]++;
  66. }
  67. }
  68. }
  69. }
  70. case DCLASS:
  71. {
  72. if(!response) return ShowPlayerDialog(playerid,DCLASS,DIALOG_STYLE_LIST,"{0080AA}Válassz kategóriát","Assault\nSniper\nSupporter","Kiválaszt","");
  73. if(response)
  74. {
  75. if(listitem == 0)
  76. {
  77. ResetPlayerWeapons(playerid);
  78. gClass[playerid] = ASSAULT;
  79. GivePlayerWeapon(playerid,24,150);
  80. GivePlayerWeapon(playerid,31,300);
  81. GivePlayerWeapon(playerid,29,200);
  82. SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Kiválasztott kategória, Assault.");
  83. pInfo[playerid][pRank] = 0;
  84. }
  85. if(listitem == 1)
  86. {
  87. ResetPlayerWeapons(playerid);
  88. gClass[playerid] = SNIPER;
  89. GivePlayerWeapon(playerid,24,150);
  90. GivePlayerWeapon(playerid,29,200);
  91. GivePlayerWeapon(playerid,34,200);
  92. SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Kiválasztott kategória, Sniper.");
  93. pInfo[playerid][pRank] = 1;
  94. }
  95. if(listitem == 2)
  96. {
  97. ResetPlayerWeapons(playerid);
  98. SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Kiválasztott kategória, Support.");
  99. GivePlayerWeapon(playerid,25,200);
  100. GivePlayerWeapon(playerid,29,200);
  101. GivePlayerWeapon(playerid,24,150);
  102. gClass[playerid] = SUPPORT;
  103. pInfo[playerid][pRank] = 2;
  104. }
  105. }
  106. }
  107. case DIALOG_VASARLAS:
  108. {
  109. if(!response) return 1;
  110. if(response)
  111. {
  112. if(listitem == 0)
  113. {
  114. SetPlayerArmour(playerid,100);
  115. SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Sikeres vásárlás! Páncélzat megvéve!");
  116. pInfo[playerid][Penz] -= 15000;
  117. }
  118. if(listitem == 1)
  119. {
  120. SetPlayerHealth(playerid,100);
  121. SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Sikeres vásárlás! Élet megvéve!");
  122. pInfo[playerid][Penz] -= 10000;
  123. }
  124. if(listitem == 2)
  125. {
  126. GivePlayerWeapon(playerid,16,3);
  127. SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Sikeres vásárlás! Gránát megvéve!");
  128. pInfo[playerid][Penz] -= 30000;
  129. }
  130. }
  131. }
  132. }
  133. return 1;
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement