Advertisement
Guest User

Untitled

a guest
Feb 21st, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.63 KB | None | 0 0
  1. //-------------------------
  2. stock allocatePlayerVehicle(const playerid, const slot, const vehicleid) {
  3. switch (slot) {
  4. case 1: {
  5. PlayerInfo[playerid][vehicleKeyOne] = vehicleid;
  6.  
  7. PodesiVozilo(playerid, vehicleid);
  8. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  9. }
  10. case 2: {
  11. PlayerInfo[playerid][vehicleKeyTwo] = vehicleid;
  12.  
  13. PodesiVozilo(playerid, vehicleid);
  14. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  15. }
  16. case 3: {
  17. PlayerInfo[playerid][vehicleKeyThree] = vehicleid;
  18.  
  19. PodesiVozilo(playerid, vehicleid);
  20. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  21. }
  22. case 4: {
  23. PlayerInfo[playerid][vehicleKeyFour] = vehicleid;
  24.  
  25. PodesiVozilo(playerid, vehicleid);
  26. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  27. }
  28. case 5: {
  29. PlayerInfo[playerid][vehicleKeyFive] = vehicleid;
  30.  
  31. PodesiVozilo(playerid, vehicleid);
  32. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  33. }
  34. case 6: {
  35. PlayerInfo[playerid][vehicleKeySix] = vehicleid;
  36.  
  37. PodesiVozilo(playerid, vehicleid);
  38. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  39. }
  40. case 7: {
  41. PlayerInfo[playerid][vehicleKeySeven] = vehicleid;
  42.  
  43. PodesiVozilo(playerid, vehicleid);
  44. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  45. }
  46. case 8: {
  47. PlayerInfo[playerid][vehicleKeyEight] = vehicleid;
  48.  
  49. PodesiVozilo(playerid, vehicleid);
  50. printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
  51. }
  52. }
  53. SalonKupuje[SalonID[playerid]] = -1;
  54. SalonID[playerid] = -1;
  55.  
  56. UnistiAuta(playerid);
  57. vTypedTimes[playerid] = false;
  58.  
  59. new vehCheck[69];
  60. mysql_format(SQL, vehCheck, sizeof vehCheck, "SELECT `ID` FROM `auta` WHERE `Vlasnik` = '%e'", GetName(playerid));
  61. mysql_tquery(SQL, vehCheck, "ChampinProvjeriVoz", "ii", playerid, 0);
  62.  
  63. INFO(playerid, "Vasite vozila se unisteni, da gi vratite /v");
  64. return 1;
  65. }
  66. //--------------------------------
  67. if(dialogid == D_KUPOVINAVOZILA)
  68. {
  69. if(!response) return true;
  70. if(response)
  71. {
  72. new idsalona = GledaKatalog[playerid];
  73. new voziloporedu = ListaVozila[playerid];
  74. new vehicleid = getFreeArrayID(keyVehicle); // Nabavi zadnji id auta iz baze (Iako nije proso sve uslove) (Isti thread ko samp)
  75.  
  76. if(SaloniInfo[idsalona][saOGModela][voziloporedu] <= 0) return GRESKA(playerid,"Nemamo vise tih modela!");
  77. if(PlayerInfo[playerid][pCash] < SaloniInfo[idsalona][saCena][voziloporedu]) return GRESKA(playerid,"Nemate dovolno pari!");
  78. //
  79. if(PlayerInfo[playerid][vehicleKeyOne] == -1) return allocatePlayerVehicle(playerid, 1, vehicleid);
  80. if(PlayerInfo[playerid][vehicleKeyTwo] == -1) return allocatePlayerVehicle(playerid, 2, vehicleid);
  81. if(PlayerInfo[playerid][vehicleKeyThree] == -1) return allocatePlayerVehicle(playerid, 3, vehicleid);
  82. // DONATE
  83. // slot 4
  84. if(PlayerInfo[playerid][vehicleKeyFour] == -1 && PlayerInfo[playerid][donateSlot] >= 1) return allocatePlayerVehicle(playerid, 4, vehicleid);
  85. if(PlayerInfo[playerid][vehicleKeyFour] == -1 && PlayerInfo[playerid][pVip] >= 6) return allocatePlayerVehicle(playerid, 4, vehicleid);
  86. // slot 5
  87. if(PlayerInfo[playerid][vehicleKeyFive] == -1 && PlayerInfo[playerid][donateSlot] >= 2) return allocatePlayerVehicle(playerid, 5, vehicleid);
  88. if(PlayerInfo[playerid][vehicleKeyFive] == -1 && PlayerInfo[playerid][pVip] >= 6) return allocatePlayerVehicle(playerid, 5, vehicleid);
  89. // slot 6
  90. if(PlayerInfo[playerid][vehicleKeySix] == -1 && PlayerInfo[playerid][donateSlot] >= 3) return allocatePlayerVehicle(playerid, 6, vehicleid);
  91. if(PlayerInfo[playerid][vehicleKeySix] == -1 && PlayerInfo[playerid][pVip] >= 6) return allocatePlayerVehicle(playerid, 6, vehicleid);
  92. // slot 7
  93. if(PlayerInfo[playerid][vehicleKeySeven] == -1 && PlayerInfo[playerid][pVip] >= 6) {
  94. allocatePlayerVehicle(playerid, 7, vehicleid);
  95. return 1;
  96. }
  97. // slot 8
  98. if(PlayerInfo[playerid][vehicleKeyEight] == -1 && PlayerInfo[playerid][pVip] >= 7) {
  99. allocatePlayerVehicle(playerid, 8, vehicleid);
  100. return 1;
  101. }
  102. return GRESKA(playerid, "Vasi slotovi su popunjeni.");
  103. }
  104. }
  105. //--------------------------------------------
  106. if(dialogid == 2318)
  107. {
  108. if (!response) {
  109. if (!vTypedTimes[playerid]) {
  110. vTypedTimes[playerid] = false;
  111. }
  112. }
  113. if(response)
  114. {
  115. if (!vTypedTimes[playerid]) {
  116. UnistiAuta(playerid);
  117.  
  118. if(PlayerInfo[playerid][vehicleKeyOne] == -1 && PlayerInfo[playerid][vehicleKeyTwo] == -1 && PlayerInfo[playerid][vehicleKeyThree] == -1 && PlayerInfo[playerid][vehicleKeyFour] == -1 && PlayerInfo[playerid][vehicleKeyFive] == -1 && PlayerInfo[playerid][vehicleKeySix] == -1 && PlayerInfo[playerid][vehicleKeySeven] == -1 && PlayerInfo[playerid][vehicleKeyEight] == -1)
  119. return GRESKA(playerid, "Nemate vozila!");
  120.  
  121. if (RaceTemp[tempraceID] != INVALID_RACE_ID)
  122. return GRESKA(playerid, "Event je trenutno u toku, pocekajte malce!");
  123.  
  124. if(PlayerInfo[playerid][vehicleKeyOne] != -1)
  125. createVehicleOne(playerid);
  126. if(PlayerInfo[playerid][vehicleKeyTwo] != -1)
  127. createVehicleTwo(playerid);
  128. if(PlayerInfo[playerid][vehicleKeyThree] != -1)
  129. createVehicleThree(playerid);
  130. if(PlayerInfo[playerid][vehicleKeyFour] != -1)
  131. createDonateVehicleOne(playerid);
  132. if(PlayerInfo[playerid][vehicleKeyFive] != -1)
  133. createDonateVehicleTwo(playerid);
  134. if(PlayerInfo[playerid][vehicleKeySix] != -1)
  135. createDonateVehicleThree(playerid);
  136. if(PlayerInfo[playerid][vehicleKeySeven] != -1)
  137. createVIP7Vehicle(playerid);
  138. if(PlayerInfo[playerid][vehicleKeyEight] != -1)
  139. createVIP7VehicleTwo(playerid);
  140.  
  141. vTypedTimes[playerid] = true;
  142. }
  143. else {
  144. new c1 = PlayerInfo[playerid][vehicleKeyOne], c2 = PlayerInfo[playerid][vehicleKeyTwo], c3 = PlayerInfo[playerid][vehicleKeyThree], c4 = PlayerInfo[playerid][vehicleKeyFour],
  145. c5 = PlayerInfo[playerid][vehicleKeyFive], c6 = PlayerInfo[playerid][vehicleKeySix], c7 = PlayerInfo[playerid][vehicleKeySeven], c8 = PlayerInfo[playerid][vehicleKeyEight];
  146. if(listitem == 0)
  147. {
  148. if(c1 == -1 && c2 == -1 && c3 == -1 && c4 == -1 && c5 == -1 && c6 == -1 && c7 == -1 && c8 == -1)
  149. {
  150. ShowPlayerDialog(playerid, 0, DSM, ""ZELENASTAN"Info", "{FF4242}Vi nemate vozila", "Zatvori", "");
  151. return 1;
  152. }
  153. else
  154. {
  155. new kstring[1400], kz[4];
  156. if (c1 != -1)
  157. {
  158. if(CarInfo[c1][cLock] == 1) kz = "Ne";
  159. else kz = "Da";
  160. format(kstring,sizeof(kstring),
  161. "{FF4242}1. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
  162. "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
  163. "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
  164. "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
  165. GetVehicleName(tmpVehicleOne[playerid]),
  166. CarInfo[c1][cValue],
  167. CarInfo[c1][cColorOne],
  168. CarInfo[c1][cColorTwo],
  169. kz,
  170. CarInfo[c1][cGorivo]
  171. );
  172. }
  173. if (c2 != -1)
  174. {
  175. if(CarInfo[c2][cLock] == 1) kz = "Ne";
  176. else kz = "Da";
  177. format(kstring,sizeof(kstring),
  178. "%s{FF4242}2. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
  179. "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
  180. "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
  181. "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
  182. kstring,
  183. GetVehicleName(tmpVehicleTwo[playerid]),
  184. CarInfo[c2][cValue],
  185. CarInfo[c2][cColorOne],
  186. CarInfo[c2][cColorTwo],
  187. kz,
  188. CarInfo[c2][cGorivo]
  189. );
  190. }
  191. if (c3 != -1)
  192. {
  193. if(CarInfo[c3][cLock] == 1) kz = "Ne";
  194. else kz = "Da";
  195. format(kstring,sizeof(kstring),
  196. "%s{FF4242}3. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
  197. "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
  198. "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
  199. "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
  200. kstring,
  201. GetVehicleName(tmpVehicleThree[playerid]),
  202. CarInfo[c3][cValue],
  203. CarInfo[c3][cColorOne],
  204. CarInfo[c3][cColorTwo],
  205. kz,
  206. CarInfo[c3][cGorivo]
  207. );
  208. }
  209. if (c4 != -1)
  210. {
  211. if(CarInfo[c4][cLock] == 1) kz = "Ne";
  212. else kz = "Da";
  213. format(kstring,sizeof(kstring),
  214. "%s{FF4242}4. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
  215. "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
  216. "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
  217. "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
  218. kstring,
  219. GetVehicleName(tmpVehicleFour[playerid]),
  220. CarInfo[c4][cValue],
  221. CarInfo[c4][cColorOne],
  222. CarInfo[c4][cColorTwo],
  223. kz,
  224. CarInfo[c4][cGorivo]
  225. );
  226. }
  227. format(kstring,sizeof(kstring),""ZELENASTAN"__________________________\n\n%s"ZELENASTAN"__________________________",kstring);
  228. ShowPlayerDialog(playerid, 4878, DSM, ""ZELENASTAN"Info", kstring, "Ponataka", "Izlez");
  229. return 1;
  230. }
  231. }
  232. if(listitem == 1)
  233. {
  234. if (c1 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 1!");
  235. ShowPlayerDialog(playerid, 2319, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  236. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  237. {FF4242}[V]{FFFFFF} | Lociraj\n\
  238. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  239. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  240. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  241. {FF4242}[V]{FFFFFF} | Gepek\n\
  242. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  243. }
  244. if(listitem == 2)
  245. {
  246. if (c2 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 2!");
  247. ShowPlayerDialog(playerid, 2320, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  248. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  249. {FF4242}[V]{FFFFFF} | Lociraj\n\
  250. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  251. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  252. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  253. {FF4242}[V]{FFFFFF} | Gepek\n\
  254. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  255. }
  256. if(listitem == 3)
  257. {
  258. if (c3 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 3!");
  259. ShowPlayerDialog(playerid, 2321, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  260. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  261. {FF4242}[V]{FFFFFF} | Lociraj\n\
  262. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  263. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  264. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  265. {FF4242}[V]{FFFFFF} | Gepek\n\
  266. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  267. }
  268. if(listitem == 4)
  269. {
  270. if (c4 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 4!");
  271. ShowPlayerDialog(playerid, 2322, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  272. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  273. {FF4242}[V]{FFFFFF} | Lociraj\n\
  274. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  275. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  276. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  277. {FF4242}[V]{FFFFFF} | Gepek\n\
  278. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  279. }
  280. if(listitem == 5)
  281. {
  282. if (c5 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 5!");
  283. ShowPlayerDialog(playerid, 12265, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  284. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  285. {FF4242}[V]{FFFFFF} | Lociraj\n\
  286. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  287. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  288. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  289. {FF4242}[V]{FFFFFF} | Gepek\n\
  290. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  291. }
  292. if(listitem == 6)
  293. {
  294. if (c1 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 1!");
  295. ShowPlayerDialog(playerid, 25597, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  296. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  297. {FF4242}[V]{FFFFFF} | Lociraj\n\
  298. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  299. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  300. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  301. {FF4242}[V]{FFFFFF} | Gepek\n\
  302. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  303. }
  304. if(listitem == 7)
  305. {
  306. if (c7 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 7!");
  307. ShowPlayerDialog(playerid, 29597, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  308. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  309. {FF4242}[V]{FFFFFF} | Lociraj\n\
  310. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  311. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  312. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  313. {FF4242}[V]{FFFFFF} | Gepek\n\
  314. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  315. }
  316. if(listitem == 8)
  317. {
  318. if (c8 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 8!");
  319. ShowPlayerDialog(playerid, 29598, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
  320. {FF4242}[V]{FFFFFF} | Parkiraj\n\
  321. {FF4242}[V]{FFFFFF} | Lociraj\n\
  322. {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
  323. {FF4242}[V]{FFFFFF} | Promjeni boju\n\
  324. {FF4242}[V]{FFFFFF} | Opcije vozila\n\
  325. {FF4242}[V]{FFFFFF} | Gepek\n\
  326. {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
  327. }
  328. if(listitem == 9)
  329. {
  330. new newcar = GetPlayerVehicleID(playerid);
  331. if(tmpVehicleOne[playerid] == newcar || tmpVehicleTwo[playerid] == newcar || tmpVehicleThree[playerid] == newcar || tmpVehicleFour[playerid] == newcar || tmpVehicleFive[playerid] == newcar || tmpVehicleSix[playerid] == newcar || tmpVehicleSeven[playerid] == newcar || tmpVehicleEight[playerid] == newcar)
  332. {
  333. if (!IsPlayerInAnyVehicle(playerid)) return GRESKA(playerid,"Morate biti u vozilu da ga odtunirate.");
  334. new vehicleid = GetPlayerVehicleID(playerid);
  335. new fajlidauta;
  336. if(vehicleid == tmpVehicleOne[playerid])
  337. {
  338. fajlidauta = PlayerInfo[playerid][vehicleKeyOne];
  339. }
  340. else if(vehicleid == tmpVehicleTwo[playerid])
  341. {
  342. fajlidauta = PlayerInfo[playerid][vehicleKeyTwo];
  343. }
  344. else if(vehicleid == tmpVehicleThree[playerid])
  345. {
  346. fajlidauta = PlayerInfo[playerid][vehicleKeyThree];
  347. }
  348. else if(vehicleid == tmpVehicleFour[playerid])
  349. {
  350. fajlidauta = PlayerInfo[playerid][vehicleKeyFour];
  351. }
  352. else if(vehicleid == tmpVehicleFive[playerid])
  353. {
  354. fajlidauta = PlayerInfo[playerid][vehicleKeyFive];
  355. }
  356. else if(vehicleid == tmpVehicleSix[playerid])
  357. {
  358. fajlidauta = PlayerInfo[playerid][vehicleKeySix];
  359. }
  360. else if(vehicleid == tmpVehicleSeven[playerid])
  361. {
  362. fajlidauta = PlayerInfo[playerid][vehicleKeySeven];
  363. }
  364. else if(vehicleid == tmpVehicleEight[playerid])
  365. {
  366. fajlidauta = PlayerInfo[playerid][vehicleKeyEight];
  367. }
  368. VehiclesMod[fajlidauta][0] =
  369. VehiclesMod[fajlidauta][1] =
  370. VehiclesMod[fajlidauta][2] =
  371. VehiclesMod[fajlidauta][3] =
  372. VehiclesMod[fajlidauta][4] =
  373. VehiclesMod[fajlidauta][5] =
  374. VehiclesMod[fajlidauta][6] =
  375. VehiclesMod[fajlidauta][7] =
  376. VehiclesMod[fajlidauta][8] =
  377. VehiclesMod[fajlidauta][9] = 0;
  378. VehiclesMod[fajlidauta][10] = -1;
  379. SCM(playerid,0x0A9DC9AA,"TRPG: {FFFFFF}Vozilo odtunirano i respawnano");
  380. saveVehicle(fajlidauta);
  381. AC_SetVehicleToRespawn(vehicleid);
  382. return 1;
  383. }
  384. else
  385. {
  386. GRESKA(playerid,"Ovo nije vase vozilo.");
  387. }
  388. return 1;
  389. }
  390. if(listitem == 10)
  391. {
  392. new newcar = GetPlayerVehicleID(playerid);
  393. if(tmpVehicleOne[playerid] != newcar && tmpVehicleTwo[playerid] != newcar && tmpVehicleThree[playerid] != newcar && tmpVehicleFour[playerid] != newcar && tmpVehicleFive[playerid] != newcar && tmpVehicleSix[playerid] != newcar && tmpVehicleSeven[playerid] != newcar && tmpVehicleEight[playerid] != newcar) return GRESKA(playerid, "Morate biti u svome vozilu!");
  394. ShowPlayerDialog(playerid, 1285, DIALOG_STYLE_LIST,"Radio","Cool Radio\nBalkan DJ\nTDI Radio\nPlay Radio\nBig Narodna\nZaustavi radio","Odberi","Otkazi");
  395. }
  396. }
  397. }
  398. }
  399. //--------------------------------------------------
  400. CMD:v(playerid)
  401. {
  402. if(naGames[playerid] != 0) return GRESKA(playerid, "Ne mozete to na GAMES!");
  403. if(dueling[playerid]) return GRESKA(playerid, "U duelu ste.");
  404. if(IgracUWaru(playerid)) return GRESKA(playerid, "U waru ste");
  405. //if(PlayerCP[playerid] > 0) return GRESKA(playerid, "Ne mozes koristi ovu komandu dok si na eventu.");
  406. //if(EventInfo[EventTime] != 0) return GRESKA(playerid, "Trenutno je aktivan event, zbog sigurnosti sad ne mozes pristupiti ovome.");
  407.  
  408. if(tmpVehicleOne[playerid] >= 65000 || tmpVehicleTwo[playerid] >= 65000 || tmpVehicleThree[playerid] >= 65000 || tmpVehicleFour[playerid] >= 65000 || tmpVehicleFive[playerid] >= 65000 || tmpVehicleSix[playerid] >= 65000 || tmpVehicleSeven[playerid] >= 65000 || tmpVehicleEight[playerid] >= 65000)
  409. {
  410. UnistiAuta(playerid);
  411. vTypedTimes[playerid] = false;
  412. return GRESKA(playerid, "Desila se greska prilikom citanja vozila, sva vasa vozila su unistena. Pokusajte ponovo.");
  413. }
  414. switch(vTypedTimes[playerid]) {
  415. case false: ShowPlayerDialog(playerid, 2318, DIALOG_STYLE_MSGBOX, "{0099CC}[TEST - TEST]", "{ffffff}Da li zelite spawnovati sva vozila?", "Da", "Ne");
  416. case true: {
  417.  
  418. if(ZamjenaInfo[playerid][zAktivna]) return GRESKA(playerid, "Ne mozete koristiti ovu komandu dok imate aktivnu zamjenu!");
  419.  
  420. new auto1 = tmpVehicleOne[playerid],
  421. auto2 = tmpVehicleTwo[playerid],
  422. auto3 = tmpVehicleThree[playerid],
  423. auto4 = tmpVehicleFour[playerid],
  424. auto5 = tmpVehicleFive[playerid],
  425. auto6 = tmpVehicleSix[playerid],
  426. auto7 = tmpVehicleSeven[playerid],
  427. auto8 = tmpVehicleEight[playerid];
  428.  
  429. new model1[20], model2[20], model3[20], model4[20], model5[20], model6[20], model7[20], model8[20];
  430. if(auto1 == -1 || auto1 == -2) format(model1, sizeof(model1), "Prazno");
  431. else format(model1, sizeof(model1), "%s", GetVehicleName(auto1));
  432. if(auto2 == -1 || auto2 == -2) format(model2, sizeof(model2), "Prazno");
  433. else format(model2, sizeof(model2), "%s", GetVehicleName(auto2));
  434. if(auto3 == -1 || auto3 == -2) format(model3, sizeof(model3), "Prazno");
  435. else format(model3, sizeof(model3), "%s", GetVehicleName(auto3));
  436. if(auto4 == -1 || auto4 == -2) format(model4, sizeof(model4), "Prazno");
  437. else format(model4, sizeof(model4), "%s", GetVehicleName(auto4));
  438. if(auto5 == -1 || auto5 == -2) format(model5, sizeof(model5), "Prazno");
  439. else format(model5, sizeof(model5), "%s", GetVehicleName(auto5));
  440. if(auto6 == -1 || auto6 == -2) format(model6, sizeof(model6), "Prazno");
  441. else format(model6, sizeof(model6), "%s", GetVehicleName(auto6));
  442. if(auto7 == -1 || auto7 == -2) format(model7, sizeof(model7), "Prazno");
  443. else format(model7, sizeof(model7), "%s", GetVehicleName(auto7));
  444. if(auto8 == -1 || auto8 == -2) format(model8, sizeof(model8), "Prazno");
  445. else format(model8, sizeof(model8), "%s", GetVehicleName(auto8));
  446.  
  447. if(PlayerInfo[playerid][vehicleKeyOne] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyOne]][cParking] == -2) format(model1, sizeof(model1), "Zaplenjen");
  448. else if(PlayerInfo[playerid][vehicleKeyTwo] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyTwo]][cParking] == -2) format(model2, sizeof(model2), "Zaplenjen");
  449. else if(PlayerInfo[playerid][vehicleKeyThree] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyThree]][cParking] == -2) format(model3, sizeof(model3), "Zaplenjen");
  450. else if(PlayerInfo[playerid][vehicleKeyFour] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyFour]][cParking] == -2) format(model4, sizeof(model4), "Zaplenjen");
  451. else if(PlayerInfo[playerid][vehicleKeyFive] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyFive]][cParking] == -2) format(model5, sizeof(model5), "Zaplenjen");
  452. else if(PlayerInfo[playerid][vehicleKeySix] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeySix]][cParking] == -2) format(model6, sizeof(model6), "Zaplenjen");
  453. else if(PlayerInfo[playerid][vehicleKeySeven] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeySeven]][cParking] == -2) format(model7, sizeof(model7), "Zaplenjen");
  454. else if(PlayerInfo[playerid][vehicleKeyEight] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyEight]][cParking] == -2) format(model8, sizeof(model8), "Zaplenjen");
  455.  
  456. new dlg[550];
  457. format(dlg,sizeof(dlg), "{FF4242}[V]{FFFFFF} | Lista Vozila\n\
  458. {FF4242}[S-1]{FFFFFF} | %s\n\
  459. {FF4242}[S-2]{FFFFFF} | %s\n\
  460. {FF4242}[S-3]{FFFFFF} | %s\n\
  461. {FF4242}[DONATORSKI S-1]{FFFFFF} | %s\n\
  462. {FF4242}[DONATORSKI S-2]{FFFFFF} | %s\n\
  463. {FF4242}[DONATORSKI S-3]{FFFFFF} | %s\n\
  464. {FF4242}[DONATORSKI S-4]{FFFFFF} | %s\n\
  465. {FF4242}[DONATORSKI S-5]{FFFFFF} | %s\n\
  466. {FF4242}[V]{FFFFFF} | Ukloni Tuning\n\
  467. {FF4242}[V]{FFFFFF} | Radio", model1, model2, model3, model4, model5, model6, model7, model8);
  468. ShowPlayerDialog(playerid, 2318, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]", dlg, "Odberi", "Izlez");
  469. }
  470. }
  471.  
  472. return 1;
  473. }
  474. //--------------------------------------------------------------
  475. else if(playertextid == Salon[12][playerid])
  476. {
  477. if(GledaKatalog[playerid] == -1) return GRESKA(playerid,"Otidjite relog,ili prijavite gresku adminima!");
  478.  
  479. PrikaziSalonTD(playerid, 2);
  480. GledaKatalog[playerid] = -1;
  481. ListaVozila[playerid] = -1;
  482. SalonKupuje[SalonID[playerid]] = -1;
  483. INFO(playerid,"Odustali ste od kupovine,zatvorili ste salon meni!");
  484. return 1;
  485. }
  486. else if(playertextid == Salon[9][playerid])
  487. {
  488. new idsalona = GledaKatalog[playerid];
  489. new voziloporedu = ListaVozila[playerid];
  490. new string[1204], vehicleid;
  491. if(PlayerInfo[playerid][pLevel] < 5) return GRESKA(playerid,"Morate biti level '+5' za kupovinu!");
  492. if(SaloniInfo[idsalona][saOGModela][voziloporedu] == 0) return GRESKA(playerid,"Tih modela vise nemam na prodaju!");
  493. if(PlayerInfo[playerid][pCash] < SaloniInfo[idsalona][saCena][voziloporedu]) return GRESKA(playerid,"Nemate dovolno pari!");
  494.  
  495. format(string,sizeof(string), "{FFFFFF}- Da li zelite da kupite vozilo -> {D42038}'%s'{FFFFFF}.\n\
  496. {FFFFFF}- Cena vozila koje ste izabrali -> {D42038}'$%d'{FFFFFF}.\n\
  497. {FFFFFF}- Kliknite na 'Kupi' ako zelite da kupite vozilo.\n\
  498. {FFFFFF}- Kliknite na 'Odustani' ako necete da kupite vozilo.",ImenaVozila[SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]] - 400],
  499. SaloniInfo[idsalona][saCena][voziloporedu]);
  500. PodesiVozilo(playerid, vehicleid);
  501. ShowPlayerDialog(playerid, D_KUPOVINAVOZILA, DIALOG_STYLE_MSGBOX, "{0099CC}[TEST - TEST]", string, "Kupi", "Otkazi");
  502. return 1;
  503. }
  504. else if(playertextid == Salon[10][playerid])
  505. {
  506. if(GledaKatalog[playerid] != -1)
  507. {
  508. if(ListaVozila[playerid] - 1 < 0) return GRESKA(playerid,"Ne mozete vise nazad!");
  509. if(SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]-1] == 0) return GRESKA(playerid,"Nemamo vise vozila!");
  510.  
  511. ListaVozila[playerid] --;
  512.  
  513. if(ListaVozila[playerid] < 0)
  514. {
  515. ListaVozila[playerid] = 0;
  516. }
  517. PodesiSalonTD(playerid);
  518. return 1;
  519. }
  520. }
  521. else if(playertextid == Salon[11][playerid])
  522. {
  523. if(GledaKatalog[playerid] != -1)
  524. {
  525. if(ListaVozila[playerid] + 1 > 40) return GRESKA(playerid,"Ne mozete vise napred!");
  526. if(SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]+1] == 0) return GRESKA(playerid,"Nemamo vise vozila!");
  527.  
  528. ListaVozila[playerid] ++;
  529.  
  530. if(ListaVozila[playerid] > 40)
  531. {
  532. ListaVozila[playerid] = 40;
  533. }
  534. PodesiSalonTD(playerid);
  535. return 1;
  536. }
  537. }
  538.  
  539. //========================================================
  540. CMD:kreirajsalon(playerid, params[])
  541. {
  542. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  543. if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  544.  
  545. new idsalona = Iter_Free(i_Saloni);
  546.  
  547. if (idsalona < 0)
  548. return GRESKA(playerid, "Nije moguce kreirati salon.");
  549.  
  550. new Float:Poz[3];
  551. new salonime[25];
  552. if(sscanf(params, "s[25]",salonime)) return USAGE(playerid,"/kreirajsalon [Ime Salona]");
  553.  
  554. if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete u intu!");
  555. if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Mora vam VW biti 0!");
  556.  
  557. Iter_Add(i_Saloni, idsalona);
  558. GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
  559. SaloniInfo[idsalona][saPostavljen] =
  560. SaloniInfo[idsalona][saKupovina] = 0;
  561. SaloniInfo[idsalona][saSpawn][0] = Poz[0];
  562. SaloniInfo[idsalona][saSpawn][1] = Poz[1];
  563. SaloniInfo[idsalona][saSpawn][2] = Poz[2];
  564. SaloniInfo[idsalona][saVehicle][0] =
  565. SaloniInfo[idsalona][saVehicle][1] =
  566. SaloniInfo[idsalona][saVehicle][2] =
  567. SaloniInfo[idsalona][saVehicle][3] = 0.0;
  568. format(SaloniInfo[idsalona][saIme],25,salonime);
  569. for(new da = 0; da < 40; da++)
  570. {
  571. SaloniInfo[idsalona][saModel][da] =
  572. SaloniInfo[idsalona][saCena][da] =
  573. SaloniInfo[idsalona][saOGModela][da] = 0;
  574. }
  575. static query[80];
  576. mysql_format(SQL, query, sizeof query, "INSERT INTO `saloni` (`ID`,`Salon_Postavljen`) VALUES (%d,0)", idsalona);
  577. mysql_pquery(SQL, query, "SQL_Thread", "dd", createdSaloon, idsalona);
  578. INFO(playerid,"Salon uspesno kreiran sada koristite - '/spawnvozila'.");
  579. return true;
  580. }
  581. CMD:imesalona(playerid, params[])
  582. {
  583. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  584. if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  585. new idsalona;
  586. new salonime[25];
  587. if(sscanf(params, "is[25]", idsalona,salonime)) return USAGE(playerid,"/imesalona [ID SALONA] [Ime Salona]");
  588.  
  589. if(idsalona < 1 || idsalona >= MAX_SALONA) return GRESKA(playerid,"Ne moze ispod 1 niti vise od MAX_SALONA!");
  590. if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete u intu!");
  591. if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Mora vam VW biti 0!");
  592.  
  593. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  594.  
  595. format(SaloniInfo[idsalona][saIme],25,salonime);
  596.  
  597. UpdateSalonTD(idsalona);
  598. saveSaloon(idsalona);
  599.  
  600. return true;
  601. }
  602. CMD:obrisisalon(playerid, params[])
  603. {
  604. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  605. if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  606. new idsalona;
  607. if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/obrisisalon [ID SALONA]");
  608.  
  609. if(idsalona < 1 || idsalona >= MAX_SALONA) return GRESKA(playerid,"Ne moze ispod 1 niti vise od MAX_SALONA!");
  610. if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete u intu!");
  611. if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Mora vam VW biti 0!");
  612. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  613.  
  614. SaloniInfo[idsalona][saPostavljen] = SaloniInfo[idsalona][saKupovina] = 0;
  615. SaloniInfo[idsalona][saSpawn][0] = 0.0;
  616. SaloniInfo[idsalona][saSpawn][1] = 0.0;
  617. SaloniInfo[idsalona][saSpawn][2] = 1000.0;
  618. SaloniInfo[idsalona][saVehicle][0] = 0.0;
  619. SaloniInfo[idsalona][saVehicle][1] = 0.0;
  620. SaloniInfo[idsalona][saVehicle][2] = 0.0;
  621. SaloniInfo[idsalona][saVehicle][3] = 0.0;
  622. for(new da = 0; da < 40; da++)
  623. {
  624. SaloniInfo[idsalona][saModel][da] = 0;
  625. SaloniInfo[idsalona][saCena][da] = 0;
  626. SaloniInfo[idsalona][saOGModela][da] = 0;
  627. }
  628.  
  629. if (IsValidDynamic3DTextLabel(Saloni_3D[idsalona])) {
  630. DestroyDynamic3DTextLabel(Saloni_3D[idsalona]);
  631. Saloni_3D[idsalona] = Text3D:INVALID_3DTEXT_ID;
  632. }
  633. if(IsValidDynamicPickup(Saloni_Pickup[idsalona])) { DestroyDynamicPickup(Saloni_Pickup[idsalona]); Saloni_Pickup[idsalona] = INVALID_PICKUP_ID; }
  634. if(IsValidDynamicMapIcon(SaloniInfo[idsalona][saMapIcon])) {
  635. DestroyDynamicMapIcon(SaloniInfo[idsalona][saMapIcon]);
  636. SaloniInfo[idsalona][saMapIcon] = -1;
  637. }
  638.  
  639. new query[60];
  640. mysql_format(SQL, query, sizeof query, "DELETE FROM `saloni` WHERE ID=%d LIMIT 1", idsalona);
  641. mysql_tquery(SQL, query);
  642. SaloniInfo[idsalona][saExist] = false;
  643. Iter_Remove(i_Saloni, idsalona);
  644. return true;
  645. }
  646.  
  647. CMD:spawnvozila(playerid, params[])
  648. {
  649. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  650. if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  651.  
  652. new idsalona;
  653. new Float:Poz[4];
  654. if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/spawnvozila [ID]");
  655.  
  656. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  657. if(!IsPlayerInAnyVehicle(playerid)) return GRESKA(playerid,"Da bi ste odredili spawn vozila morate koristiti bilo koje vozilo!");
  658.  
  659. GetVehiclePos(GetPlayerVehicleID(playerid), Poz[0], Poz[1], Poz[2]);
  660. GetVehicleZAngle(GetPlayerVehicleID(playerid), Poz[3]);
  661.  
  662. SaloniInfo[idsalona][saVehicle][0] = Poz[0];
  663. SaloniInfo[idsalona][saVehicle][1] = Poz[1];
  664. SaloniInfo[idsalona][saVehicle][2] = Poz[2];
  665. SaloniInfo[idsalona][saVehicle][3] = Poz[3];
  666. saveSaloon(idsalona);
  667.  
  668. INFO(playerid,"Uspesno ste odredili spawn vozila za kupovinu sada koristite - '/dodajvozila'.");
  669. return true;
  670. }
  671.  
  672. CMD:dodajvozila(playerid, params[])
  673. {
  674. if(!IsSpecialUser(playerid)) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  675. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  676.  
  677. new idsalona;
  678. new modelid;
  679. new cijena;
  680. new maxmodela;
  681. if(sscanf(params, "iiii", idsalona, modelid, cijena, maxmodela)) return USAGE(playerid,"/dodajvozila [ID SALONA] [MODEL ID] [CENA] [MAX KUPLJENIH]");
  682.  
  683. if(modelid < 400 || modelid > 611) return GRESKA(playerid,"Model nije validan!");
  684. if(cijena < 10000 || cijena > 1000000000) return GRESKA(playerid,"Cena ne moze biti manja od 10000 niti veca od 1000000000!");
  685.  
  686. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  687. if(SaloniInfo[idsalona][saVehicle][0] == 0.0) return GRESKA(playerid,"Nije spawn postavljen - '/spawnvozila'.");
  688. if(SaloniInfo[idsalona][saModel][39] != 0) return GRESKA(playerid,"Svi slotovi u salonu su popunjeni!");
  689.  
  690. for(new da = 0; da < 40; da++)
  691. {
  692. if(SaloniInfo[idsalona][saModel][da] == 0)
  693. {
  694. SaloniInfo[idsalona][saModel][da] = modelid;
  695. SaloniInfo[idsalona][saCena][da] = cijena;
  696. SaloniInfo[idsalona][saOGModela][da] = maxmodela;
  697. break;
  698. }
  699. }
  700.  
  701. SaloniInfo[idsalona][saPostavljen] = 1;
  702. UpdateSalonTD(idsalona);
  703. saveSaloon(idsalona);
  704.  
  705. INFO(playerid,"Uspesno ste dodali vozilo u salon!");
  706. INFO(playerid,"Da izmenite stanje vozila u salonima koristite - '/promenisalon'.");
  707. return true;
  708. }
  709.  
  710. CMD:salonkupovina(playerid, params[])
  711. {
  712. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  713. if(PlayerInfo[playerid][pZGAnovi] != 10 && PlayerInfo[playerid][pZGAnovi] != 9) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  714.  
  715. new idsalona;
  716. new kupovina;
  717. new pName[MAX_PLAYER_NAME];
  718. GetPlayerName(playerid, pName);
  719. if(sscanf(params, "ii", idsalona, kupovina)) return USAGE(playerid,"/salonkupovina [ID SALONA] [DA/NE]");
  720.  
  721. if(idsalona >= 9 && !IsSpecialUser(playerid)) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  722.  
  723. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  724.  
  725. SaloniInfo[idsalona][saKupovina] = kupovina;
  726.  
  727. saveSaloon(idsalona);
  728. UpdateSalonTD(idsalona);
  729.  
  730. INFO(playerid,"Uspesno izmenjena salon kupovina!");
  731. return true;
  732. }
  733.  
  734. CMD:promenisalon(playerid, params[])
  735. {
  736. if(!IsSpecialUser(playerid)) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  737. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  738.  
  739. new idsalona;
  740. new kolicina;
  741. new vozilopr;
  742. if(sscanf(params, "iii", idsalona, kolicina, vozilopr)) return USAGE(playerid,"/promenisalon [ID SALONA] [MAX_KUPLJENIH] [VOZILO PO REDU(1-40)]");
  743.  
  744. if(kolicina < 0 || kolicina > 40) return GRESKA(playerid,"Kolicina ne moze biti manja od 0 niti veca od 40!");
  745. if(vozilopr < 0 || vozilopr > 40) return GRESKA(playerid,"Ne mozete ispod 0 niti vise od 40!");
  746.  
  747. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  748. if(SaloniInfo[idsalona][saModel][vozilopr] == 0) return GRESKA(playerid,"Taj slot je prazana!");
  749.  
  750. SaloniInfo[idsalona][saOGModela][vozilopr] = kolicina;
  751. saveSaloon(idsalona);
  752.  
  753. INFO(playerid,"Uspesno dodato/oduzeto vozilo u salonu!");
  754. return true;
  755. }
  756.  
  757. CMD:premestisalon(playerid, params[])
  758. {
  759. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  760. if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  761.  
  762. new idsalona;
  763. new Float:Poz[3];
  764. if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/premestisalon [ID SALONA]");
  765.  
  766. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  767. if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete dok ste u interijeru!");
  768. if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Dok vw ne bude 0 nema nista od premestanja!");
  769.  
  770. GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
  771. SaloniInfo[idsalona][saSpawn][0] = Poz[0];
  772. SaloniInfo[idsalona][saSpawn][1] = Poz[1];
  773. SaloniInfo[idsalona][saSpawn][2] = Poz[2];
  774. if (IsValidDynamic3DTextLabel(Saloni_3D[idsalona])) {
  775. DestroyDynamic3DTextLabel(Saloni_3D[idsalona]);
  776. Saloni_3D[idsalona] = Text3D:INVALID_3DTEXT_ID;
  777. }
  778. if(IsValidDynamicPickup(Saloni_Pickup[idsalona])) { DestroyDynamicPickup(Saloni_Pickup[idsalona]); Saloni_Pickup[idsalona] = INVALID_PICKUP_ID; }
  779. if(IsValidDynamicMapIcon(SaloniInfo[idsalona][saMapIcon])) {
  780. DestroyDynamicMapIcon(SaloniInfo[idsalona][saMapIcon]);
  781. SaloniInfo[idsalona][saMapIcon] = -1;
  782. }
  783. KreirajSalon(idsalona);
  784. saveSaloon(idsalona);
  785.  
  786. INFO(playerid,"Salon premestan,premestite i katalog i ostale delove!");
  787. return true;
  788. }
  789.  
  790. CMD:gotosalon(playerid, params[])
  791. {
  792. if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
  793. if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
  794.  
  795. new idsalona;
  796. if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/gotosalon [ID SALONA]");
  797. if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
  798.  
  799. SetPlayerInterior(playerid, 0);
  800. SetPlayerVirtualWorld(playerid, 0);
  801. SetPlayerPos(playerid, SaloniInfo[idsalona][saSpawn][0], SaloniInfo[idsalona][saSpawn][1], SaloniInfo[idsalona][saSpawn][2]);
  802. INFO(playerid,"Portali ste se do auto salona!");
  803. return true;
  804. }
  805.  
  806. KreirajSalon(id)
  807. {
  808. new string[250];
  809. new salonstatus[20];
  810.  
  811. if(SaloniInfo[id][saKupovina] == 1) salonstatus = "{80FF00}Otvoren";
  812. else salonstatus = "{FF0000}Zatvoren";
  813.  
  814. format(string, sizeof(string), "{7FD7F5}[ Salon: {FF0000}%s(%d) {7FD7F5}]\n\
  815. {7FD7F5}[ Salon je: %s {7FD7F5}]\n\
  816. {7FD7F5}Za kupovinu pritisnite {FF0000}'SPACE'", SaloniInfo[id][saIme], id,salonstatus);
  817.  
  818. Saloni_3D[id] = CreateDynamic3DTextLabel(string, -1, SaloniInfo[id][saSpawn][0], SaloniInfo[id][saSpawn][1], SaloniInfo[id][saSpawn][2]+0.3, 15,_,_,_, 0, 0,_,_);
  819. Saloni_Pickup[id] = CreateDynamicPickup(1559, 1, SaloniInfo[id][saSpawn][0], SaloniInfo[id][saSpawn][1], SaloniInfo[id][saSpawn][2]);
  820. SaloniInfo[id][saMapIcon] = CreateDynamicMapIcon(SaloniInfo[id][saSpawn][0], SaloniInfo[id][saSpawn][1], SaloniInfo[id][saSpawn][2], 55, -1, 0, 0, -1, 400.0);
  821. return true;
  822. }
  823.  
  824. UpdateSalonTD(id)
  825. {
  826. new string[200];
  827. new salonstatus[20];
  828. if(SaloniInfo[id][saKupovina] == 1) salonstatus = "{80FF00}Otvoren";
  829. else salonstatus = "{FF0000}Zatvoren";
  830.  
  831. format(string, sizeof(string), "{7FD7F5}[ Salon: {FF0000}%s(%d) {7FD7F5}]\n\
  832. {7FD7F5}[ Salon je: %s {7FD7F5}]\n\
  833. {7FD7F5}Za kupovinu pritisnite {FF0000}'SPACE'", SaloniInfo[id][saIme], id,salonstatus);
  834. UpdateDynamic3DTextLabelText(Saloni_3D[id], -1, string);
  835. return true;
  836. }
  837. PrikaziSalonTD(playerid, tip)
  838. {
  839. if(tip == 1)
  840. {
  841. PlayerTextDrawShow(playerid, zaraSalon[0][playerid]);
  842. PlayerTextDrawShow(playerid, zaraSalon[1][playerid]);
  843. PlayerTextDrawShow(playerid, zaraSalon[2][playerid]);
  844. PlayerTextDrawShow(playerid, zaraSalon[3][playerid]);
  845. PlayerTextDrawShow(playerid, zaraSalon[4][playerid]);
  846. PlayerTextDrawShow(playerid, zaraSalon[5][playerid]);
  847. PlayerTextDrawShow(playerid, zaraSalon[6][playerid]);
  848. PlayerTextDrawShow(playerid, zaraSalon[7][playerid]);
  849. PlayerTextDrawShow(playerid, zaraSalon[8][playerid]);
  850. PlayerTextDrawShow(playerid, zaraSalon[9][playerid]);
  851. PlayerTextDrawShow(playerid, zaraSalon[10][playerid]);
  852. PlayerTextDrawShow(playerid, zaraSalon[11][playerid]);
  853. PlayerTextDrawShow(playerid, zaraSalon[12][playerid]);
  854.  
  855. SelectTextDraw(playerid,0x33CCFFAA);
  856. SalonTD_Kreiran[playerid] = 1;
  857. }
  858. else if(tip == 2)
  859. {
  860. PlayerTextDrawHide(playerid, zaraSalon[0][playerid]);
  861. PlayerTextDrawHide(playerid, zaraSalon[1][playerid]);
  862. PlayerTextDrawHide(playerid, zaraSalon[2][playerid]);
  863. PlayerTextDrawHide(playerid, zaraSalon[3][playerid]);
  864. PlayerTextDrawHide(playerid, zaraSalon[4][playerid]);
  865. PlayerTextDrawHide(playerid, zaraSalon[5][playerid]);
  866. PlayerTextDrawHide(playerid, zaraSalon[6][playerid]);
  867. PlayerTextDrawHide(playerid, zaraSalon[7][playerid]);
  868. PlayerTextDrawHide(playerid, zaraSalon[8][playerid]);
  869. PlayerTextDrawHide(playerid, zaraSalon[9][playerid]);
  870. PlayerTextDrawHide(playerid, zaraSalon[10][playerid]);
  871. PlayerTextDrawHide(playerid, zaraSalon[11][playerid]);
  872. PlayerTextDrawHide(playerid, zaraSalon[12][playerid]);
  873.  
  874.  
  875. GledaKatalog[playerid] = -1;
  876. ListaVozila[playerid] = -1;
  877. SalonTD_Kreiran[playerid] = 0;
  878. CancelSelectTextDraw(playerid);
  879. }
  880. return true;
  881. }
  882.  
  883. PodesiSalonTD(playerid)
  884. {
  885. new string[30], vehicleid;
  886. PlayerTextDrawHide(playerid, zaraSalon[2][playerid]);
  887. PlayerTextDrawHide(playerid, zaraSalon[3][playerid]);
  888. PlayerTextDrawHide(playerid, zaraSalon[7][playerid]);
  889. PlayerTextDrawHide(playerid, zaraSalon[8][playerid]);
  890.  
  891. PlayerTextDrawSetPreviewModel(playerid, zaraSalon[2][playerid], SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]]);
  892.  
  893. PlayerTextDrawShow(playerid, zaraSalon[2][playerid]);
  894. PlayerTextDrawShow(playerid, zaraSalon[3][playerid]);
  895. PlayerTextDrawShow(playerid, zaraSalon[7][playerid]);
  896. PlayerTextDrawShow(playerid, zaraSalon[8][playerid]);
  897.  
  898. format(string,sizeof(string), "%s", ImenaVozila[SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]] - 400]);
  899. PlayerTextDrawSetString(playerid, zaraSalon[3][playerid], string);
  900.  
  901. format(string,sizeof(string), "CENA: ~b~$%d",SaloniInfo[GledaKatalog[playerid]][saCena][ListaVozila[playerid]]);
  902. PlayerTextDrawSetString(playerid, zaraSalon[8][playerid], string);
  903.  
  904. format(string,sizeof(string), "DOSTUPNO: ~b~%d",SaloniInfo[GledaKatalog[playerid]][saOGModela][ListaVozila[playerid]]);
  905. PlayerTextDrawSetString(playerid, zaraSalon[7][playerid], string);
  906.  
  907. SelectTextDraw(playerid,0x33CCFFAA);
  908. return true;
  909. }
  910.  
  911. PodesiVozilo(playerid, vehicleid)
  912. {
  913. new idsalona = GledaKatalog[playerid];
  914. new voziloporedu = ListaVozila[playerid];
  915.  
  916. CarInfo[vehicleid][cVehID] = vehicleid;
  917. CarInfo[vehicleid][cVeh_OwnerID] = PlayerInfo[playerid][pID];
  918. CarInfo[vehicleid][cOwned] = 1;
  919. strmid(CarInfo[vehicleid][cOwner], GetName(playerid), 0, strlen(GetName(playerid)), 25);
  920. format(CarInfo[vehicleid][cTablice], 15, "Nema");
  921. CarInfo[vehicleid][cLocationx] = SaloniInfo[idsalona][saVehicle][0];
  922. CarInfo[vehicleid][cLocationy] = SaloniInfo[idsalona][saVehicle][1];
  923. CarInfo[vehicleid][cLocationz] = SaloniInfo[idsalona][saVehicle][2];
  924. CarInfo[vehicleid][cAngle] = SaloniInfo[idsalona][saVehicle][3];
  925. CarInfo[vehicleid][cColorOne] = 1;
  926. CarInfo[vehicleid][cColorTwo] = 1;
  927. CarInfo[vehicleid][cModel] = SaloniInfo[idsalona][saModel][voziloporedu];
  928. CarInfo[vehicleid][cValue] = SaloniInfo[idsalona][saCena][voziloporedu];
  929. CarInfo[vehicleid][cLock] = 0;
  930. CarInfo[vehicleid][cOriginLocationx] = SaloniInfo[idsalona][saVehicle][0];
  931. CarInfo[vehicleid][cOriginLocationy] = SaloniInfo[idsalona][saVehicle][1];
  932. CarInfo[vehicleid][cOriginLocationz] = SaloniInfo[idsalona][saVehicle][2];
  933. CarInfo[vehicleid][cOriginAngle] = SaloniInfo[idsalona][saVehicle][3];
  934. CarInfo[vehicleid][cVW] = 0;
  935. CarInfo[vehicleid][cInt] = 0;
  936. CarInfo[vehicleid][cReg] = 0;
  937. CarInfo[vehicleid][cGorivo] = 60;
  938. CarInfo[vehicleid][cNeon] =
  939. CarInfo[vehicleid][cSvetla] =
  940. CarInfo[vehicleid][cParking] =
  941. CarInfo[vehicleid][cTempomat] =
  942. CarInfo[vehicleid][cRezervoar] =
  943. CarInfo[vehicleid][cAttachPrednji] =
  944. CarInfo[vehicleid][cSpojler] =
  945. CarInfo[vehicleid][cBlindiran] =
  946. CarInfo[vehicleid][cBlindiran1] =
  947. CarInfo[vehicleid][cBlindiran2] =
  948. CarInfo[vehicleid][cUnisten] =
  949. CarInfo[vehicleid][cRadar] =
  950. CarInfo[vehicleid][cVIP] =
  951. CarInfo[vehicleid][cAttachZadnji] = 0;
  952. CarInfo[vehicleid][cHealth] = 0.0;
  953.  
  954. static query[750];
  955. mysql_format(SQL, query, sizeof query, "INSERT INTO `auta` (`ID`,`VVlasnik`,`ImaVlasnika`,`Vlasnik`,`LokacijaX`,`LokacijaY`,`LokacijaZ`,`Kut`,`Boja1`,`Boja2`,`Vehid`,`Cena`,`IzvornalokacijaX`,`IzvornalokacijaY`,`IzvornalokacijaZ`,`Izvornikut`,`VW`,`Int`,`AttachPrednji`,`AttachZadnji`,`Spojler`,`Blindiran`,`Blindiran1`,`Blindiran2`,`Unisten`,`Radar`,`VIP`) \
  956. VALUES (%d, %d, %d, '%e', %f, %f, %f, %f, %d, %d, %d, %d, %f, %f, %f, %f, %d, %d, '%d','%d','%d','%d','%d','%d', '%d', '%d', '%d')",
  957. vehicleid, CarInfo[vehicleid][cVeh_OwnerID], CarInfo[vehicleid][cOwned], CarInfo[vehicleid][cOwner], CarInfo[vehicleid][cLocationx], CarInfo[vehicleid][cLocationy], CarInfo[vehicleid][cLocationz], CarInfo[vehicleid][cAngle],
  958. CarInfo[vehicleid][cColorOne], CarInfo[vehicleid][cColorTwo], CarInfo[vehicleid][cModel], CarInfo[vehicleid][cValue], CarInfo[vehicleid][cOriginLocationx], CarInfo[vehicleid][cOriginLocationy], CarInfo[vehicleid][cOriginLocationz], CarInfo[vehicleid][cOriginAngle],
  959. CarInfo[vehicleid][cVW], CarInfo[vehicleid][cInt], CarInfo[vehicleid][cAttachPrednji], CarInfo[vehicleid][cAttachZadnji],CarInfo[vehicleid][cSpojler],CarInfo[vehicleid][cBlindiran],CarInfo[vehicleid][cBlindiran1],CarInfo[vehicleid][cBlindiran2],CarInfo[vehicleid][cUnisten],CarInfo[vehicleid][cRadar],CarInfo[vehicleid][cVIP]);
  960. mysql_tquery(SQL, query);
  961.  
  962. CarInfo[vehicleid][cExist] = true;
  963.  
  964. saveVehicle(vehicleid);
  965. PodesiVozilo(playerid, vehicleid);
  966.  
  967. if(CarInfo[vehicleid][cModel] < 400 || CarInfo[vehicleid][cModel] > 611)
  968. {
  969. PrikaziSalonTD(playerid, 2);
  970. if(PlayerInfo[playerid][vehicleKeyOne] == vehicleid) PlayerInfo[playerid][vehicleKeyOne] = -1;
  971. if(PlayerInfo[playerid][vehicleKeyTwo] == vehicleid) PlayerInfo[playerid][vehicleKeyTwo] = -1;
  972. if(PlayerInfo[playerid][vehicleKeyThree] == vehicleid) PlayerInfo[playerid][vehicleKeyThree] = -1;
  973. if(PlayerInfo[playerid][vehicleKeyFour] == vehicleid) PlayerInfo[playerid][vehicleKeyFour] = -1;
  974. if(PlayerInfo[playerid][vehicleKeyFive] == vehicleid) PlayerInfo[playerid][vehicleKeyFive] = -1;
  975. if(PlayerInfo[playerid][vehicleKeySix] == vehicleid) PlayerInfo[playerid][vehicleKeySix] = -1;
  976. if(PlayerInfo[playerid][vehicleKeySeven] == vehicleid) PlayerInfo[playerid][vehicleKeySeven] = -1;
  977. if(PlayerInfo[playerid][vehicleKeyEight] == vehicleid) PlayerInfo[playerid][vehicleKeyEight] = -1;
  978. GRESKA(playerid, "Doslo je do greske pri kupovini vozila!");
  979. savePlayer(playerid);
  980. deleteVehicle(vehicleid);
  981. }
  982. else
  983. {
  984. AC_GivePlayerMoneyMinus(playerid, SaloniInfo[idsalona][saCena][voziloporedu]);
  985. SaloniInfo[idsalona][saOGModela][voziloporedu] --;
  986. PrikaziSalonTD(playerid, 2);
  987. saveSaloon(idsalona);
  988. savePlayer(playerid);
  989. INFO(playerid,"Uspesno ste kupili vozilo!");
  990. INFO(playerid,"Cestitamo na kupovini - dodjite nam opet!");
  991. INFO(playerid,"Ukucajte /v da stvorite vase kupljeno vozilo!");
  992. }
  993.  
  994. return true;
  995. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement