Advertisement
Guest User

Dinamicno kreiranje sladoleda with TDs by Shomy

a guest
Feb 21st, 2018
1,683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.26 KB | None | 0 0
  1. /*
  2. Dinamicno kreiranje sladoleda
  3. With Textdraws
  4. by Shomy
  5. 1341
  6. */
  7.  
  8. #include < a_samp >
  9. #include < YSI\y_ini >
  10. #include < YSI\y_commands >
  11.  
  12. #define MAX_SLADOLEDI 50
  13. #define SLADOLED_FILE "/Sladoledi/%d.ini"
  14. #undef MAX_PLAYERS
  15. #define MAX_PLAYERS 50 // Prilagoditi //
  16.  
  17. enum sInfo {
  18.  
  19. Float:PosX,
  20. Float:PosY,
  21. Float:PosZ,
  22. Float:RotX,
  23. Float:RotY,
  24. Float:RotZ
  25. }
  26.  
  27. new SladoledInfo[ MAX_SLADOLEDI ][ sInfo ], SladoledC[ sizeof(SladoledInfo) ], Text:SladoledTD[31], Text3D:SladoledLabel[ sizeof(SladoledInfo) ],
  28. KreiraSladoled[ MAX_PLAYERS ], bool:KupujeSladoled[ MAX_PLAYERS ];
  29.  
  30. forward LoadSladoled(id, name[], value[]);
  31. public LoadSladoled(id, name[], value[]) {
  32.  
  33. INI_Float("Lokacija_X", SladoledInfo[ id ][ PosX ]);
  34. INI_Float("Lokacija_Y", SladoledInfo[ id ][ PosY ]);
  35. INI_Float("Lokacija_Z", SladoledInfo[ id ][ PosZ ]);
  36. INI_Float("Rotacija_X", SladoledInfo[ id ][ RotX ]);
  37. INI_Float("Rotacija_Y", SladoledInfo[ id ][ RotY ]);
  38. INI_Float("Rotacija_Z", SladoledInfo[ id ][ RotZ ]);
  39. return 1;
  40. }
  41. public OnFilterScriptInit() {
  42.  
  43. SladoledTD[0] = TextDrawCreate(211.120071, 143.333343, "LD_SPAC:white");
  44. TextDrawLetterSize(SladoledTD[0], 0.000000, 0.000000);
  45. TextDrawTextSize(SladoledTD[0], 219.000000, 131.000000);
  46. TextDrawAlignment(SladoledTD[0], 1);
  47. TextDrawColor(SladoledTD[0], 7838207);
  48. TextDrawSetShadow(SladoledTD[0], 0);
  49. TextDrawSetOutline(SladoledTD[0], 0);
  50. TextDrawBackgroundColor(SladoledTD[0], 255);
  51. TextDrawFont(SladoledTD[0], 4);
  52. TextDrawSetProportional(SladoledTD[0], 0);
  53. TextDrawSetShadow(SladoledTD[0], 0);
  54.  
  55. SladoledTD[1] = TextDrawCreate(213.931198, 145.666671, "LD_SPAC:white");
  56. TextDrawLetterSize(SladoledTD[1], 0.000000, 0.000000);
  57. TextDrawTextSize(SladoledTD[1], 214.000000, 117.000000);
  58. TextDrawAlignment(SladoledTD[1], 1);
  59. TextDrawColor(SladoledTD[1], 255);
  60. TextDrawSetShadow(SladoledTD[1], 0);
  61. TextDrawSetOutline(SladoledTD[1], 0);
  62. TextDrawBackgroundColor(SladoledTD[1], 255);
  63. TextDrawFont(SladoledTD[1], 4);
  64. TextDrawSetProportional(SladoledTD[1], 0);
  65. TextDrawSetShadow(SladoledTD[1], 0);
  66.  
  67. SladoledTD[2] = TextDrawCreate(213.931182, 145.666687, "LD_SPAC:white");
  68. TextDrawLetterSize(SladoledTD[2], 0.000000, 0.000000);
  69. TextDrawTextSize(SladoledTD[2], 40.000000, 74.000000);
  70. TextDrawAlignment(SladoledTD[2], 1);
  71. TextDrawColor(SladoledTD[2], 7838207);
  72. TextDrawSetShadow(SladoledTD[2], 0);
  73. TextDrawSetOutline(SladoledTD[2], 0);
  74. TextDrawBackgroundColor(SladoledTD[2], 255);
  75. TextDrawFont(SladoledTD[2], 4);
  76. TextDrawSetProportional(SladoledTD[2], 0);
  77. TextDrawSetShadow(SladoledTD[2], 0);
  78.  
  79. SladoledTD[3] = TextDrawCreate(389.158538, 145.083358, "LD_SPAC:white");
  80. TextDrawLetterSize(SladoledTD[3], 0.000000, 0.000000);
  81. TextDrawTextSize(SladoledTD[3], 40.000000, 74.000000);
  82. TextDrawAlignment(SladoledTD[3], 1);
  83. TextDrawColor(SladoledTD[3], 7838207);
  84. TextDrawSetShadow(SladoledTD[3], 0);
  85. TextDrawSetOutline(SladoledTD[3], 0);
  86. TextDrawBackgroundColor(SladoledTD[3], 255);
  87. TextDrawFont(SladoledTD[3], 4);
  88. TextDrawSetProportional(SladoledTD[3], 0);
  89. TextDrawSetShadow(SladoledTD[3], 0);
  90.  
  91. SladoledTD[4] = TextDrawCreate(300.607910, 145.083389, "LD_SPAC:white");
  92. TextDrawLetterSize(SladoledTD[4], 0.000000, 0.000000);
  93. TextDrawTextSize(SladoledTD[4], 40.000000, 74.000000);
  94. TextDrawAlignment(SladoledTD[4], 1);
  95. TextDrawColor(SladoledTD[4], 7838207);
  96. TextDrawSetShadow(SladoledTD[4], 0);
  97. TextDrawSetOutline(SladoledTD[4], 0);
  98. TextDrawBackgroundColor(SladoledTD[4], 255);
  99. TextDrawFont(SladoledTD[4], 4);
  100. TextDrawSetProportional(SladoledTD[4], 0);
  101. TextDrawSetShadow(SladoledTD[4], 0);
  102.  
  103. SladoledTD[5] = TextDrawCreate(217.847717, 223.833297, "RUMENKO");
  104. TextDrawLetterSize(SladoledTD[5], 0.175109, 1.115833);
  105. TextDrawAlignment(SladoledTD[5], 1);
  106. TextDrawColor(SladoledTD[5], -1);
  107. TextDrawSetShadow(SladoledTD[5], 0);
  108. TextDrawSetOutline(SladoledTD[5], 0);
  109. TextDrawBackgroundColor(SladoledTD[5], 255);
  110. TextDrawFont(SladoledTD[5], 2);
  111. TextDrawSetProportional(SladoledTD[5], 1);
  112. TextDrawSetShadow(SladoledTD[5], 0);
  113.  
  114. SladoledTD[6] = TextDrawCreate(298.433471, 224.999969, "King_Classic");
  115. TextDrawLetterSize(SladoledTD[6], 0.175109, 1.115833);
  116. TextDrawAlignment(SladoledTD[6], 1);
  117. TextDrawColor(SladoledTD[6], -1);
  118. TextDrawSetShadow(SladoledTD[6], 0);
  119. TextDrawSetOutline(SladoledTD[6], 0);
  120. TextDrawBackgroundColor(SladoledTD[6], 255);
  121. TextDrawFont(SladoledTD[6], 2);
  122. TextDrawSetProportional(SladoledTD[6], 1);
  123. TextDrawSetShadow(SladoledTD[6], 0);
  124.  
  125. SladoledTD[7] = TextDrawCreate(396.823272, 223.833374, "MACHO");
  126. TextDrawLetterSize(SladoledTD[7], 0.175109, 1.115833);
  127. TextDrawAlignment(SladoledTD[7], 1);
  128. TextDrawColor(SladoledTD[7], -1);
  129. TextDrawSetShadow(SladoledTD[7], 0);
  130. TextDrawSetOutline(SladoledTD[7], 0);
  131. TextDrawBackgroundColor(SladoledTD[7], 255);
  132. TextDrawFont(SladoledTD[7], 2);
  133. TextDrawSetProportional(SladoledTD[7], 1);
  134. TextDrawSetShadow(SladoledTD[7], 0);
  135.  
  136. SladoledTD[8] = TextDrawCreate(230.797943, 209.833297, "LD_BEAT:CHIT");
  137. TextDrawLetterSize(SladoledTD[8], 0.000000, 0.000000);
  138. TextDrawTextSize(SladoledTD[8], 4.000000, 7.000000);
  139. TextDrawAlignment(SladoledTD[8], 1);
  140. TextDrawColor(SladoledTD[8], -1281875201);
  141. TextDrawSetShadow(SladoledTD[8], 0);
  142. TextDrawSetOutline(SladoledTD[8], 0);
  143. TextDrawBackgroundColor(SladoledTD[8], 255);
  144. TextDrawFont(SladoledTD[8], 4);
  145. TextDrawSetProportional(SladoledTD[8], 0);
  146. TextDrawSetShadow(SladoledTD[8], 0);
  147.  
  148. SladoledTD[9] = TextDrawCreate(231.266464, 189.999984, "LD_SPAC:white");
  149. TextDrawLetterSize(SladoledTD[9], 0.000000, 0.000000);
  150. TextDrawTextSize(SladoledTD[9], 3.000000, 23.000000);
  151. TextDrawAlignment(SladoledTD[9], 1);
  152. TextDrawColor(SladoledTD[9], -1281875201);
  153. TextDrawSetShadow(SladoledTD[9], 0);
  154. TextDrawSetOutline(SladoledTD[9], 0);
  155. TextDrawBackgroundColor(SladoledTD[9], 255);
  156. TextDrawFont(SladoledTD[9], 4);
  157. TextDrawSetProportional(SladoledTD[9], 0);
  158. TextDrawSetShadow(SladoledTD[9], 0);
  159.  
  160. SladoledTD[10] = TextDrawCreate(311.852142, 161.999908, "LD_SPAC:white");
  161. TextDrawLetterSize(SladoledTD[10], 0.000000, 0.000000);
  162. TextDrawTextSize(SladoledTD[10], 19.000000, 38.000000);
  163. TextDrawAlignment(SladoledTD[10], 1);
  164. TextDrawColor(SladoledTD[10], -435734529);
  165. TextDrawSetShadow(SladoledTD[10], 0);
  166. TextDrawSetOutline(SladoledTD[10], 0);
  167. TextDrawBackgroundColor(SladoledTD[10], 255);
  168. TextDrawFont(SladoledTD[10], 4);
  169. TextDrawSetProportional(SladoledTD[10], 0);
  170. TextDrawSetShadow(SladoledTD[10], 0);
  171.  
  172. SladoledTD[11] = TextDrawCreate(223.770126, 161.999954, "LD_SPAC:white");
  173. TextDrawLetterSize(SladoledTD[11], 0.000000, 0.000000);
  174. TextDrawTextSize(SladoledTD[11], 19.000000, 38.000000);
  175. TextDrawAlignment(SladoledTD[11], 1);
  176. TextDrawColor(SladoledTD[11], -435734529);
  177. TextDrawSetShadow(SladoledTD[11], 0);
  178. TextDrawSetOutline(SladoledTD[11], 0);
  179. TextDrawBackgroundColor(SladoledTD[11], 255);
  180. TextDrawFont(SladoledTD[11], 4);
  181. TextDrawSetProportional(SladoledTD[11], 0);
  182. TextDrawSetShadow(SladoledTD[11], 0);
  183.  
  184. SladoledTD[12] = TextDrawCreate(218.616394, 147.999954, "LD_BEAT:CHIT");
  185. TextDrawLetterSize(SladoledTD[12], 0.000000, 0.000000);
  186. TextDrawTextSize(SladoledTD[12], 29.000000, 32.000000);
  187. TextDrawAlignment(SladoledTD[12], 1);
  188. TextDrawColor(SladoledTD[12], -435734529);
  189. TextDrawSetShadow(SladoledTD[12], 0);
  190. TextDrawSetOutline(SladoledTD[12], 0);
  191. TextDrawBackgroundColor(SladoledTD[12], 255);
  192. TextDrawFont(SladoledTD[12], 4);
  193. TextDrawSetProportional(SladoledTD[12], 0);
  194. TextDrawSetShadow(SladoledTD[12], 0);
  195.  
  196. SladoledTD[13] = TextDrawCreate(319.817047, 189.416656, "LD_SPAC:white");
  197. TextDrawLetterSize(SladoledTD[13], 0.000000, 0.000000);
  198. TextDrawTextSize(SladoledTD[13], 3.000000, 23.000000);
  199. TextDrawAlignment(SladoledTD[13], 1);
  200. TextDrawColor(SladoledTD[13], -1281875201);
  201. TextDrawSetShadow(SladoledTD[13], 0);
  202. TextDrawSetOutline(SladoledTD[13], 0);
  203. TextDrawBackgroundColor(SladoledTD[13], 255);
  204. TextDrawFont(SladoledTD[13], 4);
  205. TextDrawSetProportional(SladoledTD[13], 0);
  206. TextDrawSetShadow(SladoledTD[13], 0);
  207.  
  208. SladoledTD[14] = TextDrawCreate(319.348449, 209.249923, "LD_BEAT:CHIT");
  209. TextDrawLetterSize(SladoledTD[14], 0.000000, 0.000000);
  210. TextDrawTextSize(SladoledTD[14], 4.000000, 7.000000);
  211. TextDrawAlignment(SladoledTD[14], 1);
  212. TextDrawColor(SladoledTD[14], -1281875201);
  213. TextDrawSetShadow(SladoledTD[14], 0);
  214. TextDrawSetOutline(SladoledTD[14], 0);
  215. TextDrawBackgroundColor(SladoledTD[14], 255);
  216. TextDrawFont(SladoledTD[14], 4);
  217. TextDrawSetProportional(SladoledTD[14], 0);
  218. TextDrawSetShadow(SladoledTD[14], 0);
  219.  
  220. SladoledTD[15] = TextDrawCreate(311.852142, 161.999908, "LD_SPAC:white");
  221. TextDrawLetterSize(SladoledTD[15], 0.000000, 0.000000);
  222. TextDrawTextSize(SladoledTD[15], 19.000000, 38.000000);
  223. TextDrawAlignment(SladoledTD[15], 1);
  224. TextDrawColor(SladoledTD[15], -435734529);
  225. TextDrawSetShadow(SladoledTD[15], 0);
  226. TextDrawSetOutline(SladoledTD[15], 0);
  227. TextDrawBackgroundColor(SladoledTD[15], 255);
  228. TextDrawFont(SladoledTD[15], 4);
  229. TextDrawSetProportional(SladoledTD[15], 0);
  230. TextDrawSetShadow(SladoledTD[15], 0);
  231.  
  232. SladoledTD[16] = TextDrawCreate(311.852142, 161.999908, "LD_SPAC:white");
  233. TextDrawLetterSize(SladoledTD[16], 0.000000, 0.000000);
  234. TextDrawTextSize(SladoledTD[16], 19.000000, 38.000000);
  235. TextDrawAlignment(SladoledTD[16], 1);
  236. TextDrawColor(SladoledTD[16], 1764951295);
  237. TextDrawSetShadow(SladoledTD[16], 0);
  238. TextDrawSetOutline(SladoledTD[16], 0);
  239. TextDrawBackgroundColor(SladoledTD[16], 255);
  240. TextDrawFont(SladoledTD[16], 4);
  241. TextDrawSetProportional(SladoledTD[16], 0);
  242. TextDrawSetShadow(SladoledTD[16], 0);
  243.  
  244. SladoledTD[17] = TextDrawCreate(311.852142, 161.999908, "LD_SPAC:white");
  245. TextDrawLetterSize(SladoledTD[17], 0.000000, 0.000000);
  246. TextDrawTextSize(SladoledTD[17], 19.000000, 38.000000);
  247. TextDrawAlignment(SladoledTD[17], 1);
  248. TextDrawColor(SladoledTD[17], 907608319);
  249. TextDrawSetShadow(SladoledTD[17], 0);
  250. TextDrawSetOutline(SladoledTD[17], 0);
  251. TextDrawBackgroundColor(SladoledTD[17], 255);
  252. TextDrawFont(SladoledTD[17], 4);
  253. TextDrawSetProportional(SladoledTD[17], 0);
  254. TextDrawSetShadow(SladoledTD[17], 0);
  255.  
  256. SladoledTD[18] = TextDrawCreate(306.698486, 148.583267, "LD_BEAT:CHIT");
  257. TextDrawLetterSize(SladoledTD[18], 0.000000, 0.000000);
  258. TextDrawTextSize(SladoledTD[18], 29.000000, 32.000000);
  259. TextDrawAlignment(SladoledTD[18], 1);
  260. TextDrawColor(SladoledTD[18], 907608319);
  261. TextDrawSetShadow(SladoledTD[18], 0);
  262. TextDrawSetOutline(SladoledTD[18], 0);
  263. TextDrawBackgroundColor(SladoledTD[18], 255);
  264. TextDrawFont(SladoledTD[18], 4);
  265. TextDrawSetProportional(SladoledTD[18], 0);
  266. TextDrawSetShadow(SladoledTD[18], 0);
  267.  
  268. SladoledTD[19] = TextDrawCreate(223.001861, 234.916717, "(40$)");
  269. TextDrawLetterSize(SladoledTD[19], 0.175109, 1.115833);
  270. TextDrawAlignment(SladoledTD[19], 1);
  271. TextDrawColor(SladoledTD[19], -1);
  272. TextDrawSetShadow(SladoledTD[19], 0);
  273. TextDrawSetOutline(SladoledTD[19], 0);
  274. TextDrawBackgroundColor(SladoledTD[19], 255);
  275. TextDrawFont(SladoledTD[19], 2);
  276. TextDrawSetProportional(SladoledTD[19], 1);
  277. TextDrawSetShadow(SladoledTD[19], 0);
  278.  
  279. SladoledTD[20] = TextDrawCreate(312.020935, 235.500000, "(80$)");
  280. TextDrawLetterSize(SladoledTD[20], 0.175109, 1.115833);
  281. TextDrawAlignment(SladoledTD[20], 1);
  282. TextDrawColor(SladoledTD[20], -1);
  283. TextDrawSetShadow(SladoledTD[20], 0);
  284. TextDrawSetOutline(SladoledTD[20], 0);
  285. TextDrawBackgroundColor(SladoledTD[20], 255);
  286. TextDrawFont(SladoledTD[20], 2);
  287. TextDrawSetProportional(SladoledTD[20], 1);
  288. TextDrawSetShadow(SladoledTD[20], 0);
  289.  
  290. SladoledTD[21] = TextDrawCreate(399.166046, 233.166656, "(60$)");
  291. TextDrawLetterSize(SladoledTD[21], 0.175109, 1.115833);
  292. TextDrawAlignment(SladoledTD[21], 1);
  293. TextDrawColor(SladoledTD[21], -1);
  294. TextDrawSetShadow(SladoledTD[21], 0);
  295. TextDrawSetOutline(SladoledTD[21], 0);
  296. TextDrawBackgroundColor(SladoledTD[21], 255);
  297. TextDrawFont(SladoledTD[21], 2);
  298. TextDrawSetProportional(SladoledTD[21], 1);
  299. TextDrawSetShadow(SladoledTD[21], 0);
  300.  
  301. SladoledTD[22] = TextDrawCreate(409.304626, 189.416671, "LD_SPAC:white");
  302. TextDrawLetterSize(SladoledTD[22], 0.000000, 0.000000);
  303. TextDrawTextSize(SladoledTD[22], 3.000000, 23.000000);
  304. TextDrawAlignment(SladoledTD[22], 1);
  305. TextDrawColor(SladoledTD[22], -1281875201);
  306. TextDrawSetShadow(SladoledTD[22], 0);
  307. TextDrawSetOutline(SladoledTD[22], 0);
  308. TextDrawBackgroundColor(SladoledTD[22], 255);
  309. TextDrawFont(SladoledTD[22], 4);
  310. TextDrawSetProportional(SladoledTD[22], 0);
  311. TextDrawSetShadow(SladoledTD[22], 0);
  312.  
  313. SladoledTD[23] = TextDrawCreate(408.367401, 208.083236, "LD_BEAT:CHIT");
  314. TextDrawLetterSize(SladoledTD[23], 0.000000, 0.000000);
  315. TextDrawTextSize(SladoledTD[23], 4.000000, 7.000000);
  316. TextDrawAlignment(SladoledTD[23], 1);
  317. TextDrawColor(SladoledTD[23], -1281875201);
  318. TextDrawSetShadow(SladoledTD[23], 0);
  319. TextDrawSetOutline(SladoledTD[23], 0);
  320. TextDrawBackgroundColor(SladoledTD[23], 255);
  321. TextDrawFont(SladoledTD[23], 4);
  322. TextDrawSetProportional(SladoledTD[23], 0);
  323. TextDrawSetShadow(SladoledTD[23], 0);
  324.  
  325. SladoledTD[24] = TextDrawCreate(408.367401, 208.083236, "LD_BEAT:CHIT");
  326. TextDrawLetterSize(SladoledTD[24], 0.000000, 0.000000);
  327. TextDrawTextSize(SladoledTD[24], 4.000000, 7.000000);
  328. TextDrawAlignment(SladoledTD[24], 1);
  329. TextDrawColor(SladoledTD[24], -1281875201);
  330. TextDrawSetShadow(SladoledTD[24], 0);
  331. TextDrawSetOutline(SladoledTD[24], 0);
  332. TextDrawBackgroundColor(SladoledTD[24], 255);
  333. TextDrawFont(SladoledTD[24], 4);
  334. TextDrawSetProportional(SladoledTD[24], 0);
  335. TextDrawSetShadow(SladoledTD[24], 0);
  336.  
  337. SladoledTD[25] = TextDrawCreate(401.339691, 163.166534, "LD_SPAC:white");
  338. TextDrawLetterSize(SladoledTD[25], 0.000000, 0.000000);
  339. TextDrawTextSize(SladoledTD[25], 19.000000, 38.000000);
  340. TextDrawAlignment(SladoledTD[25], 1);
  341. TextDrawColor(SladoledTD[25], -859289601);
  342. TextDrawSetShadow(SladoledTD[25], 0);
  343. TextDrawSetOutline(SladoledTD[25], 0);
  344. TextDrawBackgroundColor(SladoledTD[25], 255);
  345. TextDrawFont(SladoledTD[25], 4);
  346. TextDrawSetProportional(SladoledTD[25], 0);
  347. TextDrawSetShadow(SladoledTD[25], 0);
  348.  
  349. SladoledTD[26] = TextDrawCreate(396.185852, 147.416610, "LD_BEAT:CHIT");
  350. TextDrawLetterSize(SladoledTD[26], 0.000000, 0.000000);
  351. TextDrawTextSize(SladoledTD[26], 29.000000, 32.000000);
  352. TextDrawAlignment(SladoledTD[26], 1);
  353. TextDrawColor(SladoledTD[26], -859289601);
  354. TextDrawSetShadow(SladoledTD[26], 0);
  355. TextDrawSetOutline(SladoledTD[26], 0);
  356. TextDrawBackgroundColor(SladoledTD[26], 255);
  357. TextDrawFont(SladoledTD[26], 4);
  358. TextDrawSetProportional(SladoledTD[26], 0);
  359. TextDrawSetShadow(SladoledTD[26], 0);
  360.  
  361. SladoledTD[27] = TextDrawCreate(228.923858, 248.916702, "LD_CHAT:thumbup");
  362. TextDrawLetterSize(SladoledTD[27], 0.000000, 0.000000);
  363. TextDrawTextSize(SladoledTD[27], 7.000000, 10.000000);
  364. TextDrawAlignment(SladoledTD[27], 1);
  365. TextDrawColor(SladoledTD[27], -1);
  366. TextDrawSetShadow(SladoledTD[27], 0);
  367. TextDrawSetOutline(SladoledTD[27], 0);
  368. TextDrawBackgroundColor(SladoledTD[27], 255);
  369. TextDrawFont(SladoledTD[27], 4);
  370. TextDrawSetProportional(SladoledTD[27], 0);
  371. TextDrawSetShadow(SladoledTD[27], 0);
  372. TextDrawSetSelectable(SladoledTD[27], true);
  373.  
  374. SladoledTD[28] = TextDrawCreate(317.474395, 247.750045, "LD_CHAT:thumbup");
  375. TextDrawLetterSize(SladoledTD[28], 0.000000, 0.000000);
  376. TextDrawTextSize(SladoledTD[28], 7.000000, 10.000000);
  377. TextDrawAlignment(SladoledTD[28], 1);
  378. TextDrawColor(SladoledTD[28], -1);
  379. TextDrawSetShadow(SladoledTD[28], 0);
  380. TextDrawSetOutline(SladoledTD[28], 0);
  381. TextDrawBackgroundColor(SladoledTD[28], 255);
  382. TextDrawFont(SladoledTD[28], 4);
  383. TextDrawSetProportional(SladoledTD[28], 0);
  384. TextDrawSetShadow(SladoledTD[28], 0);
  385. TextDrawSetSelectable(SladoledTD[28], true);
  386.  
  387. SladoledTD[29] = TextDrawCreate(406.024993, 246.583389, "LD_CHAT:thumbup");
  388. TextDrawLetterSize(SladoledTD[29], 0.000000, 0.000000);
  389. TextDrawTextSize(SladoledTD[29], 7.000000, 10.000000);
  390. TextDrawAlignment(SladoledTD[29], 1);
  391. TextDrawColor(SladoledTD[29], -1);
  392. TextDrawSetShadow(SladoledTD[29], 0);
  393. TextDrawSetOutline(SladoledTD[29], 0);
  394. TextDrawBackgroundColor(SladoledTD[29], 255);
  395. TextDrawFont(SladoledTD[29], 4);
  396. TextDrawSetProportional(SladoledTD[29], 0);
  397. TextDrawSetShadow(SladoledTD[29], 0);
  398. TextDrawSetSelectable(SladoledTD[29], true);
  399.  
  400. SladoledTD[30] = TextDrawCreate(427.576965, 138.083358, "LD_CHAT:thumbdn");
  401. TextDrawLetterSize(SladoledTD[30], 0.000000, 0.000000);
  402. TextDrawTextSize(SladoledTD[30], 5.000000, 8.000000);
  403. TextDrawAlignment(SladoledTD[30], 1);
  404. TextDrawColor(SladoledTD[30], -1);
  405. TextDrawSetShadow(SladoledTD[30], 0);
  406. TextDrawSetOutline(SladoledTD[30], 0);
  407. TextDrawBackgroundColor(SladoledTD[30], 255);
  408. TextDrawFont(SladoledTD[30], 4);
  409. TextDrawSetProportional(SladoledTD[30], 0);
  410. TextDrawSetShadow(SladoledTD[30], 0);
  411. TextDrawSetSelectable(SladoledTD[30], true);
  412.  
  413. for(new i; i < MAX_SLADOLEDI; i++) {
  414. new sFile[ 50 ];
  415. format(sFile, sizeof(sFile), SLADOLED_FILE, i);
  416. if(fexist(sFile)) {
  417. INI_ParseFile(sFile, "LoadSladoled", .bExtra = true, .extra = i);
  418. SladoledC[ i ] = CreateObject(1341, SladoledInfo[ i ][ PosX ], SladoledInfo[ i ][ PosY ], SladoledInfo[ i ][ PosZ ], SladoledInfo[ i ][ RotX ], SladoledInfo[ i ][ RotY ], SladoledInfo[ i ][ RotZ ], 300.0);
  419. SladoledLabel[ i ] = Create3DTextLabel("{FF1414}SLADOLED\n{FFFFFF}Pritisnite dugme 'Y'", 0x008080FF, SladoledInfo[ i ][ PosX ], SladoledInfo[ i ][ PosY ], SladoledInfo[ i ][ PosZ ], 10.0, 0, 0);
  420. }
  421. }
  422. return 1;
  423. }
  424. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) {
  425.  
  426. if(response == EDIT_RESPONSE_FINAL) {
  427. if(KreiraSladoled[ playerid ] != 0) {
  428. SladoledInfo[ KreiraSladoled[ playerid ] ][ PosX ] = fX;
  429. SladoledInfo[ KreiraSladoled[ playerid ] ][ PosY ] = fY;
  430. SladoledInfo[ KreiraSladoled[ playerid ] ][ PosZ ] = fZ;
  431. SladoledInfo[ KreiraSladoled[ playerid ] ][ RotX ] = fRotX;
  432. SladoledInfo[ KreiraSladoled[ playerid ] ][ RotY ] = fRotY;
  433. SladoledInfo[ KreiraSladoled[ playerid ] ][ RotZ ] = fRotZ;
  434. DestroyObject(SladoledC[ KreiraSladoled[ playerid ] ]);
  435. SladoledC[ KreiraSladoled[ playerid ] ] = CreateObject(1341, fX,fY,fZ, fRotX,fRotY,fRotZ, 300.0);
  436. SladoledLabel[ KreiraSladoled[ playerid ] ] = Create3DTextLabel("{FF1414}SLADOLED\n{FFFFFF}Pritisnite dugme 'Y'", 0x008080FF, fX,fY,fZ, 10.0, 0, 0);
  437. SaveSladoled(KreiraSladoled[ playerid ]);
  438. SendClientMessage(playerid, -1, "Zavrsili ste kreiranje.");
  439. }
  440. }
  441. return 1;
  442. }
  443. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  444.  
  445. if(newkeys == KEY_YES) {
  446. for(new i; i < MAX_SLADOLEDI; i++) {
  447. if(IsPlayerInRangeOfPoint(playerid, 5.0, SladoledInfo[ i ][ PosX ], SladoledInfo[ i ][ PosY ], SladoledInfo[ i ][ PosZ ])) {
  448. for(new tds; tds < 31; tds++) { TextDrawShowForPlayer(playerid, SladoledTD[ tds ]); }
  449. SelectTextDraw(playerid, 0xFFFFFFFF);
  450. KupujeSladoled[ playerid ] = true;
  451. }
  452. }
  453. }
  454. return 1;
  455. }
  456. public OnPlayerClickTextDraw(playerid, Text:clickedid) {
  457.  
  458. if(clickedid == SladoledTD[ 27 ]) { // Rumenko
  459. if(GetPlayerMoney(playerid) < 40) { SendClientMessage(playerid, -1, "Nemate dovoljno novca."); CancelSelectTextDraw(playerid); for(new tds; tds < 31; tds++) { TextDrawHideForPlayer(playerid, SladoledTD[ tds ]); } }
  460. else {
  461. GivePlayerMoney(playerid, -40);
  462. ApplyAnimation(playerid, "FOOD", "EAT_Pizza",4.1,0,1,1,0,0);
  463. new Float:hp;
  464. GetPlayerHealth(playerid, hp);
  465. SetPlayerHealth(playerid, hp+5);
  466. SendClientMessage(playerid, -1, "Pojeli ste sladoled.");
  467. KupujeSladoled[ playerid ] = false;
  468. }
  469. }
  470. else if(clickedid == SladoledTD[ 28 ]) {
  471. if(GetPlayerMoney(playerid) < 80) { SendClientMessage(playerid, -1, "Nemate dovoljno novca."); CancelSelectTextDraw(playerid); for(new tds; tds < 31; tds++) { TextDrawHideForPlayer(playerid, SladoledTD[ tds ]); } }
  472. else {
  473. GivePlayerMoney(playerid, -80);
  474. ApplyAnimation(playerid, "FOOD", "EAT_Pizza",4.1,0,1,1,0,0);
  475. new Float:hp;
  476. GetPlayerHealth(playerid, hp);
  477. SetPlayerHealth(playerid, hp+10);
  478. SendClientMessage(playerid, -1, "Pojeli ste sladoled.");
  479. KupujeSladoled[ playerid ] = false;
  480. }
  481. }
  482. else if(clickedid == SladoledTD[ 29 ]) {
  483. if(GetPlayerMoney(playerid) < 60) { SendClientMessage(playerid, -1, "Nemate dovoljno novca."); CancelSelectTextDraw(playerid); for(new tds; tds < 31; tds++) { TextDrawHideForPlayer(playerid, SladoledTD[ tds ]); } }
  484. else {
  485. GivePlayerMoney(playerid, -60);
  486. ApplyAnimation(playerid, "FOOD", "EAT_Pizza",4.1,0,1,1,0,0);
  487. new Float:hp;
  488. GetPlayerHealth(playerid, hp);
  489. SetPlayerHealth(playerid, hp+8);
  490. SendClientMessage(playerid, -1, "Pojeli ste sladoled.");
  491. KupujeSladoled[ playerid ] = false;
  492. }
  493. }
  494. else if(clickedid == SladoledTD[ 30 ]) { KupujeSladoled[ playerid ] = false; CancelSelectTextDraw(playerid); for(new tds; tds < 31; tds++) { TextDrawHideForPlayer(playerid, SladoledTD[ tds ]); } }
  495. return 1;
  496. }
  497.  
  498. YCMD:kreirajsladoled(playerid, params[], help) {
  499.  
  500. #pragma unused help
  501. #pragma unused params
  502. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Niste RCON Admin.");
  503. if(KupujeSladoled[ playerid ]) return SendClientMessage(playerid, -1, "Vec kupujete sladoled.");
  504. new Float:X,Float:Y,Float:Z, i = NextSladoledID( MAX_SLADOLEDI );
  505. GetPlayerPos(playerid, X,Y,Z);
  506. SladoledC[ i ] = CreateObject(1341, X,Y,Z, 0.0,0.0,0.0, 300.0);
  507. EditObject(playerid, SladoledC[ i ]);
  508. KreiraSladoled[ playerid ] = i;
  509. SendClientMessage(playerid, -1, "Zapoceli ste kreiranje sladoleda.");
  510. return 1;
  511. }
  512.  
  513. stock NextSladoledID(const len) {
  514. new id = (-1);
  515. for( new loop = ( 0 ), provjera = ( -1 ), Data_[ 64 ] = "\0"; loop != len; ++ loop ) {
  516. provjera = ( loop+1 );
  517. format( Data_, ( sizeof Data_ ), SLADOLED_FILE, provjera );
  518. if(!fexist(Data_)) {
  519. id = ( provjera );
  520. break; } }
  521. return ( id );
  522. }
  523. stock SaveSladoled(id) {
  524.  
  525. new sFile[ 60 ];
  526. format(sFile, sizeof(sFile), SLADOLED_FILE, id);
  527. new INI:File = INI_Open(sFile);
  528. INI_WriteFloat(File, "Lokacija_X", SladoledInfo[ id ][ PosX ]);
  529. INI_WriteFloat(File, "Lokacija_Y", SladoledInfo[ id ][ PosY ]);
  530. INI_WriteFloat(File, "Lokacija_Z", SladoledInfo[ id ][ PosZ ]);
  531. INI_WriteFloat(File, "Rotacija_X", SladoledInfo[ id ][ RotX ]);
  532. INI_WriteFloat(File, "Rotacija_Y", SladoledInfo[ id ][ RotY ]);
  533. INI_WriteFloat(File, "Rotacija_Z", SladoledInfo[ id ][ RotZ ]);
  534. INI_Close(File);
  535. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement