Advertisement
Guest User

Untitled

a guest
Nov 10th, 2014
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.61 KB | None | 0 0
  1. /*
  2. scripted orginally created by Spanes.
  3. */
  4.  
  5. #include <a_samp>
  6. #include <mSelection>
  7.  
  8. #pragma tabsize 0
  9.  
  10. main() { print("Spanes Clothing System v1.0"); }
  11.  
  12. new aksesuarliste = mS_INVALID_LISTID;
  13. new AksesuarUcreti[MAX_PLAYERS];
  14. new SectigiAksesuar[MAX_PLAYERS];
  15.  
  16. new slot[MAX_PLAYERS][6];
  17.  
  18. new AksesuarVerileri[152][]=
  19. {
  20. {18891,25},
  21. {18892,25},
  22. {18893,25},
  23. {18894,25},
  24. {18895,25},
  25. {18896,25},
  26. {18897,25},
  27. {18898,25},
  28. {18899,25},
  29. {18900,30},
  30. {18901,30},
  31. {18902,35},
  32. {18903,35},
  33. {18904,25},
  34. {18905,40},
  35. {18921,50},
  36. {18922,35},
  37. {18923,25},
  38. {18924,45},
  39. {18939,40},
  40. {18940,55},
  41. {18941,65},
  42. {18942,20},
  43. {18943,25},
  44. {18955,30},
  45. {18956,35},
  46. {18957,40},
  47. {18958,40},
  48. {18959,35},
  49. {18926,30},
  50. {18927,25},
  51. {18928,20},
  52. {18929,20},
  53. {18930,25},
  54. {18931,35},
  55. {18932,30},
  56. {18933,30},
  57. {18934,45},
  58. {18935,50},
  59. {18969,55},
  60. {18968,45},
  61. {19067,55},
  62. {19068,55},
  63. {19069,40},
  64. {19095,35},
  65. {18962,30},
  66. {19096,25},
  67. {19097,30},
  68. {19098,35},
  69. {18944,30},
  70. {18945,25},
  71. {18946,20},
  72. {18947,30},
  73. {18948,35},
  74. {18949,45},
  75. {18950,25},
  76. {18951,20},
  77. {18970,25},
  78. {18971,30},
  79. {18972,35},
  80. {18973,30},
  81. {19006,25},
  82. {19007,45},
  83. {19008,40},
  84. {19009,30},
  85. {19010,35},
  86. {19011,30},
  87. {19012,25},
  88. {19013,20},
  89. {19014,25},
  90. {19015,45},
  91. {19016,30},
  92. {19017,35},
  93. {19018,30},
  94. {19019,25},
  95. {19020,30},
  96. {18936,30},
  97. {18937,35},
  98. {18938,25},
  99. {18977,35},
  100. {18978,40},
  101. {18979,35},
  102. {18911,35},
  103. {18912,45},
  104. {18913,40},
  105. {18914,25},
  106. {18915,30},
  107. {18916,35},
  108. {18917,30},
  109. {18918,25},
  110. {18919,20},
  111. {18920,25},
  112. {19036,30},
  113. {19037,35},
  114. {19038,40},
  115. {18974,25},
  116. {19163,30},
  117. {19317,250},
  118. {19318,250},
  119. {19319,250},
  120. {19039,20},
  121. {19040,20},
  122. {19041,20},
  123. {19042,20},
  124. {19043,20},
  125. {19044,20},
  126. {19045,20},
  127. {19046,20},
  128. {19047,20},
  129. {19048,20},
  130. {19049,20},
  131. {19050,20},
  132. {19051,20},
  133. {19052,20},
  134. {19053,20},
  135. {19421,15},
  136. {19422,15},
  137. {19423,15},
  138. {19424,15},
  139. {19487,25},
  140. {19488,25},
  141. {1210,15},
  142. {371,20}, // -
  143. {18952,10},
  144. {18953,20},
  145. {18954,20},
  146. {18961,10},
  147. {18962,20},
  148. {19022,25},
  149. {19023,25},
  150. {19024,25},
  151. {19025,25},
  152. {19026,25},
  153. {19027,25},
  154. {19028,25},
  155. {19029,25},
  156. {19030,25},
  157. {19031,25},
  158. {19032,25},
  159. {19033,25},
  160. {19034,25},
  161. {19035,25},
  162. {18906,30},
  163. {18907,30},
  164. {18908,30},
  165. {18910,30},
  166. {19065,30},
  167. {19101,30},
  168. {19102,30},
  169. {19103,30},
  170. {19104,30},
  171. {19105,30}
  172. };
  173.  
  174. public OnGameModeInit()
  175. {
  176. SetGameModeText("Spanes Scripting");
  177. AddPlayerClass(0, 2912.8022,-940.3574,10.7524, 269.1425, 0, 0, 0, 0, 0, 0);
  178. aksesuarliste = LoadModelSelectionMenu("spanes.txt");
  179. return 1;
  180. }
  181.  
  182. public OnPlayerModelSelection(playerid, response, listid, modelid)
  183. {
  184. if(listid == aksesuarliste)
  185. {
  186. if(response)
  187. {
  188. new aksesuarucret;
  189. for(new i = 0; i < sizeof(AksesuarVerileri) ; i++)
  190. {
  191. if(modelid == AksesuarVerileri[i][0])
  192. {
  193. aksesuarucret = AksesuarVerileri[i][1];
  194. }
  195. }
  196. new test[128];
  197. format(test, sizeof(test),"Accessory: %d | Price: %d$\nDo you want to buy?",modelid,aksesuarucret);
  198. ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX, "Accessory",test,"Yes", "No");
  199. SectigiAksesuar[playerid] = modelid;
  200. AksesuarUcreti[playerid] = aksesuarucret;
  201. }
  202. return 1;
  203. }
  204.  
  205. return 1;
  206. }
  207.  
  208. public OnPlayerRequestClass(playerid, classid)
  209. {
  210. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  211. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  212. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  213. return 1;
  214. }
  215.  
  216. public OnPlayerSpawn(playerid)
  217. {
  218. GivePlayerMoney(playerid, 5000);
  219. return 1;
  220. }
  221.  
  222. public OnPlayerCommandText(playerid, cmdtext[])
  223. {
  224. if(strcmp("/buy", cmdtext, true, 10) == 0)
  225. {
  226. ShowModelSelectionMenu(playerid,aksesuarliste, "Slymind");
  227. return 1;
  228. }
  229. if(strcmp("/accessory", cmdtext, true, 10) == 0)
  230. {
  231. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Accessory","1\n2\n3\n4\n5\n6","Choose","Close");
  232. return 1;
  233. }
  234. return 0;
  235. }
  236.  
  237. enum attached_object_data
  238. {
  239. ao_model,
  240. ao_bone,
  241. Float:ao_x,
  242. Float:ao_y,
  243. Float:ao_z,
  244. Float:ao_rx,
  245. Float:ao_ry,
  246. Float:ao_rz,
  247. Float:ao_sx,
  248. Float:ao_sy,
  249. Float:ao_sz
  250. }
  251.  
  252. new ao[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][attached_object_data];
  253.  
  254. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  255. {
  256. if(response)
  257. {
  258. SendClientMessage(playerid, -1, "Attached object edition saved.");
  259.  
  260. ao[playerid][index][ao_x] = fOffsetX;
  261. ao[playerid][index][ao_y] = fOffsetY;
  262. ao[playerid][index][ao_z] = fOffsetZ;
  263. ao[playerid][index][ao_rx] = fRotX;
  264. ao[playerid][index][ao_ry] = fRotY;
  265. ao[playerid][index][ao_rz] = fRotZ;
  266. ao[playerid][index][ao_sx] = fScaleX;
  267. ao[playerid][index][ao_sy] = fScaleY;
  268. ao[playerid][index][ao_sz] = fScaleZ;
  269. }
  270. else
  271. {
  272. SendClientMessage(playerid,-1, "Attached object edition not saved.");
  273.  
  274. new i = index;
  275. SetPlayerAttachedObject(playerid, index, modelid, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]);
  276. }
  277. return 1;
  278. }
  279.  
  280. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  281. {
  282. if(dialogid == 3)
  283. {
  284. if(response)
  285. {
  286. switch(listitem)
  287. {
  288. case 0:
  289. {
  290. if(slot[playerid][0] == 0)
  291. {
  292. SendClientMessage(playerid,-1,"You did not buy anything for this slot");
  293. return 1;
  294. }
  295. SetPlayerAttachedObject(playerid, 0,slot[playerid][0], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  296. EditAttachedObject(playerid, 0);
  297. }
  298. case 1:
  299. {
  300. if(slot[playerid][1] == 0)
  301. {
  302. SendClientMessage(playerid,-1,"You did not buy anything for this slot");
  303. return 1;
  304. }
  305. SetPlayerAttachedObject(playerid, 1,slot[playerid][1], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  306. EditAttachedObject(playerid, 1);
  307. }
  308. case 2:
  309. {
  310. if(slot[playerid][2] == 0)
  311. {
  312. SendClientMessage(playerid,-1,"You did not buy anything for this slot");
  313. return 1;
  314. }
  315. SetPlayerAttachedObject(playerid, 2,slot[playerid][2], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  316. EditAttachedObject(playerid, 2);
  317. }
  318. case 3:
  319. {
  320. if(slot[playerid][3] == 0)
  321. {
  322. SendClientMessage(playerid,-1,"You did not buy anything for this slot");
  323. return 1;
  324. }
  325. SetPlayerAttachedObject(playerid, 3,slot[playerid][3], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  326. EditAttachedObject(playerid, 3);
  327. }
  328. case 4:
  329. {
  330. if(slot[playerid][4] == 0)
  331. {
  332. SendClientMessage(playerid,-1,"You did not buy anything for this slot");
  333. return 1;
  334. }
  335. SetPlayerAttachedObject(playerid, 4,slot[playerid][4], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  336. EditAttachedObject(playerid, 4);
  337. }
  338. case 5:
  339. {
  340. if(slot[playerid][5] == 0)
  341. {
  342. SendClientMessage(playerid,-1,"You did not buy anything for this slot");
  343. return 1;
  344. }
  345. SetPlayerAttachedObject(playerid, 5,slot[playerid][5], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  346. EditAttachedObject(playerid, 5);
  347. }
  348. }
  349. }
  350. }
  351. if(dialogid == 1)
  352. {
  353. if(response)
  354. {
  355. if(GetPlayerMoney(playerid) >= AksesuarUcreti[playerid])
  356. {
  357. new slymindstr[128];
  358. format(slymindstr,sizeof(slymindstr),"Slot 1: %d\nSlot 2: %d\nSlot 3: %d\nSlot 4: %d\nSlot 5: %d\nSlot 6: %d",slot[playerid][0],slot[playerid][1],slot[playerid][2],slot[playerid][3],slot[playerid][4],slot[playerid][5]);
  359. ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Slot",slymindstr,"Seç","");
  360. }
  361. else
  362. {
  363. SendClientMessage(playerid,-1,"You dont have enough money!");
  364. }
  365. }
  366. }
  367. else if(dialogid == 2)
  368. {
  369. if(response)
  370. {
  371. switch(listitem)
  372. {
  373. case 0: slot[playerid][0] = SectigiAksesuar[playerid];
  374. case 1: slot[playerid][1] = SectigiAksesuar[playerid];
  375. case 2: slot[playerid][2] = SectigiAksesuar[playerid];
  376. case 3: slot[playerid][3] = SectigiAksesuar[playerid];
  377. case 4: slot[playerid][4] = SectigiAksesuar[playerid];
  378. case 5: slot[playerid][5] = SectigiAksesuar[playerid];
  379. }
  380. }
  381. }
  382. return 1;
  383. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement