Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.69 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. new sendername[MAX_PLAYER_NAME];
  4. new string[128];
  5. if(response)
  6. {
  7. if(dialogid == UVJETI)
  8. {
  9. new pocetaksrting[200];
  10. new pocetakname[64];
  11. GetPlayerName(playerid,pocetakname,sizeof(pocetakname));
  12. format(pocetaksrting,sizeof(pocetaksrting),"{FF0000}%s \n{FFFFFF}Vas korisnicki racun nije pronadjen u bazi podataka.\nNakon sto se prihvatili uvjete koristenja, vrijeme je da registrirate svoj korisnicki racun.",pocetakname);
  13. ShowPlayerDialog(playerid,POCETAK,DIALOG_STYLE_MSGBOX,"{00FF00}Pocetak registacije korisnickog imena",pocetaksrting,"U redu","Odustani");
  14.  
  15. }
  16. if(dialogid == POCETAK)
  17. {
  18. new regstring[200];
  19. new regname[64];
  20. GetPlayerName(playerid,regname,sizeof(regname));
  21. format(regstring,sizeof(regstring),"{0000FF}%s\n\n{FFCC00}Korisnicki racun{FFFFFF}: Nemate.\n\nMolimo vas da ispod upisite svoju {FF0000}lozinku {FFFFFF}kako bi registrirali vas korisnicki racun:",regname);
  22. ShowPlayerDialog(playerid,REGISTRACIJA,DIALOG_STYLE_INPUT,"{00FF00}Registacije korisnickog imena |1.Korak|",regstring,"Registriraj se","Odustani");
  23.  
  24. }
  25. if(dialogid == REGISTRACIJA)
  26. {
  27. if(strlen(inputtext))
  28. {
  29. GetPlayerName(playerid, sendername, sizeof(sendername));
  30. format(string, sizeof(string), "users/%s.ini", sendername);
  31. new File: hFile = fopen(string, io_read);
  32. if (hFile)
  33. {
  34. SendClientMessage(playerid, COLOR_YELLOW, "Ovo korisnicko ime je zauzeto, molimo odaberite neko drugo!");
  35. fclose(hFile);
  36. return 1;
  37. }
  38. new tmppass[64];
  39. strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
  40. //Encrypt(tmppass);
  41. OnPlayerRegister(playerid,tmppass);
  42. }
  43. else
  44. {
  45. new regstring[200];
  46. new regname[64];
  47. GetPlayerName(playerid,regname,sizeof(regname));
  48. format(regstring,sizeof(regstring),"{0000FF}%s\n\n{FFCC00}Korisnicki racun{FFFFFF}: Nemate.\n\nMolimo vas da ispod upisite svoju {FF0000}lozinku {FFFFFF}kako bi registrirali vas korisnicki racun:",regname);
  49. ShowPlayerDialog(playerid,REGISTRACIJA,DIALOG_STYLE_INPUT,"{00FF00}Registacije korisnickog imena |1.Korak|",regstring,"Registriraj se","Odustani");
  50. }
  51. if(PlayerInfo[playerid][pTut] == 0)
  52. {
  53. gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
  54. TogglePlayerControllable(playerid, 0);
  55. RegistrationStep[playerid] = 1;
  56. ClearChatbox(playerid, 8);
  57. ShowPlayerDialog(playerid,SPOL,DIALOG_STYLE_LIST,"Kojeg ste spola?","Musko \nZensko","Odaberi","Odustani");
  58. }
  59. }
  60. if(dialogid == SPOL)
  61. {
  62. if(RegistrationStep[playerid] == 1)
  63. {
  64. if(listitem == 0)
  65. {
  66. PlayerInfo[playerid][pSex] = 1;
  67. ShowPlayerDialog(playerid, GODINE, DIALOG_STYLE_LIST, "{FFFFFF}Koliko godina imate?", "10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25", "Odaberi", "Odustani");
  68. RegistrationStep[playerid] = 2;
  69. }
  70. if(listitem == 1)
  71. {
  72. PlayerInfo[playerid][pSex] = 2;
  73. ShowPlayerDialog(playerid, GODINE, DIALOG_STYLE_LIST, "{FFFFFF}Koliko godina imate?", "10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25", "Odaberi", "Odustani");
  74. RegistrationStep[playerid] = 2;
  75. }
  76. if(listitem == 2)
  77. {
  78. Kick(playerid);
  79. }
  80. }
  81. }
  82. if(dialogid == GODINE)
  83. {
  84. if(RegistrationStep[playerid] == 2)
  85. {
  86. if(listitem == 0)
  87. {
  88. PlayerInfo[playerid][pAge] = 10;
  89. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  90. RegistrationStep[playerid] = 3;
  91. }
  92. if(listitem == 1)
  93. {
  94. PlayerInfo[playerid][pAge] = 11;
  95. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  96. RegistrationStep[playerid] = 3;
  97. }
  98. if(listitem == 2)
  99. {
  100. PlayerInfo[playerid][pAge] = 12;
  101. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  102. RegistrationStep[playerid] = 3;
  103. }
  104. if(listitem == 3)
  105. {
  106. PlayerInfo[playerid][pAge] = 13;
  107. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  108. RegistrationStep[playerid] = 3;
  109. }
  110. if(listitem == 4)
  111. {
  112. PlayerInfo[playerid][pAge] = 14;
  113. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  114. RegistrationStep[playerid] = 3;
  115. }
  116. if(listitem == 5)
  117. {
  118. PlayerInfo[playerid][pAge] = 15;
  119. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  120. RegistrationStep[playerid] = 3;
  121. }
  122. if(listitem == 6)
  123. {
  124. PlayerInfo[playerid][pAge] = 16;
  125. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  126. RegistrationStep[playerid] = 3;
  127. }
  128. if(listitem == 7)
  129. {
  130. PlayerInfo[playerid][pAge] = 17;
  131. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  132. RegistrationStep[playerid] = 3;
  133. }
  134. if(listitem == 8)
  135. {
  136. PlayerInfo[playerid][pAge] = 18;
  137. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  138. RegistrationStep[playerid] = 3;
  139. }
  140. if(listitem == 9)
  141. {
  142. PlayerInfo[playerid][pAge] = 19;
  143. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  144. RegistrationStep[playerid] = 3;
  145. }
  146. if(listitem == 10)
  147. {
  148. PlayerInfo[playerid][pAge] = 20;
  149. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  150. RegistrationStep[playerid] = 3;
  151. }
  152. if(listitem == 11)
  153. {
  154. PlayerInfo[playerid][pAge] = 21;
  155. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  156. RegistrationStep[playerid] = 3;
  157. }
  158. if(listitem == 12)
  159. {
  160. PlayerInfo[playerid][pAge] = 22;
  161. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  162. RegistrationStep[playerid] = 3;
  163. }
  164. if(listitem == 13)
  165. {
  166. PlayerInfo[playerid][pAge] = 23;
  167. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  168. RegistrationStep[playerid] = 3;
  169. }
  170. if(listitem == 14)
  171. {
  172. PlayerInfo[playerid][pAge] = 24;
  173. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  174. RegistrationStep[playerid] = 3;
  175. }
  176. if(listitem == 15)
  177. {
  178. PlayerInfo[playerid][pAge] = 25;
  179. ShowPlayerDialog(playerid, DRZAVA, DIALOG_STYLE_LIST, "{FFFFFF}Odakle ste?", "Los Santos\nSan Fierro\nLas Venturas", "Odaberi", "Odustani");
  180. RegistrationStep[playerid] = 3;
  181. }
  182. if(listitem == 16)
  183. {
  184. Kick(playerid);
  185. }
  186. }
  187. }
  188. if(dialogid == DRZAVA)
  189. {
  190. if(RegistrationStep[playerid] == 3)
  191. {
  192. if(listitem == 0)
  193. {
  194. PlayerInfo[playerid][pOrigin] = 1;
  195. ShowPlayerDialog(playerid, TUTORIAL, DIALOG_STYLE_MSGBOX, "{00FF00}Obavijest", "{FFFFFF}Uspjesno ste unjeli svoje podatke, \na sada slijedi Tutorial i pitanja.", "U redu", "Odustani");
  196. RegistrationStep[playerid] = 0;
  197. }
  198. if(listitem == 1)
  199. {
  200. PlayerInfo[playerid][pOrigin] = 2;
  201. ShowPlayerDialog(playerid, TUTORIAL, DIALOG_STYLE_MSGBOX, "{00FF00}Obavijest", "{FFFFFF}Uspjesno ste unjeli svoje podatke, \na sada slijedi Tutorial i pitanja.", "U redu", "Odustani");
  202. RegistrationStep[playerid] = 0;
  203. }
  204. if(listitem == 2)
  205. {
  206. PlayerInfo[playerid][pOrigin] = 3;
  207. ShowPlayerDialog(playerid, TUTORIAL, DIALOG_STYLE_MSGBOX, "{00FF00}Obavijest", "{FFFFFF}Uspjesno ste unjeli svoje podatke, \na sada slijedi Tutorial i pitanja.", "U redu", "Odustani");
  208. RegistrationStep[playerid] = 0;
  209. }
  210. if(listitem == 3)
  211. {
  212. Kick(playerid);
  213. }
  214. }
  215. }
  216. if(dialogid == TUTORIAL)
  217. {
  218. TutTime[playerid] = 1;
  219. }
  220. if(dialogid == PITANJE)
  221. {
  222. if(listitem == 0)
  223. {
  224. SendClientMessage(playerid, COLOR_GREEN, "Tocno ste odgovorili na pitanje.");
  225. ShowPlayerDialog(playerid,PITANJE1,DIALOG_STYLE_LIST,"{0066FF}Sto je to PowerGaming (PG)? [Pitanje 2/6]","{FFFFFF}Voznja desnom stranom \nMjesanje OOC i IC \nPrisiljavanje osobe na ne zeljenu radnju","Odaberi","Odustani");
  226. }
  227. if(listitem == 1)
  228. {
  229. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  230. TutTime[playerid] = 1;
  231. }
  232. if(listitem == 2)
  233. {
  234. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  235. TutTime[playerid] = 1;
  236. }
  237. }
  238. if(dialogid == PITANJE1)
  239. {
  240. if(listitem == 0)
  241. {
  242. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  243. TutTime[playerid] = 1;
  244.  
  245. }
  246. if(listitem == 1)
  247. {
  248. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  249. TutTime[playerid] = 1;
  250. }
  251. if(listitem == 2)
  252. {
  253. SendClientMessage(playerid, COLOR_GREEN, "Tocno ste odgovorili na pitanje.");
  254. ShowPlayerDialog(playerid,PITANJE2,DIALOG_STYLE_LIST,"{0066FF}Sto cu napraviti ukoliko pronadjen bug? [Pitanje 3/6]","{FFFFFF}Reci drugima kako bi ga svi mogli iskoristavati \nPrijaviti na forumu i adminima na /report \nSutit cu o tome i iskoristavati ga","Odaberi","Odustani");
  255.  
  256. }
  257. }
  258. if(dialogid == PITANJE2)
  259. {
  260. if(listitem == 0)
  261. {
  262. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  263. TutTime[playerid] = 1;
  264.  
  265. }
  266. if(listitem == 1)
  267. {
  268. SendClientMessage(playerid, COLOR_GREEN, "Tocno ste odgovorili na pitanje.");
  269. ShowPlayerDialog(playerid,PITANJE3,DIALOG_STYLE_LIST,"{0066FF}Sto je to DeathMatch (DM)? [Pitanje 4/6]","{FFFFFF}Ubijanje osobe bez dovoljno dobrog RolePlay razloga\nKradja vozila \nVoznja za zadnjem kotacu","Odaberi","Odustani");
  270. }
  271. if(listitem == 2)
  272. {
  273. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  274. TutTime[playerid] = 1;
  275.  
  276. }
  277. }
  278. if(dialogid == PITANJE3)
  279. {
  280. if(listitem == 0)
  281. {
  282. SendClientMessage(playerid, COLOR_GREEN, "Tocno ste odgovorili na pitanje.");
  283. ShowPlayerDialog(playerid,PITANJE4,DIALOG_STYLE_LIST,"{0066FF}Spawn Kill je...(SK)? [Pitanje 5/6]","{FFFFFF}Bjezanje policiji\nUbojstvo osobe na spawnu \nPenjanje po zgradama","Odaberi","Odustani");
  284. }
  285. if(listitem == 1)
  286. {
  287. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  288. TutTime[playerid] = 1;
  289. }
  290. if(listitem == 2)
  291. {
  292. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  293. TutTime[playerid] = 1;
  294.  
  295. }
  296. }
  297. if(dialogid == PITANJE4)
  298. {
  299. if(listitem == 0)
  300. {
  301. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  302. TutTime[playerid] = 1;
  303. }
  304. if(listitem == 1)
  305. {
  306. SendClientMessage(playerid, COLOR_GREEN, "Tocno ste odgovorili na pitanje.");
  307. ShowPlayerDialog(playerid,PITANJE5,DIALOG_STYLE_LIST,"{0066FF}Sto je to MetaGaming (MG)? [Pitanje 6/6]","{FFFFFF}Voznja helica\nUbojstvo policajca \nMjesanje OOC i IC informcija","Odaberi","Odustani");
  308. }
  309. if(listitem == 2)
  310. {
  311. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  312. TutTime[playerid] = 1;
  313.  
  314. }
  315. }
  316. if(dialogid == PITANJE5)
  317. {
  318. if(listitem == 0)
  319. {
  320. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  321. TutTime[playerid] = 1;
  322. }
  323. if(listitem == 1)
  324. {
  325. SendClientMessage(playerid, COLOR_RED, "Krvio ste odgovorili na pitanje, vracate se na Tutorial.");
  326. TutTime[playerid] = 1;
  327. }
  328. if(listitem == 2)
  329. {
  330. ShowPlayerDialog(playerid,KRAJ,DIALOG_STYLE_MSGBOX,"{00FF00}Cestitamo, tocno ste odgovorili na sva pitanja."," {FFFFFF}Sada slijedi prijavljivanje na server.\n\nUgodnu zabavu na serveru zeli Vam {FFCC33}NS Gaming Zajednica{FFFFFF}.","U redu","Odustani");
  331. }
  332. }
  333. if(dialogid == KRAJ)
  334. {
  335. new loginstring[200];
  336. new loginname[64];
  337. GetPlayerName(playerid,loginname,sizeof(loginname));
  338. format(loginstring,sizeof(loginstring),"{0000FF}%s\n\n{FFCC00}Korisnicki racun{FFFFFF}: Imate.\n\nMolimo vas da ispod upisite svoju {FF0000}lozinku {FFFFFF}kako bi ste se prijavili:",loginname);
  339. ShowPlayerDialog(playerid,PRIJAVA,DIALOG_STYLE_INPUT,"{00FF00}Prijava korisnickog imena ",loginstring,"Prijavi se","Odustani");
  340.  
  341. }
  342.  
  343. if(dialogid == PRIJAVA || dialogid == PRIJAVA1)
  344. {
  345. if(strlen(inputtext))
  346. {
  347. new tmppass[64];
  348. strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
  349. //Encrypt(tmppass);
  350. OnPlayerLogin(playerid,tmppass);
  351. }
  352. else
  353. {
  354. new loginstring[200];
  355. new loginname[64];
  356. GetPlayerName(playerid,loginname,sizeof(loginname));
  357. format(loginstring,sizeof(loginstring),"{0066FF}%s \n{FFCC33}Unjeli ste netocnu lozinku.\n{FFFFFF}Molimo {0066FF}ispod ponovno unesite vasu lozinku {FFFFFF}kako bi mogli igrati na serveru:",loginname);
  358. ShowPlayerDialog(playerid,PRIJAVA1,DIALOG_STYLE_INPUT,"{00FF00}Ponovna prijava korisnickog imena",loginstring,"Prijavi se","Odustani");
  359. gPlayerLogTries[playerid] += 1;
  360. if(gPlayerLogTries[playerid] == 5) { Ban(playerid); }
  361. }
  362. }
  363. }
  364. else
  365. {
  366. Kick(playerid);
  367. }
  368. return 1;
  369. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement