armsdealer.pwn 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Arms Dealer Revision
  11. Winterfield
  12. Next Generation Gaming, LLC
  13. (created by Next Generation Gaming Development Team)
  14. * Copyright (c) 2016, Next Generation Gaming, LLC
  15. *
  16. * All rights reserved.
  17. *
  18. * Redistribution and use in source and binary forms, with or without modification,
  19. * are not permitted in any case.
  20. *
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  25. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  26. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  27. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  28. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  29. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  30. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  31. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. CMD:sellgun(playerid, params[])
  35. {
  36. if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerInfo[playerid][pJailTime] > 0 || GetPVarInt(playerid, "Injured")) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot do this at this time.");
  37. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  38. if(PlayerInfo[playerid][pJob] == 9 || PlayerInfo[playerid][pJob2] == 9 || PlayerInfo[playerid][pJob3] == 9)
  39. {
  40. if(GetPVarInt(playerid, "pSellGunTime") > gettime()) return SendClientMessageEx(playerid, COLOR_GRAD1, "You must wait 10 seconds before selling another gun.");
  41. if(GetPVarType(playerid, "WatchingTV") || GetPVarType(playerid, "PreviewingTV")) return SendClientMessage(playerid, COLOR_GRAD1, "You cannot use drugs while watching TV.");
  42. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "You cannot sell a gun while in a vehicle!");
  43. if(HungerPlayerInfo[playerid][hgInEvent] != 0) return SendClientMessageEx(playerid, COLOR_GREY, " You cannot do this while being in the Hunger Games Event!");
  44. #if defined zombiemode
  45. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't use this.");
  46. #endif
  47. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "IsFrozen") || PlayerInfo[playerid][pHospital] || (PlayerInfo[playerid][pJailTime] > 0 && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1))
  48. return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
  49. if(GetPVarType(playerid, "AttemptingLockPick")) return SendClientMessageEx(playerid, COLOR_WHITE, "You are attempting to lockpick, please wait.");
  50. if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
  51. if(PlayerInfo[playerid][pHospital]) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot do this at this time.");
  52. szMiscArray[0] = 0;
  53. new id, weapon[16];
  54. if(sscanf(params, "us[16]", id, weapon))
  55. {
  56. SendClientMessageEx(playerid, COLOR_WHITE, "-------------------------------------");
  57. switch(PlayerInfo[playerid][pArmsSkill])
  58. {
  59. case 0 .. 49: // level 1
  60. {
  61. SendClientMessageEx(playerid, COLOR_GRAD1, "flowers(100) knuckles(100)");
  62. SendClientMessageEx(playerid, COLOR_WHITE, "bat(100) cane(100)");
  63. SendClientMessageEx(playerid, COLOR_GRAD1, "shovel(100) club(100)");
  64. SendClientMessageEx(playerid, COLOR_WHITE, "pool(100) katana(100)");
  65. SendClientMessageEx(playerid, COLOR_GRAD1, "dildo(100) 9mm(500)");
  66. SendClientMessageEx(playerid, COLOR_WHITE, "sdpistol(1000)");
  67. }
  68. case 50 .. 199: // level 2
  69. {
  70. SendClientMessageEx(playerid, COLOR_GRAD1, "flowers(100) knuckles(100)");
  71. SendClientMessageEx(playerid, COLOR_WHITE, "bat(100) cane(100)");
  72. SendClientMessageEx(playerid, COLOR_GRAD1, "shovel(100) club(100)");
  73. SendClientMessageEx(playerid, COLOR_WHITE, "pool(100) katana(100)");
  74. SendClientMessageEx(playerid, COLOR_GRAD1, "dildo(100) 9mm(500)");
  75. SendClientMessageEx(playerid, COLOR_WHITE, "sdpistol(1000) shotgun(4000)");
  76. SendClientMessageEx(playerid, COLOR_WHITE, "mp5(2500)");
  77. }
  78. case 200 .. 699: // level 3
  79. {
  80. SendClientMessageEx(playerid, COLOR_GRAD1, "flowers(100) knuckles(100)");
  81. SendClientMessageEx(playerid, COLOR_WHITE, "bat(100) cane(100)");
  82. SendClientMessageEx(playerid, COLOR_GRAD1, "shovel(100) club(100)");
  83. SendClientMessageEx(playerid, COLOR_WHITE, "pool(100) katana(100)");
  84. SendClientMessageEx(playerid, COLOR_GRAD1, "dildo(100) 9mm(500)");
  85. SendClientMessageEx(playerid, COLOR_WHITE, "sdpistol(1000) shotgun(4000)");
  86. SendClientMessageEx(playerid, COLOR_WHITE, "mp5(2500) rifle(3000)");
  87. }
  88. case 700 .. 1199:// Level 4
  89. {
  90. SendClientMessageEx(playerid, COLOR_GRAD1, "flowers(100) knuckles(100)");
  91. SendClientMessageEx(playerid, COLOR_WHITE, "bat(100) cane(100)");
  92. SendClientMessageEx(playerid, COLOR_GRAD1, "shovel(100) club(100)");
  93. SendClientMessageEx(playerid, COLOR_WHITE, "pool(100) katana(100)");
  94. SendClientMessageEx(playerid, COLOR_GRAD1, "dildo(100) 9mm(500)");
  95. SendClientMessageEx(playerid, COLOR_WHITE, "sdpistol(1000) shotgun(4000)");
  96. SendClientMessageEx(playerid, COLOR_WHITE, "mp5(2500) rifle(3000)");
  97. SendClientMessageEx(playerid, COLOR_WHITE, "tec9(3000) uzi(2500)");
  98. }
  99. default:
  100. {
  101. SendClientMessageEx(playerid, COLOR_GRAD1, "flowers(100) knuckles(100)");
  102. SendClientMessageEx(playerid, COLOR_WHITE, "bat(100) cane(100)");
  103. SendClientMessageEx(playerid, COLOR_GRAD1, "shovel(100) club(100)");
  104. SendClientMessageEx(playerid, COLOR_WHITE, "pool(100) katana(100)");
  105. SendClientMessageEx(playerid, COLOR_GRAD1, "dildo(100) 9mm(500)");
  106. SendClientMessageEx(playerid, COLOR_WHITE, "sdpistol(1000) shotgun(4000)");
  107. SendClientMessageEx(playerid, COLOR_WHITE, "mp5(2500) rifle(3000)");
  108. SendClientMessageEx(playerid, COLOR_WHITE, "tec9(3000) uzi(2500)");
  109. SendClientMessageEx(playerid, COLOR_WHITE, "deagle(5000)");
  110. }
  111. }
  112. if(PlayerInfo[playerid][pArmsSkill] >= 1200) SendClientMessageEx(playerid, COLOR_WHITE, "ak47(10000) - Requires Gold VIP");
  113. SendClientMessageEx(playerid, COLOR_WHITE, "-------------------------------------");
  114. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /sellgun [playerid] [weapon]");
  115. return 1;
  116. }
  117. if(IsPlayerConnected(id))
  118. {
  119. if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_GRAD1, "You cannot sell a gun to someone in a vehicle!");
  120. if(!ProxDetectorS(8.0, playerid, id)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not near that player.");
  121. if(PlayerInfo[id][pConnectHours] < 2 || PlayerInfo[id][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "That player is currently weapon restricted!");
  122. if(strcmp(weapon, "Flowers", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  123. {
  124. if(PlayerInfo[playerid][pMats] >= 100)
  125. {
  126. if(id == playerid)
  127. {
  128. PlayerInfo[playerid][pMats] -= 100;
  129. GivePlayerValidWeapon(id, 14);
  130. }
  131. else
  132. {
  133. SetPVarInt(id, "pSellGun", 14);
  134. SetPVarInt(id, "pSellGunMats", 100);
  135. SetPVarInt(id, "pSellGunID", playerid);
  136. }
  137. }
  138. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  139. }
  140. else if(strcmp(weapon, "Knuckles", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  141. {
  142. if(PlayerInfo[playerid][pMats] >= 100)
  143. {
  144. if(id == playerid)
  145. {
  146. PlayerInfo[playerid][pMats] -= 100;
  147. GivePlayerValidWeapon(id, 1);
  148. }
  149. else
  150. {
  151. SetPVarInt(id, "pSellGun", 1);
  152. SetPVarInt(id, "pSellGunMats", 100);
  153. SetPVarInt(id, "pSellGunID", playerid);
  154. }
  155. }
  156. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  157. }
  158. else if(strcmp(weapon, "Bat", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  159. {
  160. if(PlayerInfo[playerid][pMats] >= 100)
  161. {
  162. if(id == playerid)
  163. {
  164. PlayerInfo[playerid][pMats] -= 100;
  165. GivePlayerValidWeapon(id, 5);
  166. }
  167. else
  168. {
  169. SetPVarInt(id, "pSellGun", 5);
  170. SetPVarInt(id, "pSellGunMats", 100);
  171. SetPVarInt(id, "pSellGunID", playerid);
  172. }
  173. }
  174. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  175. }
  176. else if(strcmp(weapon, "Cane", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  177. {
  178. if(PlayerInfo[playerid][pMats] >= 100)
  179. {
  180. if(id == playerid)
  181. {
  182. PlayerInfo[playerid][pMats] -= 100;
  183. GivePlayerValidWeapon(id, 15);
  184. }
  185. else
  186. {
  187. SetPVarInt(id, "pSellGun", 15);
  188. SetPVarInt(id, "pSellGunMats", 100);
  189. SetPVarInt(id, "pSellGunID", playerid);
  190. }
  191. }
  192. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  193. }
  194. else if(strcmp(weapon, "Shovel", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  195. {
  196. if(PlayerInfo[playerid][pMats] >= 100)
  197. {
  198. if(id == playerid)
  199. {
  200. PlayerInfo[playerid][pMats] -= 100;
  201. GivePlayerValidWeapon(id, 6);
  202. }
  203. else
  204. {
  205. SetPVarInt(id, "pSellGun", 6);
  206. SetPVarInt(id, "pSellGunMats", 100);
  207. SetPVarInt(id, "pSellGunID", playerid);
  208. }
  209. }
  210. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  211. }
  212. else if(strcmp(weapon, "Club", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  213. {
  214. if(PlayerInfo[playerid][pMats] >= 100)
  215. {
  216. if(id == playerid)
  217. {
  218. PlayerInfo[playerid][pMats] -= 100;
  219. GivePlayerValidWeapon(id, 2);
  220. }
  221. else
  222. {
  223. SetPVarInt(id, "pSellGun", 2);
  224. SetPVarInt(id, "pSellGunMats", 100);
  225. SetPVarInt(id, "pSellGunID", playerid);
  226. }
  227. }
  228. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  229. }
  230. else if(strcmp(weapon, "Pool", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  231. {
  232. if(PlayerInfo[playerid][pMats] >= 100)
  233. {
  234. if(id == playerid)
  235. {
  236. PlayerInfo[playerid][pMats] -= 100;
  237. GivePlayerValidWeapon(id, 7);
  238. }
  239. else
  240. {
  241. SetPVarInt(id, "pSellGun", 7);
  242. SetPVarInt(id, "pSellGunMats", 100);
  243. SetPVarInt(id, "pSellGunID", playerid);
  244. }
  245. }
  246. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  247. }
  248. else if(strcmp(weapon, "Katana", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  249. {
  250. if(PlayerInfo[playerid][pMats] >= 100)
  251. {
  252. if(id == playerid)
  253. {
  254. PlayerInfo[playerid][pMats] -= 100;
  255. GivePlayerValidWeapon(id, 8);
  256. }
  257. else
  258. {
  259. SetPVarInt(id, "pSellGun", 8);
  260. SetPVarInt(id, "pSellGunMats", 100);
  261. SetPVarInt(id, "pSellGunID", playerid);
  262. }
  263. }
  264. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  265. }
  266. else if(strcmp(weapon, "Dildo", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  267. {
  268. if(PlayerInfo[playerid][pMats] >= 100)
  269. {
  270. if(id == playerid)
  271. {
  272. PlayerInfo[playerid][pMats] -= 100;
  273. GivePlayerValidWeapon(id, 10);
  274. }
  275. else
  276. {
  277. SetPVarInt(id, "pSellGun", 10);
  278. SetPVarInt(id, "pSellGunMats", 100);
  279. SetPVarInt(id, "pSellGunID", playerid);
  280. }
  281. }
  282. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  283. }
  284. else if(strcmp(weapon, "9mm", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  285. {
  286. if(PlayerInfo[playerid][pMats] >= 500)
  287. {
  288. if(id == playerid)
  289. {
  290. PlayerInfo[playerid][pMats] -= 500;
  291. GivePlayerValidWeapon(id, 22);
  292. PlayerInfo[playerid][pArmsSkill] += 1;
  293. }
  294. else
  295. {
  296. SetPVarInt(id, "pSellGun", 22);
  297. SetPVarInt(id, "pSellGunMats", 500);
  298. SetPVarInt(id, "pSellGunID", playerid);
  299. SetPVarInt(id, "pSellGunXP", 1);
  300. }
  301. }
  302. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  303. }
  304. else if(strcmp(weapon, "Shotgun", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 50)
  305. {
  306. if(PlayerInfo[playerid][pMats] >= 4000)
  307. {
  308. if(id == playerid)
  309. {
  310. PlayerInfo[playerid][pMats] -= 4000;
  311. GivePlayerValidWeapon(id, 25);
  312. PlayerInfo[playerid][pArmsSkill] += 1;
  313. }
  314. else
  315. {
  316. SetPVarInt(id, "pSellGun", 25);
  317. SetPVarInt(id, "pSellGunMats", 4000);
  318. SetPVarInt(id, "pSellGunID", playerid);
  319. SetPVarInt(id, "pSellGunXP", 1);
  320. }
  321. }
  322. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  323. }
  324. else if(strcmp(weapon, "SDPistol", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 0)
  325. {
  326. if(PlayerInfo[playerid][pMats] >= 1000)
  327. {
  328. if(id == playerid)
  329. {
  330. PlayerInfo[playerid][pMats] -= 1000;
  331. GivePlayerValidWeapon(id, 23);
  332. PlayerInfo[playerid][pArmsSkill] += 1;
  333. }
  334. else
  335. {
  336. SetPVarInt(id, "pSellGun", 23);
  337. SetPVarInt(id, "pSellGunMats", 1000);
  338. SetPVarInt(id, "pSellGunID", playerid);
  339. SetPVarInt(id, "pSellGunXP", 1);
  340. }
  341. }
  342. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  343. }
  344. else if(strcmp(weapon, "Uzi", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 700)
  345. {
  346. if(PlayerInfo[playerid][pMats] >= 2500)
  347. {
  348. if(id == playerid)
  349. {
  350. PlayerInfo[playerid][pMats] -= 2500;
  351. GivePlayerValidWeapon(id, 28);
  352. PlayerInfo[playerid][pArmsSkill] += 1;
  353. }
  354. else
  355. {
  356. SetPVarInt(id, "pSellGun", 28);
  357. SetPVarInt(id, "pSellGunMats", 2500);
  358. SetPVarInt(id, "pSellGunID", playerid);
  359. SetPVarInt(id, "pSellGunXP", 1);
  360. }
  361. }
  362. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  363. }
  364. else if(strcmp(weapon, "Tec9", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 700)
  365. {
  366. if(PlayerInfo[playerid][pMats] >= 3000)
  367. {
  368. if(id == playerid)
  369. {
  370. PlayerInfo[playerid][pMats] -= 3000;
  371. GivePlayerValidWeapon(id, 32);
  372. PlayerInfo[playerid][pArmsSkill] += 1;
  373. }
  374. else
  375. {
  376. SetPVarInt(id, "pSellGun", 32);
  377. SetPVarInt(id, "pSellGunMats", 3000);
  378. SetPVarInt(id, "pSellGunID", playerid);
  379. SetPVarInt(id, "pSellGunXP", 1);
  380. }
  381. }
  382. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  383. }
  384. else if(strcmp(weapon, "Rifle", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 200)
  385. {
  386. if(PlayerInfo[playerid][pMats] >= 3000)
  387. {
  388. if(id == playerid)
  389. {
  390. PlayerInfo[playerid][pMats] -= 3000;
  391. GivePlayerValidWeapon(id, 33);
  392. PlayerInfo[playerid][pArmsSkill] += 1;
  393. }
  394. else
  395. {
  396. SetPVarInt(id, "pSellGun", 33);
  397. SetPVarInt(id, "pSellGunMats", 3000);
  398. SetPVarInt(id, "pSellGunID", playerid);
  399. SetPVarInt(id, "pSellGunXP", 1);
  400. }
  401. }
  402. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  403. }
  404. else if(strcmp(weapon, "MP5", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 200)
  405. {
  406. if(PlayerInfo[playerid][pMats] >= 2500)
  407. {
  408. if(id == playerid)
  409. {
  410. PlayerInfo[playerid][pMats] -= 2500;
  411. GivePlayerValidWeapon(id, 29);
  412. PlayerInfo[playerid][pArmsSkill] += 1;
  413. }
  414. else
  415. {
  416. SetPVarInt(id, "pSellGun", 29);
  417. SetPVarInt(id, "pSellGunMats", 2500);
  418. SetPVarInt(id, "pSellGunID", playerid);
  419. SetPVarInt(id, "pSellGunXP", 1);
  420. }
  421. }
  422. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  423. }
  424. else if(strcmp(weapon, "Deagle", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 1200)
  425. {
  426. if(PlayerInfo[playerid][pMats] >= 5000)
  427. {
  428. if(id == playerid)
  429. {
  430. PlayerInfo[playerid][pMats] -= 5000;
  431. GivePlayerValidWeapon(id, 24);
  432. PlayerInfo[playerid][pArmsSkill] += 1;
  433. }
  434. else
  435. {
  436. SetPVarInt(id, "pSellGun", 24);
  437. SetPVarInt(id, "pSellGunMats", 5000);
  438. SetPVarInt(id, "pSellGunID", playerid);
  439. SetPVarInt(id, "pSellGunXP", 1);
  440. }
  441. }
  442. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  443. }
  444. else if(strcmp(weapon, "AK47", true) == 0 && PlayerInfo[playerid][pArmsSkill] >= 1200)
  445. {
  446. if(PlayerInfo[playerid][pDonateRank] > 2) {
  447. if(PlayerInfo[playerid][pMats] >= 10000)
  448. {
  449. if(id == playerid)
  450. {
  451. PlayerInfo[playerid][pMats] -= 10000;
  452. GivePlayerValidWeapon(id, 30);
  453. PlayerInfo[playerid][pArmsSkill] += 1;
  454. }
  455. else
  456. {
  457. SetPVarInt(id, "pSellGun", 30);
  458. SetPVarInt(id, "pSellGunMats", 10000);
  459. SetPVarInt(id, "pSellGunID", playerid);
  460. SetPVarInt(id, "pSellGunXP", 1);
  461. }
  462. }
  463. else return SendClientMessage(playerid, COLOR_WHITE, "You do not have enough materials!");
  464. }
  465. else return SendClientMessageEx(playerid, COLOR_WHITE, "You need to be a Gold VIP to craft this weapon!");
  466. }
  467. else
  468. {
  469. return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid Weapon!");
  470. }
  471. weapon[0] = toupper(weapon[0]);
  472. if(id == playerid)
  473. {
  474. format(szMiscArray, sizeof(szMiscArray), "%s crafts a %s from their materials, handing it to themselves.", GetPlayerNameEx(playerid), weapon);
  475. ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  476. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); // Just a little 'classic' feel to it. -Winterfield
  477. }
  478. else
  479. {
  480. format(szMiscArray, sizeof(szMiscArray), "You have offered %s a %s.", GetPlayerNameEx(id), weapon);
  481. SendClientMessage(playerid, COLOR_LIGHTBLUE, szMiscArray);
  482. format(szMiscArray, sizeof(szMiscArray), "%s has offered to sell you a %s, type /accept weapon to accept it.", GetPlayerNameEx(playerid), weapon);
  483. SendClientMessage(id, COLOR_LIGHTBLUE, szMiscArray);
  484. }
  485. SetPVarInt(playerid, "pSellGunTime", gettime() + 10);
  486. return 1; // Added so the error message would work.
  487. }
  488. else return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not currently online, please try again!");
  489. }
  490. SendClientMessage(playerid, COLOR_WHITE, "You are not an Arms Dealer!");
  491. return 1;
  492. }