contract.pwn 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Contract Group Type
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #include <YSI\y_hooks>
  34. forward PickUpC4(playerid);
  35. public PickUpC4(playerid)
  36. {
  37. DestroyDynamicObject(PlayerInfo[playerid][pC4]);
  38. PlayerInfo[playerid][pC4] = 0;
  39. return 1;
  40. }
  41. stock SearchingHit(playerid)
  42. {
  43. new string[128], group = PlayerInfo[playerid][pMember];
  44. SendClientMessageEx(playerid, COLOR_WHITE, "Available Contracts:");
  45. new hits;
  46. foreach(new i: Player)
  47. {
  48. if(!IsAHitman(i) && PlayerInfo[i][pHeadValue] > 0)
  49. {
  50. if(GotHit[i] == 0)
  51. {
  52. hits++;
  53. format(string, sizeof(string), "%s (ID %d) | $%s | Placed By: %s | Reason: %s | Chased By: Nobody", GetPlayerNameEx(i), i, number_format(PlayerInfo[i][pHeadValue]), PlayerInfo[i][pContractBy], PlayerInfo[i][pContractDetail]);
  54. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  55. }
  56. else
  57. {
  58. format(string, sizeof(string), "%s (ID %d) | $%s | Placed By: %s | Reason: %s | Chased By: %s", GetPlayerNameEx(i), i, number_format(PlayerInfo[i][pHeadValue]), PlayerInfo[i][pContractBy], PlayerInfo[i][pContractDetail], GetPlayerNameEx(GetChased[i]));
  59. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  60. }
  61. }
  62. }
  63. if(hits && PlayerInfo[playerid][pRank] <= 1 && arrGroupData[group][g_iGroupType] == GROUP_TYPE_CONTRACT)
  64. {
  65. SendClientMessageEx(playerid, COLOR_YELLOW, "Use /givemehit to assign a contract to yourself.");
  66. }
  67. if(hits && PlayerInfo[playerid][pRank] >= 6 && arrGroupData[group][g_iGroupType] == GROUP_TYPE_CONTRACT)
  68. {
  69. SendClientMessageEx(playerid, COLOR_YELLOW, "Use /givehit to assign a contract to one of the hitmen.");
  70. }
  71. if(hits == 0)
  72. {
  73. SendClientMessageEx(playerid, COLOR_GREY, "There are no hits available.");
  74. }
  75. return 0;
  76. }
  77. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  78. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  79. szMiscArray[0] = 0;
  80. switch(dialogid)
  81. {
  82. case DIALOG_ORDER_HMA1:
  83. {
  84. if(response) {
  85. switch(listitem) {
  86. case 0: {
  87. if(GetPlayerCash(playerid) >= 2000) {
  88. SetHealth(playerid, 100);
  89. SetArmour(playerid, 100);
  90. GivePlayerCash(playerid, - 2000);
  91. }
  92. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  93. }
  94. case 1: {
  95. if(PlayerInfo[playerid][pRank] < 4) { // use this to check their rank
  96. format(szMiscArray, sizeof(szMiscArray), "\nTear Gas\t\t $5,000\n\
  97. Knife\t\t\t $12,000\n\
  98. Baton\t\t\t $5,000\n\
  99. Spraycan\t\t $4,500\n\
  100. Colt.45\t\t\t $5,000\n\
  101. SD Pistol\t\t $7,500\n\
  102. Deagle\t\t\t $12,000\n\
  103. MP5\t\t\t $17,500\n\
  104. UZI\t\t\t $17,500\n\
  105. TEC9\t\t\t $17,500\n\
  106. Shotgun\t\t $11,000\n\
  107. SPAS12\t\t\t $90,000\n\
  108. AK47\t\t\t $35,000\n\
  109. M4\t\t\t $70,000\n\
  110. Rifle\t\t\t $10,000\n\
  111. Sniper\t\t\t $65,000"
  112. );
  113. }
  114. else {
  115. format(szMiscArray, sizeof(szMiscArray), "\nTear Gas\t\t $5,000\n\
  116. Knife\t\t\t $12,000\n\
  117. Baton\t\t\t $5,000\n\
  118. Spraycan\t\t $4,500\n\
  119. Colt.45\t\t\t $5,000\n\
  120. SD Pistol\t\t $7,500\n\
  121. Deagle\t\t\t $12,000\n\
  122. MP5\t\t\t $17,500\n\
  123. UZI\t\t\t $17,500\n\
  124. TEC9\t\t\t $17,500\n\
  125. Shotgun\t\t $11,000\n\
  126. SPAS12\t\t\t $90,000\n\
  127. AK47\t\t\t $35,000\n\
  128. M4\t\t\t $70,000\n\
  129. Rifle\t\t\t $10,000\n\
  130. Sniper\t\t\t $65,000\n\
  131. Chainsaw\t\t $20,000\n\
  132. C4\t\t\t $50,000"
  133. );
  134. }
  135. ShowPlayerDialogEx(playerid, DIALOG_ORDER_HMAWPS, DIALOG_STYLE_LIST, "Weapon Select", szMiscArray, "Select", "Back");
  136. }
  137. case 2: {
  138. ShowPlayerDialogEx(playerid, DIALOG_ORDER_HMASKIN, DIALOG_STYLE_INPUT, "Uniform", "Choose a skin (by ID).", "Change", "Back");
  139. }
  140. case 3: {
  141. if(gettime()-GetPVarInt(playerid, "LastNameChange") < 120) {
  142. return SendClientMessageEx(playerid, COLOR_GRAD2, "You can only request a name change every two minutes.");
  143. }
  144. ShowPlayerDialogEx(playerid, DIALOG_NAMECHANGE, DIALOG_STYLE_INPUT, "Name Change","Please enter your new desired name!\n\nNote: Name Changes are free for your faction.", "Change", "Back");
  145. }
  146. }
  147. }
  148. }
  149. case DIALOG_ORDER_HMAWPS:
  150. {
  151. if(!response) {
  152. format(szMiscArray, sizeof(szMiscArray), "Health and Armour\t\t $2000\nWeapons\nUniform\nName Change");
  153. ShowPlayerDialogEx(playerid, DIALOG_ORDER_HMA1, DIALOG_STYLE_LIST, "HMA Order Weapons", szMiscArray, "Order", "Cancel");
  154. }
  155. else {
  156. switch(listitem) {
  157. case 0: { // tear gas - $5000
  158. if(GetPlayerCash(playerid) >= 5000) {
  159. GivePlayerValidWeapon(playerid, 17);
  160. GivePlayerCash(playerid, - 5000);
  161. }
  162. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  163. }
  164. case 1: { // knife - $12000
  165. if(GetPlayerCash(playerid) >= 12000) {
  166. GivePlayerValidWeapon(playerid, 4);
  167. GivePlayerCash(playerid, - 12000);
  168. }
  169. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  170. }
  171. case 2: {// baton - $5000
  172. if(GetPlayerCash(playerid) >= 5000) {
  173. GivePlayerValidWeapon(playerid, 3);
  174. GivePlayerCash(playerid, - 5000);
  175. }
  176. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  177. }
  178. case 3: { // Spraycan - $4500
  179. if(GetPlayerCash(playerid) >= 4500) {
  180. GivePlayerValidWeapon(playerid, 41);
  181. GivePlayerCash(playerid, - 4500);
  182. }
  183. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  184. }
  185. case 4: { // Colt.45 - $5000
  186. if(GetPlayerCash(playerid) >= 5000) {
  187. GivePlayerValidWeapon(playerid, 22);
  188. GivePlayerCash(playerid, - 5000);
  189. }
  190. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  191. }
  192. case 5: { // SD Pistol - $7500
  193. if(GetPlayerCash(playerid) >= 7500) {
  194. GivePlayerValidWeapon(playerid, 23);
  195. GivePlayerCash(playerid, - 7500);
  196. }
  197. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  198. }
  199. case 6: { // Deagle - $12000
  200. if(GetPlayerCash(playerid) >= 12000) {
  201. GivePlayerValidWeapon(playerid, 24);
  202. GivePlayerCash(playerid, - 12000);
  203. }
  204. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  205. }
  206. case 7: { // MP5 - $17500
  207. if(GetPlayerCash(playerid) >= 17500) {
  208. GivePlayerValidWeapon(playerid, 29);
  209. GivePlayerCash(playerid, - 17500);
  210. }
  211. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  212. }
  213. case 8: { // UZI - $17500
  214. if(GetPlayerCash(playerid) >= 17500) {
  215. GivePlayerValidWeapon(playerid, 28);
  216. GivePlayerCash(playerid, - 17500);
  217. }
  218. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  219. }
  220. case 9: { // TEC9 - $17500
  221. if(GetPlayerCash(playerid) >= 17500) {
  222. GivePlayerValidWeapon(playerid, 32);
  223. GivePlayerCash(playerid, - 17500);
  224. }
  225. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  226. }
  227. case 10: { // Shotgun - $11000
  228. if(GetPlayerCash(playerid) >= 11000) {
  229. GivePlayerValidWeapon(playerid, 25);
  230. GivePlayerCash(playerid, - 11000);
  231. }
  232. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  233. }
  234. case 11: { // SPAS - $90000
  235. if(GetPlayerCash(playerid) >= 90000) {
  236. GivePlayerValidWeapon(playerid, 27);
  237. GivePlayerCash(playerid, - 90000);
  238. }
  239. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  240. }
  241. case 12: { // AK47 - $35000
  242. if(GetPlayerCash(playerid) >= 35000) {
  243. GivePlayerValidWeapon(playerid, 30);
  244. GivePlayerCash(playerid, - 35000);
  245. }
  246. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  247. }
  248. case 13: { // M4 - $70000
  249. if(GetPlayerCash(playerid) >= 70000) {
  250. GivePlayerValidWeapon(playerid, 31);
  251. GivePlayerCash(playerid, - 70000);
  252. }
  253. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  254. }
  255. case 14: { // Rifle - $10000
  256. if(GetPlayerCash(playerid) >= 10000) {
  257. GivePlayerValidWeapon(playerid, 33);
  258. GivePlayerCash(playerid, - 10000);
  259. }
  260. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  261. }
  262. case 15: { // Sniper - $65000
  263. if(GetPlayerCash(playerid) >= 65000) {
  264. GivePlayerValidWeapon(playerid, 34);
  265. GivePlayerCash(playerid, - 65000);
  266. }
  267. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  268. }
  269. case 16: { // Chainsaws - $20000
  270. if(GetPlayerCash(playerid) >= 20000) {
  271. GivePlayerValidWeapon(playerid, 9);
  272. GivePlayerCash(playerid, - 20000);
  273. }
  274. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  275. }
  276. case 17: { // C4s - $50000
  277. if(GetPlayerCash(playerid) >= 20000) {
  278. PlayerInfo[playerid][pC4Get] = 1;
  279. PlayerInfo[playerid][pBombs]++;
  280. GivePlayerCash(playerid, -50000);
  281. SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased one block of C4!");
  282. }
  283. else SendClientMessageEx(playerid, COLOR_GRAD2, MSG_NOMONEY);
  284. }
  285. }
  286. }
  287. }
  288. case DIALOG_ORDER_HMASKIN:
  289. {
  290. if(response) {
  291. new skin = strval(inputtext);
  292. if(IsInvalidSkin(skin)) {
  293. return ShowPlayerDialogEx(playerid, DIALOG_ORDER_HMASKIN, DIALOG_STYLE_INPUT, "Uniform","Invalid skin specified. Choose another.", "Select", "Cancel");
  294. }
  295. PlayerInfo[playerid][pModel] = skin;
  296. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  297. }
  298. else {
  299. format(szMiscArray, sizeof(szMiscArray), "Health and Armour\t\t $2000\nWeapons\nUniform\nName Change");
  300. ShowPlayerDialogEx(playerid, DIALOG_ORDER_HMA1, DIALOG_STYLE_LIST, "HMA Order Weapons", szMiscArray, "Order", "Cancel");
  301. }
  302. }
  303. }
  304. return 0;
  305. }
  306. CMD:contracts(playerid, params[])
  307. {
  308. if(IsAHitman(playerid) || PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  309. {
  310. SearchingHit(playerid);
  311. }
  312. return 1;
  313. }
  314. CMD:order(playerid, params[])
  315. {
  316. if (IsAHitman(playerid))
  317. {
  318. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot do this right now.");
  319. if(IsPlayerInRangeOfPoint(playerid, 4.0, 63.973995, 1973.618774, -68.786064) || IsPlayerInRangeOfPoint(playerid, 6.0, 1415.727905, -1299.371093, 15.054657))
  320. {
  321. 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!");
  322. new string[128];
  323. format(string, sizeof(string), "Health and Armour\t\t $2000\nWeapons\nUniform\nName Change");
  324. ShowPlayerDialogEx(playerid, DIALOG_ORDER_HMA1, DIALOG_STYLE_LIST, "HMA Order Weapons", string, "Order", "Cancel");
  325. }
  326. else
  327. {
  328. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not at the gun shack!");
  329. return 1;
  330. }
  331. }
  332. else
  333. {
  334. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a member of the hitman agency!");
  335. return 1;
  336. }
  337. return 1;
  338. }
  339. CMD:hbadge(playerid, params[])
  340. {
  341. #if defined zombiemode
  342. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't use this.");
  343. #endif
  344. if (IsAHitman(playerid))
  345. {
  346. new giveplayerid = 1;
  347. if(sscanf(params, "d", giveplayerid)) {
  348. SendClientMessageEx(playerid, COLOR_GREY, "Type /hbadge 0 to reset");
  349. }
  350. if(giveplayerid == 0)
  351. {
  352. DeletePVar(playerid, "HitmanBadgeColour");
  353. SendClientMessageEx(playerid, COLOR_WHITE, "You have set your badge back to normal.");
  354. SetPlayerColor(playerid,TEAM_HIT_COLOR);
  355. }
  356. else
  357. {
  358. Group_ListGroups(playerid, DIALOG_HBADGE);
  359. }
  360. }
  361. return 1;
  362. }
  363. CMD:execute(playerid, params[])
  364. {
  365. if(IsAHitman(playerid))
  366. {
  367. if(GoChase[playerid] != INVALID_PLAYER_ID || HitToGet[playerid] != INVALID_PLAYER_ID) {
  368. if(GetPVarInt(playerid, "KillShotCooldown") != 0 && gettime() < GetPVarInt(playerid, "KillShotCooldown") + 300) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must wait 5 minutes between execution shots.");
  369. SetPVarInt(playerid, "ExecutionMode", 1);
  370. SendClientMessageEx(playerid, COLOR_GRAD2, " You have loaded a Hollow point round. Aim for the Head when executing your target. ");
  371. SetPVarInt(playerid, "KillShotCooldown", gettime());
  372. }
  373. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have an active contract!");
  374. }
  375. return 1;
  376. }
  377. CMD:resetheadshot(playerid, params[])
  378. {
  379. if(PlayerInfo[playerid][pAdmin] >= 1337)
  380. {
  381. return SetPVarInt(playerid, "KillShotCooldown", gettime()-300);
  382. }
  383. return 1;
  384. }
  385. CMD:profile(playerid, params[])
  386. {
  387. if(IsAHitman(playerid))
  388. {
  389. new string[600], giveplayerid;
  390. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /profile [player]");
  391. if(IsPlayerConnected(giveplayerid))
  392. {
  393. new str2[64];
  394. if(0 <= PlayerInfo[giveplayerid][pMember] < MAX_GROUPS)
  395. {
  396. format(str2, sizeof(str2), "%s", arrGroupData[PlayerInfo[giveplayerid][pMember]][g_szGroupName]);
  397. }
  398. else str2 = "None";
  399. format(string, sizeof(string),
  400. "{FF6347}Name: {BFC0C2}%s\n\
  401. {FF6347}Date of Birth: {BFC0C2}%s\n\
  402. {FF6347}Phone Number: {BFC0C2}%d\n\n\
  403. {FF6347}Organization: {BFC0C2}%s\n\
  404. {FF6347}Bounty: {BFC0C2}$%d\n\
  405. {FF6347}Bounty Reason: {BFC0C2}%s", GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pBirthDate], PlayerInfo[giveplayerid][pPnumber], str2, PlayerInfo[giveplayerid][pHeadValue], PlayerInfo[giveplayerid][pContractDetail]);
  406. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, "Target Profile", string, "OK", "");
  407. }
  408. }
  409. return 1;
  410. }
  411. CMD:ranks(playerid, params[])
  412. {
  413. if ((!IsAHitman(playerid)) && PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not a Member of the Hitman Agency!");
  414. SendClientMessageEx(playerid, COLOR_WHITE, "|__________________ Agency's Ranks __________________|");
  415. new string[128];
  416. foreach(new i: Player)
  417. {
  418. if((IsAHitman(i)))
  419. {
  420. if( GoChase[playerid] == INVALID_PLAYER_ID )
  421. {
  422. format(string, sizeof(string), "* Name: %s | Rank %d | Completed Hits: %d | Failed Hits: %d", GetPlayerNameEx(i),PlayerInfo[i][pRank], PlayerInfo[i][pCHits], PlayerInfo[i][pFHits]);
  423. SendClientMessageEx(playerid, COLOR_GREY, string);
  424. }
  425. else
  426. {
  427. format(string, sizeof(string), "* Name: %s | Rank %d | Completed Hits: %d | Failed Hits: %d | Chasing: %s", GetPlayerNameEx(i),PlayerInfo[i][pRank], PlayerInfo[i][pCHits], PlayerInfo[i][pFHits], GetPlayerNameEx(GoChase[i]));
  428. SendClientMessageEx(playerid, COLOR_GREY, string);
  429. }
  430. }
  431. }
  432. return 1;
  433. }
  434. CMD:plantcarbomb(playerid, params[]) {
  435. return cmd_pcb(playerid, params);
  436. }
  437. CMD:pcb(playerid, params[])
  438. {
  439. if (IsAHitman(playerid))
  440. {
  441. if (PlayerInfo[playerid][pC4] == 0)
  442. {
  443. if (PlayerInfo[playerid][pBombs] != 0)
  444. {
  445. new carid = GetPlayerVehicleID(playerid);
  446. new closestcar = GetClosestCar(playerid, carid);
  447. if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0))
  448. {
  449. if(VehicleBomb{closestcar} == 1)
  450. {
  451. SendClientMessageEx(playerid, COLOR_GRAD2, "There is already a C4 on the vehicle engine!");
  452. return 1;
  453. }
  454. VehicleBomb{closestcar} = 1;
  455. PlacedVehicleBomb[playerid] = closestcar;
  456. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
  457. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
  458. SendClientMessageEx(playerid, COLOR_GREEN, "You have placed C4 on the vehicle engine, /pickupbomb to remove it.");
  459. PlayerInfo[playerid][pC4] = 1;
  460. PlayerInfo[playerid][pBombs]--;
  461. PlayerInfo[playerid][pC4Used] = 2;
  462. }
  463. else
  464. {
  465. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not close enough to any vehicle!");
  466. return 1;
  467. }
  468. }
  469. else
  470. {
  471. SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have C4!");
  472. return 1;
  473. }
  474. }
  475. else
  476. {
  477. SendClientMessageEx(playerid, COLOR_GRAD2, " You can only deploy 1 C4 at a time ! ");
  478. return 1;
  479. }
  480. }
  481. else
  482. {
  483. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a member of the Hitman Agency ! ");
  484. }
  485. return 1;
  486. }
  487. CMD:plantbomb(playerid, params[]) {
  488. return cmd_pb(playerid, params);
  489. }
  490. CMD:pb(playerid, params[])
  491. {
  492. if (IsAHitman(playerid))
  493. {
  494. if (PlayerInfo[playerid][pC4] == 0)
  495. {
  496. if (PlayerInfo[playerid][pBombs] != 0)
  497. {
  498. if(IsPlayerInAnyVehicle(playerid))
  499. {
  500. SendClientMessageEx(playerid, COLOR_LIGHTRED,"You can't plant C4 while in a vehicle!");
  501. return 1;
  502. }
  503. GetPlayerPos(playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
  504. SetPVarFloat(playerid, "DYN_C4_FLOAT_X", Positions[0][0]);
  505. SetPVarFloat(playerid, "DYN_C4_FLOAT_Y", Positions[0][1]);
  506. SetPVarFloat(playerid, "DYN_C4_FLOAT_Z", Positions[0][2]);
  507. new models[9] = {1654, 1230, 1778, 2814, 1271, 1328, 2919, 2770, 1840};
  508. ShowModelSelectionMenuEx(playerid, models, sizeof(models), "Bomb Model Selector", 1338, 0.0, 0.0, 180.0);
  509. }
  510. else
  511. {
  512. SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have C4!");
  513. return 1;
  514. }
  515. }
  516. else
  517. {
  518. SendClientMessageEx(playerid, COLOR_GRAD2, "You can only deploy 1 C4 at a time!");
  519. return 1;
  520. }
  521. }
  522. else
  523. {
  524. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a member of the Hitman Agency!");
  525. }
  526. return 1;
  527. }
  528. CMD:pub(playerid, params[]) {
  529. return cmd_pickupbomb(playerid, params);
  530. }
  531. CMD:pickupbomb(playerid, params[])
  532. {
  533. if (!IsAHitman(playerid))
  534. {
  535. SendClientMessageEx(playerid, COLOR_GREY, "You are not a Hitman!");
  536. return 1;
  537. }
  538. if (PlayerInfo[playerid][pC4] == 0)
  539. {
  540. SendClientMessageEx(playerid, COLOR_GREY, "You haven't planted a bomb!");
  541. return 1;
  542. }
  543. new carid = GetPlayerVehicleID(playerid);
  544. new closestcar = GetClosestCar(playerid, carid);
  545. if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0) && VehicleBomb{closestcar} == 1)
  546. {
  547. VehicleBomb{closestcar} = 0;
  548. PlacedVehicleBomb[playerid] = INVALID_VEHICLE_ID;
  549. PickUpC4(playerid);
  550. SendClientMessageEx(playerid, COLOR_GREEN, "Bomb picked up successfully.");
  551. PlayerInfo[playerid][pBombs]++;
  552. PlayerInfo[playerid][pC4Used] = 0;
  553. PlayerInfo[playerid][pC4Get] = 1;
  554. return 1;
  555. }
  556. if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
  557. {
  558. PickUpC4(playerid);
  559. SendClientMessageEx(playerid, COLOR_GREEN, "Bomb picked up successfully.");
  560. PlayerInfo[playerid][pBombs]++;
  561. PlayerInfo[playerid][pC4Used] = 0;
  562. PlayerInfo[playerid][pC4Get] = 1;
  563. return 1;
  564. }
  565. return 1;
  566. }
  567. CMD:myc4(playerid, params[])
  568. {
  569. if (IsAHitman(playerid))
  570. {
  571. new string[128];
  572. if (PlayerInfo[playerid][pBombs] > 0)
  573. {
  574. format(string, sizeof(string), "You currently have %i C4 in your inventory.", PlayerInfo[playerid][pBombs]);
  575. }
  576. else
  577. {
  578. format(string, sizeof(string), "You do not have any C4 in your inventory.");
  579. }
  580. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  581. }
  582. return 1;
  583. }
  584. CMD:setmylevel(playerid, params[])
  585. {
  586. if (!IsAHitman(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command.");
  587. new level;
  588. if(sscanf(params, "d", level)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setmylevel [level]");
  589. if(PlayerInfo[playerid][pLevel] < level) return SendClientMessageEx(playerid, COLOR_GREY, "The new level can't be greater than your current level.");
  590. DeletePVar(playerid, "TempLevel");
  591. SetPVarInt(playerid, "TempLevel", level);
  592. SetPlayerScore(playerid, level);
  593. format(szMiscArray, sizeof(szMiscArray), "You have set your level to %d", level);
  594. return SendClientMessage(playerid, COLOR_LIGHTRED, szMiscArray);
  595. }
  596. CMD:givehit(playerid, params[])
  597. {
  598. if (IsAHitman(playerid))
  599. {
  600. if(PlayerInfo[playerid][pRank] < 5)
  601. {
  602. SendClientMessageEx(playerid, COLOR_GREY, " Only ranks 5 and above can assign contracts to people !");
  603. return 1;
  604. }
  605. new string[128], giveplayerid, targetid;
  606. if(sscanf(params, "uu", giveplayerid, targetid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givehit [player] [targetid]");
  607. if(IsPlayerConnected(giveplayerid))
  608. {
  609. if(!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player is not near you.");
  610. if(giveplayerid == targetid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot issue hits to the target.");
  611. if(GoChase[giveplayerid] != INVALID_PLAYER_ID)
  612. {
  613. SendClientMessageEx(playerid, COLOR_GREY, " That Hitman is already busy with a Contract!");
  614. return 1;
  615. }
  616. if(GotHit[targetid] == 1)
  617. {
  618. SendClientMessageEx(playerid, COLOR_GREY, " Another hitman has already assigned this target!");
  619. return 1;
  620. }
  621. if(IsPlayerConnected(targetid))
  622. {
  623. if(PlayerInfo[targetid][pHeadValue] == 0)
  624. {
  625. SendClientMessageEx(playerid, COLOR_GREY, " That target doesn't have a contract on them!");
  626. return 1;
  627. }
  628. format(string, sizeof(string), "* You offered %s a contract to kill %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(targetid));
  629. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  630. format(string, sizeof(string), "* Hitman %s has offered you a contract to kill %s (type /accept contract), to accept it.", GetPlayerNameEx(playerid), GetPlayerNameEx(targetid));
  631. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  632. HitOffer[giveplayerid] = playerid;
  633. HitToGet[giveplayerid] = targetid;
  634. return 1;
  635. }
  636. else
  637. {
  638. SendClientMessageEx(playerid, COLOR_GREY, " The contracted person is offline, use /contracts!");
  639. return 1;
  640. }
  641. }
  642. else
  643. {
  644. SendClientMessageEx(playerid, COLOR_GREY, " That Hitman is not Online!");
  645. return 1;
  646. }
  647. }
  648. return 1;
  649. }
  650. CMD:givemehit(playerid, params[])
  651. {
  652. if (IsAHitman(playerid))
  653. {
  654. new string[128], targetid;
  655. if(sscanf(params, "u", targetid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givemehit [targetid]");
  656. if(IsPlayerConnected(targetid))
  657. {
  658. if(GoChase[playerid] != INVALID_PLAYER_ID)
  659. {
  660. SendClientMessageEx(playerid, COLOR_GREY, " You are already busy with another contract!");
  661. return 1;
  662. }
  663. if(GotHit[targetid] == 1)
  664. {
  665. SendClientMessageEx(playerid, COLOR_GREY, " Another hitman has already assigned this target!");
  666. return 1;
  667. }
  668. if(PlayerInfo[targetid][pHeadValue] == 0)
  669. {
  670. SendClientMessageEx(playerid, COLOR_GREY, " That target doesn't have a contract on them!");
  671. return 1;
  672. }
  673. format(string, sizeof(string), "* You have offered yourself a contract to kill %s. (type /accept contract)", GetPlayerNameEx(targetid));
  674. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  675. HitOffer[playerid] = playerid;
  676. HitToGet[playerid] = targetid;
  677. return 1;
  678. }
  679. else
  680. {
  681. SendClientMessageEx(playerid, COLOR_GREY, " The contracted person is offline, use /contracts!");
  682. return 1;
  683. }
  684. }
  685. return 1;
  686. }
  687. CMD:deletehit(playerid, params[])
  688. {
  689. if( PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || (arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == GROUP_TYPE_CONTRACT && PlayerInfo[playerid][pRank] >= 5) || arrGroupData[PlayerInfo[playerid][pLeader]][g_iGroupType] == GROUP_TYPE_CONTRACT )
  690. {
  691. new string[128], giveplayerid;
  692. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /deletehit [player]");
  693. if(!IsPlayerConnected(giveplayerid))
  694. {
  695. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  696. return 1;
  697. }
  698. if(PlayerInfo[giveplayerid][pHeadValue] >= 1 )
  699. {
  700. PlayerInfo[giveplayerid][pHeadValue] = 0;
  701. format(string, sizeof(string), "<< %s(%d) has removed the contract on %s(%d) >>", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  702. Log("logs/contracts.log", string);
  703. format(string, sizeof(string), "You have removed the contract which was on %s's head.", GetPlayerNameEx(giveplayerid) );
  704. SendClientMessageEx(playerid, COLOR_WHITE, string);
  705. GoChase[giveplayerid] = INVALID_PLAYER_ID;
  706. foreach(new i: Player)
  707. {
  708. if( HitToGet[i] == giveplayerid )
  709. {
  710. HitToGet[i] = INVALID_PLAYER_ID;
  711. HitOffer[i] = INVALID_PLAYER_ID;
  712. }
  713. }
  714. }
  715. else
  716. {
  717. SendClientMessageEx( playerid, COLOR_WHITE, "There's not an active contract on that player!" );
  718. }
  719. }
  720. return 1;
  721. }
  722. CMD:contract(playerid, params[])
  723. {
  724. if(PlayerCuffed[playerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't place contracts while in cuffs.");
  725. if(PlayerInfo[playerid][pJailTime] > 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't place contracts while in jail.");
  726. new string[128], giveplayerid, moneys, detail[32];
  727. if(sscanf(params, "uds[32]", giveplayerid, moneys, detail))
  728. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /contract [player] [amount] [details]");
  729. if (IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)
  730. {
  731. if(giveplayerid == playerid)
  732. return SendClientMessageEx(playerid, COLOR_GREY, "You can't contract yourself.");
  733. if(PlayerInfo[playerid][pLevel] < 3 || PlayerInfo[giveplayerid][pLevel] < 3)
  734. return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot place a contract unless both you and the hit are at least level 3.");
  735. if(moneys < 50000 || moneys > 3000000)
  736. return SendClientMessageEx(playerid, COLOR_GREY, "You can't place contracts that are less than $50,000 or more than $3,000,000.");
  737. if((moneys < 50000 || moneys > 3000000) && IsACop(giveplayerid))
  738. return SendClientMessageEx(playerid, COLOR_GREY, "The minimum hit amount for a law enforcement officer is $150,000.");
  739. if(PlayerInfo[playerid][pMember] != INVALID_GROUP_ID && arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == GROUP_TYPE_CONTRACT)
  740. return SendClientMessageEx(playerid, COLOR_GREY, "You cannot do this to that person.");
  741. if(PlayerInfo[giveplayerid][pHeadValue] >= 3000000 || moneys + PlayerInfo[giveplayerid][pHeadValue] > 3000000)
  742. return SendClientMessageEx(playerid, COLOR_GREY, "That person has the maximum on their head.");
  743. if(PlayerInfo[playerid][pJailTime] > 0 || PlayerCuffed[playerid] > 0)
  744. return SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now");
  745. if (moneys > 0 && GetPlayerCash(playerid) >= moneys)
  746. {
  747. if(strlen(detail) > 32) return SendClientMessageEx(playerid, COLOR_GRAD1, "Contract details may not be longer than 32 characters in length.");
  748. GivePlayerCash(playerid, (0 - moneys));
  749. PlayerInfo[giveplayerid][pHeadValue] += moneys;
  750. strmid(PlayerInfo[giveplayerid][pContractBy], GetPlayerNameEx(playerid), 0, strlen(GetPlayerNameEx(playerid)), MAX_PLAYER_NAME);
  751. strmid(PlayerInfo[giveplayerid][pContractDetail], detail, 0, strlen(detail), 32);
  752. format(string, sizeof(string), "%s has placed a contract on %s for $%s, details: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), number_format(moneys), detail);
  753. SendGroupMessage(GROUP_TYPE_CONTRACT, COLOR_YELLOW, string);
  754. format(string, sizeof(string), "* You placed a contract on %s for $%s, details: %s", GetPlayerNameEx(giveplayerid), number_format(moneys), detail);
  755. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  756. format(string, sizeof(string), "<< %s has placed a contract on %s for $%s, details: %s >>", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), number_format(moneys), detail);
  757. Log("logs/contracts.log", string);
  758. format(string, sizeof(string), "%s has placed a contract on %s for $%s, details: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), number_format(moneys), detail);
  759. ABroadCast(COLOR_YELLOW, string, 2);
  760. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  761. }
  762. else
  763. {
  764. SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have enough money for this.");
  765. }
  766. }
  767. else
  768. {
  769. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  770. }
  771. return 1;
  772. }
  773. CMD:knife(playerid, params[])
  774. {
  775. if(IsAHitman(playerid)) {
  776. if(GetPVarInt(playerid, "HidingKnife") == 1) {
  777. GivePlayerValidWeapon(playerid, 4);
  778. DeletePVar(playerid, "HidingKnife");
  779. SendClientMessageEx(playerid, COLOR_YELLOW, "You have pulled out your knife.");
  780. }
  781. else {
  782. if(PlayerInfo[playerid][pGuns][1] == WEAPON_KNIFE) {
  783. RemovePlayerWeapon(playerid, 4); // Remove Knife
  784. SetPVarInt(playerid, "HidingKnife", 1);
  785. SendClientMessageEx(playerid, COLOR_YELLOW, "You have hidden your knife.");
  786. }
  787. else {
  788. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have a knife available.");
  789. }
  790. }
  791. }
  792. return 1;
  793. }