MarkoN

Untitled

Sep 22nd, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.78 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. if(dialogid == DIALOG_REGISTER)
  4. {
  5. if (!response) return Kick(playerid);
  6. if(response)
  7. {
  8. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registracija","Dobro dosli na Server!\n\nVi nemate Account\n\nForum: Uskoro!\n\nUpisite Password da se registrirate...","Registracija","Izadji");
  9. new INI:File = INI_Open(UserPath(playerid));
  10. INI_SetTag(File,"data");
  11. INI_WriteInt(File,"Password",udb_hash(inputtext));
  12. INI_WriteInt(File,"Respecti",0);
  13. INI_WriteInt(File,"Level",1);
  14. INI_WriteInt(File,"Novac",1000);
  15. INI_WriteInt(File,"Admin",0);
  16. INI_WriteInt(File,"Ubojstava",0);
  17. INI_WriteInt(File,"Smrti",0);
  18. INI_WriteInt(File,"Perk",0);
  19. INI_WriteInt(File,"Donator",0);
  20. INI_Close(File);
  21. }
  22. }
  23. if(dialogid == DIALOG_LOGIN)
  24. {
  25. if ( !response ) return Kick ( playerid );
  26. if( response )
  27. {
  28. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  29. {
  30. new loginname[64];
  31. GetPlayerName(playerid,loginname,sizeof(loginname));
  32. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  33. GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
  34. SetPlayerPos(playerid, 1554.6641,-1676.0160,16.1953);
  35. SpawnPlayer(playerid);
  36. }
  37. else
  38. {
  39. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Kriva sifra","Dobro dosli na Server!\n\nUpisali ste krivu sifru\n\nVi imate Account\n\nForum: Uskoro!\n\nUpisite tocnan Password da se Logirate...","Login","Izadji");
  40. }
  41. }
  42. }
  43. if(dialogid == DIALOG_PISTOL)
  44. {
  45. if(response)
  46. {
  47. if(listitem == 0)
  48. {
  49. if(PlayerInfo[playerid][pLevel] == 5) return SetPlayerArmour(playerid, 100.0);
  50. GivePlayerWeapon(playerid, 22, 500);
  51. ShowPlayerDialog(playerid, DIALOG_AUTOMATICPISTOL, DIALOG_STYLE_LIST,"Automatic Pistol","Uzi\nTec '9\nSMG","Odaberi","Odustani");
  52. }
  53. if(listitem == 1)
  54. {
  55. if(PlayerInfo[playerid][pLevel] == 5) return SetPlayerArmour(playerid, 100.0);
  56. GivePlayerWeapon(playerid, 23, 500);
  57. ShowPlayerDialog(playerid, DIALOG_AUTOMATICPISTOL, DIALOG_STYLE_LIST,"Automatic Pistol","Uzi\nTec '9\nSMG","Odaberi","Odustani");
  58. }
  59. if(listitem == 2)
  60. {
  61. if(PlayerInfo[playerid][pLevel] == 5) return SetPlayerArmour(playerid, 100.0);
  62. if(PlayerInfo[playerid][pLevel] != 5) return SCM(playerid, COLOR_RED, "Za Dezert Eagle je potrebno imati Level 5!");
  63. GivePlayerWeapon(playerid, 24, 500);
  64. ShowPlayerDialog(playerid, DIALOG_AUTOMATICPISTOL, DIALOG_STYLE_LIST,"Automatic Pistol","Uzi\nTec '9\nSMG","Odaberi","Odustani");
  65. }
  66. }
  67. }
  68. if(dialogid == DIALOG_AUTOMATICPISTOL)
  69. {
  70. if(response)
  71. {
  72. if(listitem == 0)
  73. {
  74. if(PlayerInfo[playerid][pLevel] != 7) return SCM(playerid, COLOR_RED,"Za Uzi je potrebno imati Level 7");
  75. GivePlayerWeapon(playerid, 28, 1000);
  76. ShowPlayerDialog(playerid, DIALOG_SHOOTGUN, DIALOG_STYLE_LIST,"Shoot Gun","Shootgun\nSawnoff Shotgun\nCombat Shotgun","Odaberi","Odustani");
  77. }
  78. if(listitem == 1)
  79. {
  80. if(PlayerInfo[playerid][pLevel] != 7) return SCM(playerid, COLOR_RED,"Za Tec '9 je potrebno imati Level 7");
  81. GivePlayerWeapon(playerid, 32, 1000);
  82. ShowPlayerDialog(playerid, DIALOG_SHOOTGUN, DIALOG_STYLE_LIST,"Shoot Gun","Shootgun\nSawnoff Shotgun\nCombat Shotgun","Odaberi","Odustani");
  83. }
  84. if(listitem == 2)
  85. {
  86. if(PlayerInfo[playerid][pLevel] != 10) return SCM(playerid, COLOR_RED,"Za SMF je potrebno imati Level 10");
  87. GivePlayerWeapon(playerid, 29, 300);
  88. ShowPlayerDialog(playerid, DIALOG_SHOOTGUN, DIALOG_STYLE_LIST,"Shoot Gun","Shootgun\nSawnoff Shotgun\nCombat Shotgun","Odaberi","Odustani");
  89. }
  90. }
  91. }
  92. if(dialogid == DIALOG_SHOOTGUN)
  93. {
  94. if(response)
  95. {
  96. if(listitem == 0)
  97. {
  98. if(PlayerInfo[playerid][pLevel] != 8) return SCM(playerid, COLOR_RED,"Za Shootgun je potrebno imati Level 8");
  99. GivePlayerWeapon(playerid, 25, 100);
  100. ShowPlayerDialog(playerid, DIALOG_AUTOMATIC, DIALOG_STYLE_LIST,"Automatic","AK-47\nM4","Odaberi","Odustani");
  101. }
  102. if(listitem == 1)
  103. {
  104. if(PlayerInfo[playerid][pLevel] != 11) return SCM(playerid, COLOR_RED,"Za Sawnoff Shotgun je potrebno imati Level 11");
  105. GivePlayerWeapon(playerid, 26, 200);
  106. ShowPlayerDialog(playerid, DIALOG_AUTOMATIC, DIALOG_STYLE_LIST,"Automatic","AK-47\nM4","Odaberi","Odustani");
  107. }
  108. if(listitem == 2)
  109. {
  110. if(PlayerInfo[playerid][pLevel] != 15) return SCM(playerid, COLOR_RED,"Za Combat Shotgun je potrebno imati Level 15");
  111. GivePlayerWeapon(playerid, 27, 200);
  112. ShowPlayerDialog(playerid, DIALOG_AUTOMATIC, DIALOG_STYLE_LIST,"Automatic","AK-47\nM4","Odaberi","Odustani");
  113. }
  114. }
  115. }
  116. if(dialogid == DIALOG_AUTOMATIC)
  117. {
  118. if(response)
  119. {
  120. if(listitem == 0)
  121. {
  122. if(PlayerInfo[playerid][pLevel] != 17) return SCM(playerid, COLOR_RED,"Za AK-47 je potrebno imati Level 17");
  123. GivePlayerWeapon(playerid, 30, 600);
  124. ShowPlayerDialog(playerid, DIALOG_RIFLE, DIALOG_STYLE_LIST,"Rifle","Rifle\nSniper","Odaberi","Odustani");
  125. }
  126. if(listitem == 1)
  127. {
  128. if(PlayerInfo[playerid][pLevel] != 20) return SCM(playerid, COLOR_RED,"Za M4 je potrebno imati Level 20");
  129. GivePlayerWeapon(playerid, 31, 1000);
  130. ShowPlayerDialog(playerid, DIALOG_RIFLE, DIALOG_STYLE_LIST,"Rifle","Rifle\nSniper","Odaberi","Odustani");
  131. }
  132. }
  133. }
  134. if(dialogid == DIALOG_RIFLE)
  135. {
  136. if(response)
  137. {
  138. if(listitem == 0)
  139. {
  140. if(PlayerInfo[playerid][pLevel] != 14) return SCM(playerid, COLOR_RED, "Za Rifle je potrebno imati Level 14");
  141. GivePlayerWeapon(playerid, 30, 600);
  142. if(PlayerInfo[playerid][pPerk] == 1) return ShowPlayerDialog(playerid, DIALOG_BOMB, DIALOG_STYLE_LIST,"Bomb","Rucna bomba\nSuzavac\nMolotovni koktel","Odaberi","Odustani");
  143. }
  144. if(listitem == 1)
  145. {
  146. if(PlayerInfo[playerid][pLevel] != 18) return SCM(playerid, COLOR_RED, "Za Sniper je potrebno imati Level 18");
  147. GivePlayerWeapon(playerid, 30, 600);
  148. if(PlayerInfo[playerid][pPerk] == 1) return ShowPlayerDialog(playerid, DIALOG_BOMB, DIALOG_STYLE_LIST,"Bomb","Rucna bomba\nSuzavac\nMolotovni koktel\nC4","Odaberi","Odustani");
  149. }
  150. }
  151. }
  152. if(dialogid == DIALOG_BOMB)
  153. {
  154. if(response)
  155. {
  156. if(listitem == 0)
  157. {
  158. if(PlayerInfo[playerid][pTeam] != 1) return SCM(playerid, COLOR_RED, "Za rucne bombe moras biti Marinac!");
  159. GivePlayerWeapon(playerid, 16, 3);
  160. if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
  161. }
  162. if(listitem == 1)
  163. {
  164. if(PlayerInfo[playerid][pTeam] != 2) return SCM(playerid, COLOR_RED, "Za suzavce moras biti specijalac!");
  165. GivePlayerWeapon(playerid, 17, 3);
  166. if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
  167. }
  168. if(listitem == 2)
  169. {
  170. if(PlayerInfo[playerid][pTeam] != 3) return SCM(playerid, COLOR_RED, "Za molotovne koktele moras biti terorist!");
  171. GivePlayerWeapon(playerid, 18, 3);
  172. if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
  173. }
  174. if(listitem == 3)
  175. {
  176. if(PlayerInfo[playerid][pPerk] != 2) return SCM(playerid, COLOR_RED, "Za C4 je potrebno imati Perk 2!");
  177. GivePlayerWeapon(playerid, 39, 3);
  178. if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
  179. }
  180. }
  181. }
  182. if(dialogid == DIALOG_RPG)
  183. {
  184. if(response)
  185. {
  186. if(listitem == 0)
  187. {
  188. GivePlayerWeapon(playerid, 35, 5);
  189. if(PlayerInfo[playerid][pDonator] == 1) return ShowPlayerDialog(playerid, DIALOG_DONATORWEAPON, DIALOG_STYLE_LIST,"Donator Weapons","Minigun","Odaberi","Odustani");
  190. }
  191. if(listitem == 1)
  192. {
  193. if(PlayerInfo[playerid][pLevel] == 25) return SCM(playerid, COLOR_RED,"Za napredni RPG je potrebno imati Level 25!");
  194. GivePlayerWeapon(playerid, 36, 5);
  195. if(PlayerInfo[playerid][pDonator] == 1) return ShowPlayerDialog(playerid, DIALOG_DONATORWEAPON, DIALOG_STYLE_LIST,"Donator Weapons","Minigun","Odaberi","Odustani");
  196. }
  197. }
  198. }
  199. if(dialogid == DIALOG_DONATORWEAPON)
  200. {
  201. if(response)
  202. {
  203. if(listitem == 0)
  204. {
  205. if(PlayerInfo[playerid][pDonator] == 1) return GivePlayerWeapon(playerid, 38, 100);
  206. if(PlayerInfo[playerid][pDonator] == 2) return GivePlayerWeapon(playerid, 38, 200);
  207. if(PlayerInfo[playerid][pDonator] == 3) return GivePlayerWeapon(playerid, 38, 500);
  208. }
  209. }
  210. }
  211. if(dialogid == DIALOG_TEAM)
  212. {
  213. if(response)
  214. {
  215. if(listitem == 0)
  216. {
  217. PlayerInfo[playerid][pTeam] = 1;
  218. ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST,"Pistol","Glock\nGlock s prigusivacem\nDezert Eagle","Odaberi","Odustani");
  219. SetPlayerSkin(playerid, 287);
  220. }
  221. if(listitem == 1)
  222. {
  223. PlayerInfo[playerid][pTeam] = 2;
  224. ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST,"Pistol","Glock\nGlock s prigusivacem\nDezert Eagle","Odaberi","Odustani");
  225. SetPlayerSkin(playerid, 285);
  226. }
  227. if(listitem == 2)
  228. {
  229. PlayerInfo[playerid][pTeam] = 3;
  230. ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST,"Pistol","Glock\nGlock s prigusivacem\nDezert Eagle","Odaberi","Odustani");
  231. SetPlayerSkin(playerid, 144);
  232. }
  233. }
  234. }
  235. return false;
  236. }
Advertisement
Add Comment
Please, Sign In to add comment