Guest User

8_+

a guest
Apr 6th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.50 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. if(dialogid == DIALOG_ID_ATTACHMENTS)
  4. {
  5. if (response)
  6. {
  7. pSlot[playerid] = listitem;
  8. if (IsPlayerAttachedObjectSlotUsed(playerid, listitem))
  9. {
  10. new buf[100];
  11. format(buf, sizeof(buf), "Attachment already in use {00FF00}(slot %i):", listitem);
  12. ShowPlayerDialog(playerid, DIALOG_ID_REPLACE, DIALOG_STYLE_LIST, buf, "Edit Object\nEdit Model\nDelete Object\nDuplicate Object", "Select", "Cancel");
  13. }
  14. else
  15. {
  16. const size = sizeof(gAttachments);
  17. new models[size], labels[size][25];
  18. for (new x; x < size; x++)
  19. {
  20. models[x] = gAttachments[x][attachModel];
  21. strcat(labels[x], gAttachments[x][attachName]);
  22. }
  23. ShowPlayerPreviewModelDialog(playerid, DIALOG_ID_SEARCH, DIALOG_STYLE_PREVMODEL, "Model selection:", models, labels, "Select", "Cancel");
  24. }
  25. }
  26. }
  27. if(dialogid == DIALOG_ID_SEARCH)
  28. {
  29. if (response)
  30. {
  31. pSelected[playerid] = listitem;
  32.  
  33. ShowPlayerDialog(playerid, DIALOG_ID_BONE, DIALOG_STYLE_TABLIST, "Bone selection:", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft clavicle\nRight clavicle\nNeck\nJaw", "Edit", "Back");
  34. }
  35. }
  36. if(dialogid == DIALOG_ID_BONE)
  37. {
  38. if (response)
  39. {
  40. SetPlayerAttachedObject(playerid, pSlot[playerid], gAttachments[pSelected[playerid]][attachModel], listitem + 1);
  41. EditAttachedObject(playerid, pSlot[playerid]);
  42.  
  43. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}Use {FFFF00}~k~~PED_SPRINT~ {FFFFFF}to look around while editing, Press {FFFF00}ESC {FFFFFF}to quick save and quit editing.");
  44. }
  45. else
  46. {
  47. const __size = sizeof(gAttachments);
  48. new
  49. __models[__size],
  50. __labels[__size][25]
  51. ;
  52. for (new i; i < __size; i++)
  53. {
  54. __models[i] = gAttachments[i][attachModel];
  55. strcat(__labels[i], gAttachments[i][attachName]);
  56. }
  57. return ShowPlayerPreviewModelDialog(playerid, DIALOG_ID_SEARCH, DIALOG_STYLE_PREVMODEL, "Model selection:", __models, __labels, "Select", "Cancel");
  58. }
  59. }
  60. if(dialogid == DIALOG_ID_REPLACE)
  61. {
  62. if (response)
  63. {
  64. switch (listitem)
  65. {
  66. case 0:
  67. {
  68. EditAttachedObject(playerid, pSlot[playerid]);
  69. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}Use {FFFF00}~k~~PED_SPRINT~ {FFFFFF}to look around while editing, Press {FFFF00}ESC {FFFFFF}to quick save and quit editing.");
  70. }
  71. case 1:
  72. {
  73. const
  74. _size = sizeof(gAttachments)
  75. ;
  76. new
  77. _models[_size],
  78. _labels[_size][25]
  79. ;
  80. for (new i; i < _size; i++)
  81. {
  82. _models[i] = gAttachments[i][attachModel];
  83. strcat(_labels[i], gAttachments[i][attachName]);
  84. }
  85. return ShowPlayerPreviewModelDialog(playerid, DIALOG_ID_EDIT_MODEL, DIALOG_STYLE_PREVMODEL, "Edit attachment model:", _models, _labels, "Change", "Cancel");
  86. }
  87. case 2:
  88. {
  89. new text[150];
  90. format(text, sizeof(text), "ATTACHMENT: {FFFFFF}You have deleted the attachment from slot %i.", pSlot[playerid]);
  91. SendClientMessage(playerid, 0x00FF00FF, text);
  92.  
  93. RemovePlayerAttachedObject(playerid, pSlot[playerid]);
  94.  
  95. new SQLRow: rowid, name[MAX_PLAYER_NAME], buf[50];
  96. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  97.  
  98. format(buf, sizeof(buf), "attachment_slot%i", pSlot[playerid]);
  99. if ((rowid = yoursql_get_row(SQL:0, buf, "user = %s", name)) != SQL_INVALID_ROW)
  100. {
  101. yoursql_delete_row(SQL:0, buf, rowid);
  102. }
  103. }
  104. case 3:
  105. {
  106. return ShowPlayerDialog(playerid, DIALOG_ID_DUPLICATE, DIALOG_STYLE_INPUT, "Duplicate attachment:", "{FFFFFF}Insert an attachment slot you want to duplicate this object to.\n\nNOTE: The slot must be empty.", "Duplicate", "Cancel");
  107. }
  108. }
  109. }
  110. }
  111. if(dialogid == DIALOG_ID_EDIT_MODEL)
  112. {
  113. if (response)
  114. {
  115. new
  116. modelid,
  117. boneid,
  118. Float: fOffsetX,
  119. Float: fOffsetY,
  120. Float: fOffsetZ,
  121. Float: fRotX,
  122. Float: fRotY,
  123. Float: fRotZ,
  124. Float: fScaleX,
  125. Float: fScaleY,
  126. Float: fScaleZ,
  127. color1,
  128. color2
  129. ;
  130. GetPlayerAttachedObject(playerid, pSlot[playerid], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, color1, color2);
  131. SetPlayerAttachedObject(playerid, pSlot[playerid], gAttachments[listitem][attachModel], boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, color1, color2);
  132.  
  133. new text[150];
  134. format(text, sizeof(text), "ATTACHMENT: {FFFFFF}You have edited the modelid of attachment slot %i.", pSlot[playerid]);
  135. SendClientMessage(playerid, 0x00FF00FF, text);
  136. }
  137. }
  138. if(dialogid == DIALOG_ID_DUPLICATE)
  139. {
  140. if (response)
  141. {
  142. if (inputtext[0] == ' ' || ! inputtext[0])
  143. {
  144. ShowPlayerDialog(playerid, DIALOG_ID_DUPLICATE, DIALOG_STYLE_INPUT, "Duplicate attachment:", "{FFFFFF}Insert an attachment slot you want to duplicate this object to.\n\nNOTE: The slot must be empty.", "Duplicate", "Cancel");
  145. return SendClientMessage(playerid, 0xFF0000FF, "ERROR: {FFFFFF}You cannot leave the box blank.");
  146. }
  147.  
  148. new duplicate = strval(inputtext);
  149. if (duplicate < 0 || duplicate >= MAX_PLAYER_ATTACHED_OBJECTS)
  150. {
  151. ShowPlayerDialog(playerid, DIALOG_ID_DUPLICATE, DIALOG_STYLE_INPUT, "Duplicate attachment:", "{FFFFFF}Insert an attachment slot you want to duplicate this object to.\n\nNOTE: The slot must be empty.", "Duplicate", "Cancel");
  152. return SendClientMessage(playerid, 0xFF0000FF, "ERROR: {FFFFFF}The attachment slot must be between 0 - "#MAX_PLAYER_ATTACHED_OBJECTS - 1".");
  153. }
  154.  
  155. if (IsPlayerAttachedObjectSlotUsed(playerid, duplicate))
  156. {
  157. ShowPlayerDialog(playerid, DIALOG_ID_DUPLICATE, DIALOG_STYLE_INPUT, "Duplicate attachment:", "{FFFFFF}Insert an attachment slot you want to duplicate this object to.\n\nNOTE: The slot must be empty.", "Duplicate", "Cancel");
  158. return SendClientMessage(playerid, 0xFF0000FF, "ERROR: {FFFFFF}The slot specigfied is already used, please insert an empty one.");
  159. }
  160.  
  161. new
  162. modelid,
  163. boneid,
  164. Float: fOffsetX,
  165. Float: fOffsetY,
  166. Float: fOffsetZ,
  167. Float: fRotX,
  168. Float: fRotY,
  169. Float: fRotZ,
  170. Float: fScaleX,
  171. Float: fScaleY,
  172. Float: fScaleZ,
  173. color1,
  174. color2
  175. ;
  176. GetPlayerAttachedObject(playerid, pSlot[playerid], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, color1, color2);
  177. SetPlayerAttachedObject(playerid, duplicate, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, color1, color2);
  178.  
  179. new text[150];
  180. format(text, sizeof(text), "ATTACHMENT: {FFFFFF}You have duplicated attachment slot %i to new slot %i.", pSlot[playerid], duplicate);
  181. SendClientMessage(playerid, 0x00FF00FF, text);
  182. }
  183. }
  184. if(dialogid == DIALOG_ID_COLOR)
  185. {
  186. if (response)
  187. {
  188. pColor[playerid] = listitem;
  189.  
  190. new colors[500];
  191. strcat(colors, "Custom Color (hex value)\n");
  192. strcat(colors, "{FFFFFF}White\n");
  193. strcat(colors, "{000000}Black\n");
  194. strcat(colors, "{808080}Grey\n");
  195. strcat(colors, "{008080}Teal\n");
  196. strcat(colors, "{003366}Navy blue\n");
  197. strcat(colors, "{3366CC}Sky blue\n");
  198. strcat(colors, "{000099}Dark blue\n");
  199. strcat(colors, "{3399FF}Light blue\n");
  200. strcat(colors, "{6600CC}Dark purple\n");
  201. strcat(colors, "{6600FF}Purple\n");
  202. strcat(colors, "{6666FF}Light purple\n");
  203. strcat(colors, "{00FFFF}Cyan\n");
  204. strcat(colors, "{00FFCC}Aqua\n");
  205. strcat(colors, "{00CC99}Poision green\n");
  206. strcat(colors, "{006666}Lawn green\n");
  207. strcat(colors, "{00CC00}Green\n");
  208. strcat(colors, "{CC99FF}Pink\n");
  209. strcat(colors, "{FF99FF}Hot pink\n");
  210. strcat(colors, "{FFFF99}Light yellow\n");
  211. strcat(colors, "{FFFF66}Yellow\n");
  212. strcat(colors, "{FF9933}Orange\n");
  213. strcat(colors, "{660033}Magenta\n");
  214. strcat(colors, "{800000}Marone\n");
  215. strcat(colors, "{FF0000}Red\n");
  216. strcat(colors, "{CC0000}Dark red\n");
  217. strcat(colors, "{999966}Khaki\n");
  218. strcat(colors, "{993333}Coral\n");
  219. strcat(colors, "{CCFF99}Lime\n");
  220. strcat(colors, "{663300}Brown\n");
  221. strcat(colors, "{A9C4E4}SA-MP Blue");
  222. if (! listitem)
  223. {
  224. ShowPlayerDialog(playerid, DIALOG_ID_COLOR_LIST, DIALOG_STYLE_LIST, "Color selection ({00FF00}Materialcolor 1{FFFFFF}):", colors, "Set", "Back");
  225. }
  226. else
  227. {
  228. ShowPlayerDialog(playerid, DIALOG_ID_COLOR_LIST, DIALOG_STYLE_LIST, "Color selection ({00FF00}Materialcolor 2{FFFFFF}):", colors, "Set", "Back");
  229. }
  230. }
  231. }
  232. if(dialogid == DIALOG_ID_COLOR_LIST)
  233. {
  234. if (response)
  235. {
  236. new newcolor;
  237. switch (listitem)
  238. {
  239. case 0:
  240. {
  241. ShowPlayerDialog(playerid, DIALOG_ID_CUSTOM_COLOR, DIALOG_STYLE_INPUT, "Custom color ({00FF00}Materialcolor 1{FFFFFF}):", "{FFFFFF}Insert an hex color value to set it as your object's material color:", "Set", "Back");
  242. }
  243. case 1:
  244. {
  245. newcolor = 0xFFFFFFFF;
  246. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"WHITE\".");
  247. }
  248. case 2:
  249. {
  250. newcolor = 0x000000FF;
  251. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"BLACK\".");
  252. }
  253. case 3:
  254. {
  255. newcolor = 0x808080FF;
  256. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"GREY\".");
  257. }
  258. case 4:
  259. {
  260. newcolor = 0x008080FF;
  261. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"TEAL\".");
  262. }
  263. case 5:
  264. {
  265. newcolor = 0x003366FF;
  266. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"NAVY BLUE\".");
  267. }
  268. case 6:
  269. {
  270. newcolor = 0x3366CCFF;
  271. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"SKY BLUE\".");
  272. }
  273. case 7:
  274. {
  275. newcolor = 0x000099FF;
  276. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"DARK BLUE\".");
  277. }
  278. case 8:
  279. {
  280. newcolor = 0x3399FFFF;
  281. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"LIGHT BLUE\".");
  282. }
  283. case 9:
  284. {
  285. newcolor = 0x6600CCFF;
  286. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"DARK PURPLE\".");
  287. }
  288. case 10:
  289. {
  290. newcolor = 0x6600FFFF;
  291. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"PURPLE\".");
  292. }
  293. case 11:
  294. {
  295. newcolor = 0x6666FFFF;
  296. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"LIGHT PURPLE\".");
  297. }
  298. case 12:
  299. {
  300. newcolor = 0x00FFFFFF;
  301. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"CYAN\".");
  302. }
  303. case 13:
  304. {
  305. newcolor = 0x00FFCCFF;
  306. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"AQUA\".");
  307. }
  308. case 14:
  309. {
  310. newcolor = 0x00CC99FF;
  311. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"POISION GREEN\".");
  312. }
  313. case 15:
  314. {
  315. newcolor = 0x006666FF;
  316. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"LAWN GREEN\".");
  317. }
  318. case 16:
  319. {
  320. newcolor = 0x00CC00FF;
  321. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"GREEN\".");
  322. }
  323. case 17:
  324. {
  325. newcolor = 0xCC99FFFF;
  326. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"PINK\".");
  327. }
  328. case 18:
  329. {
  330. newcolor = 0xFF99FFFF;
  331. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"HOT PINK\".");
  332. }
  333. case 19:
  334. {
  335. newcolor = 0xFFFF99FF;
  336. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"LIGHT YELLOW\".");
  337. }
  338. case 20:
  339. {
  340. newcolor = 0xFFFF66FF;
  341. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"YELLOW\".");
  342. }
  343. case 21:
  344. {
  345. newcolor = 0xFF9933FF;
  346. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"ORANGE\".");
  347. }
  348. case 22:
  349. {
  350. newcolor = 0x660033FF;
  351. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"MAGENTA\".");
  352. }
  353. case 23:
  354. {
  355. newcolor = 0x800000FF;
  356. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"MARONE\".");
  357. }
  358. case 24:
  359. {
  360. newcolor = 0xFF0000FF;
  361. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"RED\".");
  362. }
  363. case 25:
  364. {
  365. newcolor = 0xCC0000FF;
  366. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"DARK RED\".");
  367. }
  368. case 26:
  369. {
  370. newcolor = 0x999966FF;
  371. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"KHAKI\".");
  372. }
  373. case 27:
  374. {
  375. newcolor = 0x993333FF;
  376. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"CORAL\".");
  377. }
  378. case 28:
  379. {
  380. newcolor = 0xCCFF99FF;
  381. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"LIME\".");
  382. }
  383. case 29:
  384. {
  385. newcolor = 0x663300FF;
  386. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"BROWN\".");
  387. }
  388. case 30:
  389. {
  390. newcolor = 0xA9C4E4FF;
  391. SendClientMessage(playerid, 0x00FF00FF, "ATTACHMENT: {FFFFFF}You have changeed the object material colot to \"SAMP BLUE\".");
  392. }
  393. new modelid, boneid,
  394. Float: fOffsetX,
  395. Float: fOffsetY,
  396. Float: fOffsetZ,
  397. Float: fRotX,
  398. Float: fRotY,
  399. Float: fRotZ,
  400. Float: fScaleX,
  401. Float: fScaleY,
  402. Float: fScaleZ,
  403. color1,
  404. color2;
  405. GetPlayerAttachedObject(playerid, pSlot[playerid], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, color1, color2);
  406. SetPlayerAttachedObject(playerid, pSlot[playerid], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, (! pColor[playerid]) ? newcolor : color1, (pColor[playerid]) ? newcolor : color2);
  407. }
  408. ShowPlayerDialog(playerid, DIALOG_ID_COLOR, DIALOG_STYLE_LIST, "Set attachment color:", "Materialcolor 1\nMaterialcolor 2", "Select", "Cancel");
  409. }
  410. }
  411. if(dialogid == DIALOG_ID_CUSTOM_COLOR)
  412. {
  413. if (response)
  414. {
  415. new red[3], green[3], blue[3], alpha[3];
  416.  
  417. if (inputtext[0] == '0' && inputtext[1] == 'x') //using 0xFFFFFF format
  418. {
  419. if (strlen(inputtext) != 8 && strlen(inputtext) != 10)
  420. {
  421. SendClientMessage(playerid, 0xFF0000FF, "ERROR: {FFFFFF}You have entered an invalid hex color value.");
  422. return ShowPlayerDialog(playerid, DIALOG_ID_CUSTOM_COLOR, DIALOG_STYLE_INPUT, "Custom color ({00FF00}Materialcolor 1{FFFFFF}):", "{FFFFFF}Insert an hex color value to set it as your object's material color:", "Set", "Back");
  423. }
  424. else
  425. {
  426. format(red, sizeof(red), "%c%c", inputtext[2], inputtext[3]);
  427. format(green, sizeof(green), "%c%c", inputtext[4], inputtext[5]);
  428. format(blue, sizeof(blue), "%c%c", inputtext[6], inputtext[7]);
  429. if (inputtext[8] != '\0')
  430. {
  431. format(alpha, sizeof(alpha), "%c%c", inputtext[8], inputtext[9]);
  432. }
  433. else
  434. {
  435. alpha = "FF";
  436. }
  437. }
  438. }
  439. else if (inputtext[0] == '#') //using #FFFFFF format
  440. {
  441. if (strlen(inputtext) != 7 && strlen(inputtext) != 9)
  442. {
  443. SendClientMessage(playerid, 0xFF0000FF, "ERROR: {FFFFFF}You have entered an invalid hex color value.");
  444. return ShowPlayerDialog(playerid, DIALOG_ID_CUSTOM_COLOR, DIALOG_STYLE_INPUT, "Custom color ({00FF00}Materialcolor 1{FFFFFF}):", "{FFFFFF}Insert an hex color value to set it as your object's material color:", "Set", "Back");
  445. }
  446. else
  447. {
  448. format(red, sizeof(red), "%c%c", inputtext[1], inputtext[2]);
  449. format(green, sizeof(green), "%c%c", inputtext[3], inputtext[4]);
  450. format(blue, sizeof(blue), "%c%c", inputtext[5], inputtext[6]);
  451. if (inputtext[7] != '\0')
  452. {
  453. format(alpha, sizeof(alpha), "%c%c", inputtext[7], inputtext[8]);
  454. }
  455. else
  456. {
  457. alpha = "FF";
  458. }
  459. }
  460. }
  461. else //using FFFFFF format
  462. {
  463. if (strlen(inputtext) != 6 && strlen(inputtext) != 8)
  464. {
  465. SendClientMessage(playerid, 0xFF0000FF, "ERROR: {FFFFFF}You have entered an invalid hex color value.");
  466. return ShowPlayerDialog(playerid, DIALOG_ID_CUSTOM_COLOR, DIALOG_STYLE_INPUT, "Custom color ({00FF00}Materialcolor 1{FFFFFF}):", "{FFFFFF}Insert an hex color value to set it as your object's material color:", "Set", "Back");
  467. }
  468. else
  469. {
  470. format(red, sizeof(red), "%c%c", inputtext[0], inputtext[1]);
  471. format(green, sizeof(green), "%c%c", inputtext[2], inputtext[3]);
  472. format(blue, sizeof(blue), "%c%c", inputtext[4], inputtext[5]);
  473. if (inputtext[6] != '\0')
  474. {
  475. format(alpha, sizeof(alpha), "%c%c", inputtext[6], inputtext[7]);
  476. }
  477. else
  478. {
  479. alpha = "FF";
  480. }
  481. }
  482. }
  483. new newcolor = RGB(HexToInt(red), HexToInt(green), HexToInt(blue), HexToInt(alpha)), modelid, boneid,
  484. Float: fOffsetX,
  485. Float: fOffsetY,
  486. Float: fOffsetZ,
  487. Float: fRotX,
  488. Float: fRotY,
  489. Float: fRotZ,
  490. Float: fScaleX,
  491. Float: fScaleY,
  492. Float: fScaleZ,
  493. color1,
  494. color2;
  495. GetPlayerAttachedObject(playerid, pSlot[playerid], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, color1, color2);
  496. SetPlayerAttachedObject(playerid, pSlot[playerid], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, (! pColor[playerid]) ? newcolor : color1, (pColor[playerid]) ? newcolor : color2);
  497.  
  498. ShowPlayerDialog(playerid, DIALOG_ID_COLOR, DIALOG_STYLE_LIST, "Set attachment color:", "Materialcolor 1\nMaterialcolor 2", "Select", "Cancel");
  499. }
  500. }
  501. return 0;
  502. }
Advertisement
Add Comment
Please, Sign In to add comment