Advertisement
Hyland

[HMA] Scope System

Dec 21st, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.62 KB | None | 0 0
  1. //////////NEWS////////////////
  2. new ScopeEnabled = 1;
  3.  
  4. /////////enum pInfo//////////
  5. pScope,
  6.  
  7. //////////////////////////////////HH checkfloats//////////////////////////////////////////////
  8. PlayerInfo[playerid][pScope] = 0;
  9.  
  10.  
  11. ///////////////////////////////newskey/Keyboard buttons////////////////////////////////////////
  12. if(newkeys & KEY_FIRE && newkeys & KEY_HANDBRAKE)
  13. {
  14. if(GetPlayerWeapon(playerid) == 34 && PlayerInfo[playerid][pScope] == 1 && PlayerInfo[playerid][pMember] == 8 && ScopeEnabled == 1)
  15. {
  16. new Float:blahx, Float:blahy, Float:blahz;
  17. HeadshotCheck(playerid, blahx, blahy, blahz);
  18. }
  19. }
  20. }
  21.  
  22. /////////////////////////////////format///////////////////////////////////////////////////////
  23. format(var, 32, "Scope=%d\n",PlayerInfo[playerid][pScope]);fwrite(hFile, var);
  24. format(var, 32, "Scope=%d\n",PlayerInfo[playerid][pScope]);fwrite(hFile, var);
  25.  
  26. ///////////////////////////////strcmp, key///////////////////////////////////////////////////
  27. if( strcmp( key , "Scope" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pScope] = strval( val ); }
  28.  
  29. ///////////////////////////////command///////////////////////////////////////////////////////
  30. CMD:order(playerid, params[])
  31. {
  32. if (IsAHitman(playerid))
  33. {
  34. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot do this right now.");
  35. if(IsPlayerInRangeOfPoint(playerid, 4.0, -71.419654846191,1360.4097900391,1080.2185058594) || IsPlayerInRangeOfPoint(playerid, 6.0, 1415.727905, -1299.371093, 15.054657))
  36. {
  37. if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
  38. new Hitman[32], skin = -1;
  39. if(sscanf(params, "s[32]D", Hitman, skin))
  40. {
  41. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /order [name]");
  42. SendClientMessageEx(playerid, COLOR_GRAD2, " Rank 1: Knife ($800), SDPistol ($1000), Shotgun ($1500), Skin ($2500), Desert Eagle ($5000), MP5 ($2500), Kevlar Vest ($6000), firstaid ($500)");
  43. SendClientMessageEx(playerid, COLOR_GRAD2, " Rank 2: Rifle ($3000), AK47 ($10,000), M4 ($12,000)");
  44. SendClientMessageEx(playerid, COLOR_GRAD2, " Rank 3: SPAS-12 ($35,000), Sniper ($35,000)");
  45. SendClientMessageEx(playerid, COLOR_GRAD2, " Rank 4: C4 ($50,000), Scope ($100,000)");
  46. return 1;
  47. }
  48. else if(strcmp(Hitman,"skin",true) == 0)
  49. {
  50. if(PlayerInfo[playerid][pRank] < 1) {
  51. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that!");
  52. }
  53. else if(IsInvalidSkin(skin)) {
  54. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /order skin [skin ID]");
  55. }
  56. else if(GetPlayerCash(playerid) >= 2500) {
  57. SetPlayerSkin(playerid, skin);
  58. PlayerInfo[playerid][pModel] = skin;
  59. GivePlayerCash(playerid, -2500);
  60. SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"You have purchased a skin!");
  61. }
  62. else SendClientMessageEx(playerid, COLOR_GREY," You can't afford that!");
  63. }
  64. else if(strcmp(Hitman,"Scope",true) == 0)
  65. {
  66. if(PlayerInfo[playerid][pRank] < 4)
  67. {
  68. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  69. return 1;
  70. }
  71. if(GetPlayerCash(playerid) >= 100000)
  72. {
  73. PlayerInfo[playerid][pScope] = 1;
  74. GivePlayerCash(playerid, -100000);
  75. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a scope!");
  76. return 1;
  77. }
  78. else
  79. {
  80. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  81. return 1;
  82. }
  83. }
  84. else if(strcmp(Hitman,"Knife",true) == 0)
  85. {
  86. if(PlayerInfo[playerid][pRank] < 1)
  87. {
  88. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  89. return 1;
  90. }
  91. if(GetPlayerCash(playerid) >= 800)
  92. {
  93. GivePlayerValidWeapon(playerid, 4, 3);
  94. GivePlayerCash(playerid, -800);
  95. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a knife!");
  96. return 1;
  97. }
  98. else
  99. {
  100. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  101. return 1;
  102. }
  103. }
  104. else if(strcmp(Hitman,"firstaid",true) == 0)
  105. {
  106. if(PlayerInfo[playerid][pRank] < 1)
  107. {
  108. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that!");
  109. return 1;
  110. }
  111. if(GetPlayerCash(playerid) >= 500)
  112. {
  113. SetPlayerHealth(playerid, 100);
  114. GivePlayerCash(playerid, -500);
  115. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a firstaid!");
  116. return 1;
  117. }
  118. else
  119. {
  120. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  121. return 1;
  122. }
  123. }
  124. else if(strcmp(Hitman,"SDPistol",true) == 0)
  125. {
  126. if(PlayerInfo[playerid][pRank] < 1)
  127. {
  128. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  129. return 1;
  130. }
  131. if(GetPlayerCash(playerid) >= 1000)
  132. {
  133. GivePlayerValidWeapon(playerid, 23, 99999);
  134. GivePlayerCash(playerid, -1000);
  135. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a silenced pistol!");
  136. return 1;
  137. }
  138. else
  139. {
  140. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  141. return 1;
  142. }
  143. }
  144. else if(strcmp(Hitman,"Shotgun",true) == 0)
  145. {
  146. if(PlayerInfo[playerid][pRank] < 1)
  147. {
  148. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  149. return 1;
  150. }
  151. if(GetPlayerCash(playerid) >= 1500)
  152. {
  153. GivePlayerValidWeapon(playerid, 25, 99999);
  154. GivePlayerCash(playerid, -1500);
  155. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a shotgun!");
  156. return 1;
  157. }
  158. else
  159. {
  160. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  161. return 1;
  162. }
  163. }
  164. else if(strcmp(Hitman,"Deagle",true) == 0)
  165. {
  166. if(PlayerInfo[playerid][pRank] < 1)
  167. {
  168. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  169. return 1;
  170. }
  171. if(GetPlayerCash(playerid) > 5000)
  172. {
  173. GivePlayerValidWeapon(playerid, 24, 99999);
  174. GivePlayerCash(playerid, -5000);
  175. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a Desert Eagle!");
  176. return 1;
  177. }
  178. else
  179. {
  180. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  181. return 1;
  182. }
  183. }
  184. else if(strcmp(Hitman,"MP5",true) == 0)
  185. {
  186. if(PlayerInfo[playerid][pRank] < 1)
  187. {
  188. SendClientMessageEx(playerid, COLOR_GREY, " You are not the required rank for that weapon!");
  189. return 1;
  190. }
  191. if(GetPlayerCash(playerid) >= 2500)
  192. {
  193. GivePlayerValidWeapon(playerid, 29, 99999);
  194. GivePlayerCash(playerid, -2500);
  195. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased an MP5!");
  196. return 1;
  197. }
  198. else
  199. {
  200. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  201. return 1;
  202. }
  203. }
  204. else if(strcmp(Hitman,"Rifle",true) == 0)
  205. {
  206. if(PlayerInfo[playerid][pRank] < 2)
  207. {
  208. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  209. return 1;
  210. }
  211. if(GetPlayerCash(playerid) >= 3000)
  212. {
  213. GivePlayerValidWeapon(playerid, 33, 99999);
  214. GivePlayerCash(playerid, -3000);
  215. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a rifle!");
  216. return 1;
  217. }
  218. else
  219. {
  220. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  221. return 1;
  222. }
  223. }
  224. else if(strcmp(Hitman,"AK47",true) == 0)
  225. {
  226. if(PlayerInfo[playerid][pRank] < 2)
  227. {
  228. SendClientMessageEx(playerid, COLOR_GREY, " you are not the required rank for that weapon!");
  229. return 1;
  230. }
  231. if(GetPlayerCash(playerid) >= 10000)
  232. {
  233. GivePlayerValidWeapon(playerid, 30, 99999);
  234. GivePlayerCash(playerid, -10000);
  235. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased an AK-47!");
  236. return 1;
  237. }
  238. else
  239. {
  240. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  241. return 1;
  242. }
  243. }
  244. else if(strcmp(Hitman,"M4",true) == 0)
  245. {
  246. if(PlayerInfo[playerid][pRank] < 2)
  247. {
  248. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  249. return 1;
  250. }
  251. if(GetPlayerCash(playerid) >= 12000)
  252. {
  253. GivePlayerValidWeapon(playerid, 31, 99999);
  254. GivePlayerCash(playerid, -12000);
  255. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased an M4!");
  256. return 1;
  257. }
  258. else
  259. {
  260. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  261. return 1;
  262. }
  263. }
  264. else if(strcmp(Hitman,"Vest",true) == 0)
  265. {
  266. if(PlayerInfo[playerid][pRank] < 1)
  267. {
  268. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  269. return 1;
  270. }
  271. if(GetPlayerCash(playerid) >= 6000)
  272. {
  273. SetPlayerArmor(playerid, 99);
  274. GivePlayerCash(playerid, -6000);
  275. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a kevlar vest!");
  276. return 1;
  277. }
  278. else
  279. {
  280. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  281. return 1;
  282. }
  283. }
  284. else if(strcmp(Hitman,"Spas12",true) == 0)
  285. {
  286. if(PlayerInfo[playerid][pRank] < 3)
  287. {
  288. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  289. return 1;
  290. }
  291. if(GetPlayerCash(playerid) >= 35000)
  292. {
  293. GivePlayerValidWeapon(playerid, 27, 99999);
  294. GivePlayerCash(playerid, -35000);
  295. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a SPAS-12!");
  296. return 1;
  297. }
  298. else
  299. {
  300. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  301. return 1;
  302. }
  303. }
  304. else if(strcmp(Hitman,"Sniper",true) == 0)
  305. {
  306. if(PlayerInfo[playerid][pRank] < 3)
  307. {
  308. SendClientMessageEx(playerid, COLOR_GREY, "You are not the required rank for that weapon!");
  309. return 1;
  310. }
  311. if(GetPlayerCash(playerid) >= 35000)
  312. {
  313. GivePlayerValidWeapon(playerid, 34, 99999);
  314. GivePlayerCash(playerid, -35000);
  315. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a sniper rifle!");
  316. return 1;
  317. }
  318. else
  319. {
  320. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  321. return 1;
  322. }
  323. }
  324. else if(strcmp(Hitman,"C4",true) == 0)
  325. {
  326. if(PlayerInfo[playerid][pRank] < 4)
  327. {
  328. SendClientMessageEx(playerid, COLOR_GREY, "Yyou are not the required rank for that weapon!");
  329. return 1;
  330. }
  331. if(GetPlayerCash(playerid) >= 50000)
  332. {
  333. PlayerInfo[playerid][pC4Get] = 1;
  334. PlayerInfo[playerid][pBombs]++;
  335. GivePlayerCash(playerid, -50000);
  336. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased one block of C4!");
  337. }
  338. else
  339. {
  340. SendClientMessageEx(playerid, COLOR_GREY," You can't afford that package!");
  341. return 1;
  342. }
  343. }
  344. }
  345. else
  346. {
  347. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not at the gun shack!");
  348. return 1;
  349. }
  350. }
  351. else
  352. {
  353. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a member of the hitman agency!");
  354. return 1;
  355. }
  356. return 1;
  357. }
  358.  
  359. ///////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement