Advertisement
Phat123123

Untitled

Jul 27th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.14 KB | None | 0 0
  1. CMD:thaydan(playerid, params[])
  2. {
  3. if(IsPlayerInAnyVehicle(playerid))
  4. {
  5. SendClientMessageEx (playerid, COLOR_GRAD2, "Ban khong the thay dan khi tren xe!");
  6. return 1;
  7. }
  8. if(GetPVarInt(playerid, "IsInArena") >= 0)
  9. {
  10. SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam dieu nay trong dau truong!");
  11. return 1;
  12. }
  13. if(GetPVarInt( playerid, "EventToken") != 0)
  14. {
  15. SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the lam dieu nay khi dang trong su kien.");
  16. return 1;
  17. }
  18. if(IsPlayerConnected(playerid))
  19. {
  20. if(isnull(params))
  21. {
  22. SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /thaydan [name]");
  23. SendClientMessageEx(playerid, COLOR_GREY, "Ten co san : deagle , mp5 , shotgun , m4 , spass12 , uzi , sniper , 9mm , ak47");
  24. return 1;
  25. }
  26. if(strcmp(params, "deagle", true) == 0)
  27. {
  28. new weapon, ammosd;
  29. GetPlayerWeaponData(playerid, 2, weapon, ammosd);
  30. if(weapon == 24 && PlayerInfo[playerid][pDan2] > 0)
  31. {
  32. RemovePlayerWeapon(playerid, weapon);
  33. GivePlayerValidWeapon(playerid, weapon, 1);
  34. if(PlayerInfo[playerid][pAmmo][ 1 ] < 2)
  35. {
  36. PlayerInfo[playerid][pDan2] -= 1;
  37. GivePlayerAmmoEx(playerid, weapon, 7);
  38. ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
  39. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Deagle ");
  40. SetPlayerArmedWeapon(playerid, weapon);
  41. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  42. }
  43. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  44. }
  45. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  46. }
  47. if(strcmp(params, "shotgun", true) == 0)
  48. {
  49. new weapon, ammosd;
  50. GetPlayerWeaponData(playerid, 3, weapon, ammosd);
  51. if(weapon == 25 && PlayerInfo[playerid][pDan3] > 0)
  52. {
  53. RemovePlayerWeapon(playerid, weapon);
  54. if(PlayerInfo[playerid][pAmmo][ 2 ] < 2)
  55. {
  56. PlayerInfo[playerid][pDan3] -= 1;
  57. GivePlayerValidWeapon(playerid, weapon, 0);
  58. GivePlayerAmmoEx(playerid, weapon, 12);
  59. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  60. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Shotgun ");
  61. SetPlayerArmedWeapon(playerid, weapon);
  62. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  63. }
  64. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  65. }
  66. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  67. }
  68. if(strcmp(params, "mp5", true) == 0)
  69. {
  70. new weapon, ammosd;
  71. GetPlayerWeaponData(playerid, 4, weapon, ammosd);
  72. if(weapon == 29 && PlayerInfo[playerid][pDan4] > 0)
  73. {
  74. RemovePlayerWeapon(playerid, weapon);
  75. if(PlayerInfo[playerid][pAmmo][ 3 ] < 2)
  76. {
  77. PlayerInfo[playerid][pDan4] -= 1;
  78. GivePlayerValidWeapon(playerid, weapon, 0);
  79. GivePlayerAmmoEx(playerid, weapon, 31);
  80. ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
  81. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}MP5 ");
  82. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  83. SetPlayerArmedWeapon(playerid, weapon);
  84. }
  85. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  86. }
  87. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  88. }
  89. if(strcmp(params, "tec9", true) == 0)
  90. {
  91. new weapon, ammosd;
  92. GetPlayerWeaponData(playerid, 4, weapon, ammosd);
  93. if(weapon == 32 && PlayerInfo[playerid][pDan4] > 0)
  94. {
  95. RemovePlayerWeapon(playerid, weapon);
  96. if(PlayerInfo[playerid][pAmmo][ 3 ] < 2)
  97. {
  98. PlayerInfo[playerid][pDan4] -= 1;
  99. GivePlayerValidWeapon(playerid, weapon, 0);
  100. GivePlayerAmmoEx(playerid, weapon, 31);
  101. ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
  102. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}TEC9 ");
  103. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  104. SetPlayerArmedWeapon(playerid, weapon);
  105. }
  106. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  107. }
  108. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  109. }
  110. if(strcmp(params, "m4", true) == 0)
  111. {
  112. new weapon, ammosd;
  113. GetPlayerWeaponData(playerid, 5, weapon, ammosd);
  114. if(weapon == 31 && PlayerInfo[playerid][pDan6] > 0)
  115. {
  116. RemovePlayerWeapon(playerid, weapon);
  117. GivePlayerValidWeapon(playerid, weapon, 1);
  118. if(PlayerInfo[playerid][pAmmo][ 4 ] < 1)
  119. {
  120. PlayerInfo[playerid][pDan6] -= 1;
  121. GivePlayerAmmoEx(playerid, weapon, 50);
  122. ApplyAnimation(playerid, "PYTHON", "python_reload", 4.0, 0, 0, 0, 0, 0, 1);
  123. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}M4 ");
  124. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  125. SetPlayerArmedWeapon(playerid, weapon);
  126. }
  127. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  128. }
  129. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  130. }
  131. if(strcmp(params, "spass12", true) == 0)
  132. {
  133. new weapon, ammosd;
  134. GetPlayerWeaponData(playerid, 3, weapon, ammosd);
  135. if(weapon == 27 && PlayerInfo[playerid][pDan7] > 0)
  136. {
  137. RemovePlayerWeapon(playerid, weapon);
  138. if(PlayerInfo[playerid][pAmmo][ 2 ] < 2)
  139. {
  140. PlayerInfo[playerid][pDan7] -= 1;
  141. GivePlayerValidWeapon(playerid, weapon, 0);
  142. GivePlayerAmmoEx(playerid, weapon, 8);
  143. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  144. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Spass12");
  145. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  146. SetPlayerArmedWeapon(playerid, weapon);
  147. }
  148. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  149. }
  150. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  151. }
  152. if(strcmp(params, "ak47", true) == 0)
  153. {
  154. new weapon, ammosd;
  155. GetPlayerWeaponData(playerid, 5, weapon, ammosd);
  156. if(weapon == 30 && PlayerInfo[playerid][pDan5] > 0)
  157. {
  158. RemovePlayerWeapon(playerid, weapon);
  159. if(PlayerInfo[playerid][pAmmo][ 4 ] < 2)
  160. {
  161. PlayerInfo[playerid][pDan5] -= 1;
  162. GivePlayerValidWeapon(playerid, weapon, 0);
  163. GivePlayerAmmoEx(playerid, weapon, 31);
  164. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  165. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}AK-47 ");
  166. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  167. SetPlayerArmedWeapon(playerid, weapon);
  168. }
  169. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  170. }
  171. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  172. }
  173. if(strcmp(params, "sniper", true) == 0)
  174. {
  175. new weapon, ammosd;
  176. GetPlayerWeaponData(playerid, 6, weapon, ammosd);
  177. if(weapon == 34 && PlayerInfo[playerid][pDan9] > 0)
  178. {
  179. RemovePlayerWeapon(playerid, weapon);
  180. if(PlayerInfo[playerid][pAmmo][ 5 ] < 2)
  181. {
  182. PlayerInfo[playerid][pDan9] -= 1;
  183. GivePlayerValidWeapon(playerid, weapon, 0);
  184. GivePlayerAmmoEx(playerid, weapon, 12);
  185. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  186. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Sniper ");
  187. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  188. SetPlayerArmedWeapon(playerid, weapon);
  189. }
  190. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  191. }
  192. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  193. }
  194. if(strcmp(params, "9mm", true) == 0)
  195. {
  196. new weapon, ammosd;
  197. GetPlayerWeaponData(playerid, 2, weapon, ammosd);
  198. if(weapon == 22 && PlayerInfo[playerid][pDan1] > 0)
  199. {
  200. RemovePlayerWeapon(playerid, weapon);
  201. if(PlayerInfo[playerid][pAmmo][ 1 ] < 2)
  202. {
  203. PlayerInfo[playerid][pDan1] -= 1;
  204. GivePlayerValidWeapon(playerid, weapon, 0);
  205. GivePlayerAmmoEx(playerid, weapon, 18);
  206. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  207. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}9mm ");
  208. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  209. SetPlayerArmedWeapon(playerid, weapon);
  210. }
  211. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  212. }
  213. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  214. }
  215. if(strcmp(params, "Sdpistol", true) == 0)
  216. {
  217. new weapon, ammosd;
  218. GetPlayerWeaponData(playerid, 2, weapon, ammosd);
  219. if(weapon == 23 && PlayerInfo[playerid][pDan1] > 0)
  220. {
  221. RemovePlayerWeapon(playerid, weapon);
  222. if(PlayerInfo[playerid][pAmmo][ 1 ] < 2)
  223. {
  224. PlayerInfo[playerid][pDan1] -= 1;
  225. GivePlayerValidWeapon(playerid, weapon, 0);
  226. GivePlayerAmmoEx(playerid, weapon, 18);
  227. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  228. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Sdpistol");
  229. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  230. SetPlayerArmedWeapon(playerid, weapon);
  231. }
  232. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  233. }
  234. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  235. }
  236. if(strcmp(params, "uzi", true) == 0)
  237. {
  238. new weapon, ammosd;
  239. GetPlayerWeaponData(playerid, 4, weapon, ammosd);
  240. if(weapon == 28 && PlayerInfo[playerid][pDan4] > 0)
  241. {
  242. RemovePlayerWeapon(playerid, weapon);
  243. if(PlayerInfo[playerid][pAmmo][ 3 ] < 2)
  244. {
  245. PlayerInfo[playerid][pDan4] -= 1;
  246. GivePlayerValidWeapon(playerid, weapon, 0);
  247. GivePlayerAmmoEx(playerid, weapon, 31);
  248. ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.0, 0, 0, 0, 0, 0, 1);
  249. SendClientMessageEx(playerid, COLOR_YELLOW, "{99CC33}[!]Thay dan thanh cong - {99CC33}Uzi, Tec9 ");
  250. GameTextForPlayer(playerid, "~y~Dang thay dan", 5000, 3);
  251. SetPlayerArmedWeapon(playerid, weapon);
  252. }
  253. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban da du so dan tren vu khi , khong the thay tiep[>] ");
  254. }
  255. else SendClientMessageEx(playerid, COLOR_YELLOW, "[!]Ban khong du bang dan de thay hoac chua cam sung tren tay[>]");
  256. }
  257. }
  258. return 1;
  259. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement