prisonsystem.pwn 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Prison System
  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. DocIsolate(playerid, cellid)
  35. {
  36. SetPlayerPos(playerid, DocIsolation[cellid][0], DocIsolation[cellid][1], DocIsolation[cellid][2]);
  37. SetPlayerFacingAngle(playerid, 0);
  38. SetPlayerInterior(playerid, 1);
  39. Player_StreamPrep(playerid, DocIsolation[cellid][0], DocIsolation[cellid][1], DocIsolation[cellid][2], FREEZE_TIME);
  40. PlayerInfo[playerid][pIsolated] = cellid + 1;
  41. }
  42. ListDetainees(playerid)
  43. {
  44. new szPrisoners[1028],
  45. iCount = 0,
  46. temp[4];
  47. foreach(Player, i)
  48. {
  49. if(GetPVarInt(i, "ArrestPoint") == GetArrestPointID(playerid) + 1)
  50. {
  51. strcat(szPrisoners, "{3333CC}Prisoner:{FFFFFF}");
  52. strcat(szPrisoners, "(");
  53. valstr(temp, i);
  54. strcat(szPrisoners, temp);
  55. strcat(szPrisoners, ")");
  56. strcat(szPrisoners, GetPlayerNameEx(i));
  57. strcat(szPrisoners, "\n");
  58. iCount++;
  59. }
  60. }
  61. if(iCount == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "No prisoners at this arrest point.");
  62. return ShowPlayerDialogEx(playerid, DIALOG_LOAD_DETAINEES, DIALOG_STYLE_LIST, "Detainees List", szPrisoners, "Load", "Cancel");
  63. }
  64. LoadPrisoner(iLoadingID, iPrisonerID, iVehicleID, iVehicleSeat, iNewVW, iNewIW)
  65. {
  66. SetPlayerVirtualWorld(iPrisonerID, iNewVW);
  67. PlayerInfo[iPrisonerID][pVW] = iNewVW;
  68. SetPlayerInterior(iPrisonerID, iNewIW);
  69. PlayerInfo[iPrisonerID][pInt] = iNewIW;
  70. PutPlayerInVehicle(iPrisonerID, iVehicleID, iVehicleSeat);
  71. TogglePlayerControllable(iPrisonerID, 0);
  72. DeletePVar(iPrisonerID, "ArrestPoint");
  73. SendClientMessageEx(iPrisonerID, COLOR_LIGHTBLUE, "You have been loaded into a prisoner transport bus by and will be transported to DOC");
  74. ListDetainees(iLoadingID);
  75. }
  76. ShowDocPrisonControls(playerid, icontrolid)
  77. {
  78. szMiscArray[0] = 0;
  79. switch(icontrolid)
  80. {
  81. case 0:
  82. {
  83. // main dialog
  84. format(szMiscArray, sizeof(szMiscArray), "Cell-block A\nIsolation Cells\nArea Doors\nLockdown");
  85. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Cancel");
  86. }
  87. case 1:
  88. {
  89. // sub-dialog
  90. format(szMiscArray, sizeof(szMiscArray), "Floor 1\nFloor 2\nAll Floor 1\nAll Floor 2");
  91. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_SUB, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  92. }
  93. case 2:
  94. {
  95. // floor 1
  96. format(szMiscArray, sizeof(szMiscArray), "Cell 1 (%s)\n\
  97. Cell 2 (%s)\n\
  98. Cell 3 (%s)\n\
  99. Cell 4 (%s)\n\
  100. Cell 5 (%s)\n\
  101. Cell 6 (%s)\n\
  102. Cell 7 (%s)\n\
  103. Cell 8 (%s)\n\
  104. Cell 9 (%s)\n\
  105. Cell 10 (%s)\n\
  106. Cell 11 (%s)\n\
  107. Cell 12 (%s)\n\
  108. Cell 13 (%s)\n\
  109. Cell 14 (%s)\n\
  110. Cell 15 (%s)\n\
  111. Cell 16 (%s)",
  112. ((bDocCellOpen[0] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  113. ((bDocCellOpen[1] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  114. ((bDocCellOpen[2] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  115. ((bDocCellOpen[3] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  116. ((bDocCellOpen[4] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  117. ((bDocCellOpen[5] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  118. ((bDocCellOpen[6] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  119. ((bDocCellOpen[7] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  120. ((bDocCellOpen[8] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  121. ((bDocCellOpen[9] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  122. ((bDocCellOpen[10] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  123. ((bDocCellOpen[11] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  124. ((bDocCellOpen[12] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  125. ((bDocCellOpen[13] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  126. ((bDocCellOpen[14] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  127. ((bDocCellOpen[15] == false) ? ("{FF0000}Closed"):("{00FF00}Open"))
  128. );
  129. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_C1F1, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  130. }
  131. case 3:
  132. {
  133. // floor 2
  134. format(szMiscArray, sizeof(szMiscArray), "Cell 1 (%s)\n\
  135. Cell 2 (%s)\n\
  136. Cell 3 (%s)\n\
  137. Cell 4 (%s)\n\
  138. Cell 5 (%s)\n\
  139. Cell 6 (%s)\n\
  140. Cell 7 (%s)\n\
  141. Cell 8 (%s)\n\
  142. Cell 9 (%s)\n\
  143. Cell 10 (%s)\n\
  144. Cell 11 (%s)\n\
  145. Cell 12 (%s)\n\
  146. Cell 13 (%s)\n\
  147. Cell 14 (%s)\n\
  148. Cell 15 (%s)",
  149. ((bDocCellOpen[16] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  150. ((bDocCellOpen[17] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  151. ((bDocCellOpen[18] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  152. ((bDocCellOpen[19] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  153. ((bDocCellOpen[20] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  154. ((bDocCellOpen[21] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  155. ((bDocCellOpen[22] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  156. ((bDocCellOpen[23] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  157. ((bDocCellOpen[24] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  158. ((bDocCellOpen[25] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  159. ((bDocCellOpen[26] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  160. ((bDocCellOpen[27] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  161. ((bDocCellOpen[28] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  162. ((bDocCellOpen[29] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  163. ((bDocCellOpen[30] == false) ? ("{FF0000}Closed"):("{00FF00}Open"))
  164. );
  165. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_C1F2, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  166. }
  167. case 4:
  168. {
  169. // area controls
  170. format(szMiscArray, sizeof(szMiscArray), "Cell-block 1(%s)\n\
  171. Cell-block 2 (%s)\n\
  172. Showers (%s)\n\
  173. Cafe 1 (%s)\n\
  174. Cafe 2 (%s)\n\
  175. Laundry Room (%s)\n\
  176. Isolation Block (%s)\n\
  177. Control Room (%s)\n\
  178. Processing 1 (%s)\n\
  179. Processing 2 (%s)\n\
  180. Processing 3 (%s)\n\
  181. Classroom (%s)\n\
  182. Janitor's Closet (%s)\n\
  183. Medical Ward (%s)\n\
  184. Hallway(%s)\n\
  185. Lobby 1 (%s)\n\
  186. Lobby 2 (%s)\n\
  187. Visitation (%s)",
  188. ((bDocAreaOpen[0] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  189. ((bDocAreaOpen[1] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  190. ((bDocAreaOpen[2] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  191. ((bDocAreaOpen[3] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  192. ((bDocAreaOpen[4] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  193. ((bDocAreaOpen[5] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  194. ((bDocAreaOpen[6] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  195. ((bDocAreaOpen[7] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  196. ((bDocAreaOpen[8] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  197. ((bDocAreaOpen[9] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  198. ((bDocAreaOpen[10] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  199. ((bDocAreaOpen[11] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  200. ((bDocAreaOpen[12] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  201. ((bDocAreaOpen[13] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  202. ((bDocAreaOpen[14] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  203. ((bDocAreaOpen[15] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  204. ((bDocAreaOpen[16] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  205. ((bDocAreaOpen[17] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  206. ((bDocAreaOpen[18] == false) ? ("{FF0000}Closed"):("{00FF00}Open"))
  207. );
  208. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_AREA, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  209. }
  210. }
  211. return 1;
  212. }
  213. DocLockdown(playerid)
  214. {
  215. new szWarning[128];
  216. if(bDocLockdown == false)
  217. {
  218. bDocLockdown = true;
  219. for(new i = 0; i < 31; i++)
  220. {
  221. OpenDocCells(i, 0);
  222. }
  223. for(new i = 0; i < 19; i++)
  224. {
  225. OpenDocAreaDoors(i, 0);
  226. }
  227. format( szWarning, sizeof(szWarning), "ALERT: The Easter Basin Correctional Facility is now on Lockdown for an emergency (( %s ))", GetPlayerNameEx(playerid));
  228. SendGroupMessage(GROUP_TYPE_LEA, COLOR_RED, szWarning);
  229. //PlayAudioStreamForPlayer(i, "http://sampweb.ng-gaming.net/brendan/siren.mp3", -1083.90002441,4289.70019531,7.59999990, 500, 1);
  230. }
  231. else
  232. {
  233. bDocLockdown = false;
  234. format( szWarning, sizeof(szWarning), "ALERT: The Easter Basin Correctional Facility is no longer on lockdown (( %s ))", GetPlayerNameEx(playerid));
  235. SendGroupMessage(GROUP_TYPE_LEA, COLOR_YELLOW, szWarning);
  236. //StopAudioStreamForPlayer(i);
  237. }
  238. }
  239. GetClosestPrisonPhone(playerid)
  240. {
  241. new returnval;
  242. for(new i = 0; i < 5; i++)
  243. {
  244. if(IsPlayerInRangeOfPoint(playerid, 2, JailPhonePos[i][0], JailPhonePos[i][1], JailPhonePos[i][2]))
  245. {
  246. returnval = i;
  247. break;
  248. }
  249. }
  250. return returnval;
  251. }
  252. Prison_SetPlayerSkin(playerid) {
  253. switch(PlayerInfo[playerid][pSex]) {
  254. case 1: SetPlayerSkin(playerid, 8);
  255. case 2: SetPlayerSkin(playerid, 211);
  256. }
  257. }
  258. forward OpenDocAreaDoors(doorid, open);
  259. public OpenDocAreaDoors(doorid, open)
  260. {
  261. switch(doorid)
  262. {
  263. case 0: {
  264. if(open == 0) MoveDynamicObject(DocCellRoomDoors[0], 568.36981, 1453.9955, 5999.47168, 0.9);
  265. if(open == 1) MoveDynamicObject(DocCellRoomDoors[0], 568.36981, 1455.3355, 5999.47168, 0.9);
  266. }
  267. case 1: {
  268. if(open == 0) MoveDynamicObject(DocCellRoomDoors[1], 572.8498, 1453.9955, 5999.47168, 0.9);
  269. if(open == 1) MoveDynamicObject(DocCellRoomDoors[1], 572.8498, 1455.3155, 5999.47168, 0.9);
  270. }
  271. case 2: {
  272. if(open == 0) MoveDynamicObject(DocCellRoomDoors[2], 585.77289, 1448.87915, 5999.45947, 0.9);
  273. if(open == 1) MoveDynamicObject(DocCellRoomDoors[2], 585.7729, 1447.5592, 5999.4595, 0.9);
  274. }
  275. case 3: {
  276. if(open == 0) MoveDynamicObject(DocCellRoomDoors[3], 553.98120, 1466.11426, 5999.44971, 0.9);
  277. if(open == 1) MoveDynamicObject(DocCellRoomDoors[3], 552.6612, 1466.1143, 5999.4497, 0.9);
  278. }
  279. case 4: {
  280. if(open == 0) MoveDynamicObject(DocCellRoomDoors[4], 553.98169, 1474.47205, 5999.48877, 0.9);
  281. if(open == 1) MoveDynamicObject(DocCellRoomDoors[4], 552.6617, 1474.4720, 5999.4888, 0.9);
  282. }
  283. case 5: {
  284. if(open == 0) MoveDynamicObject(DocCellRoomDoors[5], 583.51978, 1455.05212, 5999.47266, 0.9);
  285. if(open == 1) MoveDynamicObject(DocCellRoomDoors[5], 582.1798, 1455.0521, 5999.4727, 0.9);
  286. }
  287. case 6: {
  288. if(open == 0) MoveDynamicObject(DocCellRoomDoors[6], 531.66589, 1428.00647, 10999.45703, 0.9);
  289. if(open == 1) MoveDynamicObject(DocCellRoomDoors[6], 530.3259, 1428.0065, 10999.4570, 0.9);
  290. }
  291. case 7: {
  292. if(open == 0) MoveDynamicObject(DocCellRoomDoors[7], 566.54053, 1462.30774, 6003.41699, 0.9);
  293. if(open == 1) MoveDynamicObject(DocCellRoomDoors[7], 565.2205, 1462.30774, 6003.41699, 0.9);
  294. }
  295. case 8: {
  296. if(open == 0) MoveDynamicObject(DocCellRoomDoors[8], 572.98657, 1447.5975, 5999.4727, 0.9);
  297. if(open == 1) MoveDynamicObject(DocCellRoomDoors[8], 572.98657, 1449.12683, 5999.4727, 0.9);
  298. }
  299. case 9: {
  300. if(open == 0) MoveDynamicObject(DocCellRoomDoors[9], 597.01477, 1452.43774, 5999.44873 , 0.9);
  301. if(open == 1) MoveDynamicObject(DocCellRoomDoors[9], 597.0148, 1451.0177, 5999.4487, 0.9);
  302. }
  303. case 10: {
  304. if(open == 0) MoveDynamicObject(DocCellRoomDoors[10], 599.12000, 1451.45422, 5999.47754, 0.9);
  305. if(open == 1) MoveDynamicObject(DocCellRoomDoors[10], 597.7200, 1451.4742, 5999.4775, 0.9);
  306. }
  307. case 11: {
  308. if(open == 0) MoveDynamicObject(DocCellRoomDoors[11], 589.21820, 1448.87537, 5999.46826, 0.9);
  309. if(open == 1) MoveDynamicObject(DocCellRoomDoors[11], 589.2182, 1447.4754, 5999.4683, 0.9);
  310. }
  311. case 12: {
  312. if(open == 0) MoveDynamicObject(DocCellRoomDoors[12], 579.57898, 1463.63379, 5999.46143, 0.9);
  313. if(open == 1) MoveDynamicObject(DocCellRoomDoors[12], 579.5790, 1462.3338, 5999.4614, 0.9);
  314. }
  315. case 13: {
  316. if(open == 0) MoveDynamicObject(DocCellRoomDoors[13], 572.99377, 1468.63940, 5999.43994, 0.9);
  317. if(open == 1) MoveDynamicObject(DocCellRoomDoors[13], 572.9938, 1467.3394, 5999.4399, 0.9);
  318. }
  319. case 14: {
  320. if(open == 0) MoveDynamicObject(DocCellRoomDoors[14], 572.98419, 1434.65295, 5999.52295, 0.9);
  321. if(open == 1) MoveDynamicObject(DocCellRoomDoors[14], 572.9842, 1433.2330, 5999.5229, 0.9);
  322. }
  323. case 15: {
  324. if(open == 0) MoveDynamicObject(DocCellRoomDoors[15], 575.50751, 1461.82019, 5999.47168, 0.9);
  325. if(open == 1) MoveDynamicObject(DocCellRoomDoors[15], 574.1475, 1461.82019, 5999.47168, 0.9);
  326. }
  327. case 16: {
  328. if(open == 0) MoveDynamicObject(DocCellRoomDoors[16], 526.92139, 1414.63281, 10999.45703, 0.9);
  329. if(open == 1) MoveDynamicObject(DocCellRoomDoors[16], 526.92139, 1415.9528, 10999.45703, 0.9);
  330. }
  331. case 17: {
  332. if(open == 0) MoveDynamicObject(DocCellRoomDoors[17], 529.96143, 1414.63281, 10999.45703, 0.9);
  333. if(open == 1) MoveDynamicObject(DocCellRoomDoors[17], 529.96143, 1415.9528, 10999.45703, 0.9);
  334. }
  335. case 18: {
  336. if(open == 0) MoveDynamicObject(DocCellRoomDoors[18], 542.2069, 1417.86682, 10999.45703, 0.9);
  337. if(open == 1) MoveDynamicObject(DocCellRoomDoors[18], 542.2069, 1416.5468, 10999.45703, 0.9);
  338. }
  339. }
  340. if(open == 0) bDocAreaOpen[doorid] = false;
  341. else if(open == 1) bDocAreaOpen[doorid] = true;
  342. }
  343. OpenDocCells(cellid, open)
  344. {
  345. switch(cellid)
  346. {
  347. case 0:
  348. {
  349. if(open == 0) MoveDynamicObject(DocCellsFloor1[0], 567.21069, 1445.88171, 6000.74609, 0.9);
  350. if(open == 1) MoveDynamicObject(DocCellsFloor1[0], 567.21069 - 1.58, 1445.88171, 6000.74609, 0.9);
  351. }
  352. case 1:
  353. {
  354. if(open == 0) MoveDynamicObject(DocCellsFloor1[1], 563.58539, 1445.88171, 6000.74609, 0.9);
  355. if(open == 1) MoveDynamicObject(DocCellsFloor1[1], 563.58539 - 1.58, 1445.88171, 6000.74609, 0.9);
  356. }
  357. case 2:
  358. {
  359. if(open == 0) MoveDynamicObject(DocCellsFloor1[2], 559.87738, 1445.88171, 6000.74609, 0.9);
  360. if(open == 1) MoveDynamicObject(DocCellsFloor1[2], 559.87738 - 1.58, 1445.88171, 6000.74609, 0.9);
  361. }
  362. case 3:
  363. {
  364. if(open == 0) MoveDynamicObject(DocCellsFloor1[3], 556.21832, 1445.88171, 6000.74609, 0.9);
  365. if(open == 1) MoveDynamicObject(DocCellsFloor1[3], 556.21832 - 1.58, 1445.88171, 6000.74609, 0.9);
  366. }
  367. case 4:
  368. {
  369. if(open == 0) MoveDynamicObject(DocCellsFloor1[4], 552.55121, 1445.88171, 6000.74609, 0.9);
  370. if(open == 1) MoveDynamicObject(DocCellsFloor1[4], 552.55121 - 1.58, 1445.88171, 6000.74609, 0.9);
  371. }
  372. case 5:
  373. {
  374. if(open == 0) MoveDynamicObject(DocCellsFloor1[5], 548.86353, 1445.88171, 6000.74609, 0.9);
  375. if(open == 1) MoveDynamicObject(DocCellsFloor1[5], 548.86353 - 1.58, 1445.88171, 6000.74609, 0.9);
  376. }
  377. case 6:
  378. {
  379. if(open == 0) MoveDynamicObject(DocCellsFloor1[6], 545.21039, 1445.86316, 6000.74609, 0.9);
  380. if(open == 1) MoveDynamicObject(DocCellsFloor1[6], 545.21039 - 1.58, 1445.86316, 6000.74609, 0.9);
  381. }
  382. case 7:
  383. {
  384. if(open == 0) MoveDynamicObject(DocCellsFloor1[7], 542.56842, 1446.81152, 6000.74609, 0.9);
  385. if(open == 1) MoveDynamicObject(DocCellsFloor1[7], 542.56842, 1446.81152 + 1.58, 6000.74609, 0.9);
  386. }
  387. case 8:
  388. {
  389. if(open == 0) MoveDynamicObject(DocCellsFloor1[8], 542.54321, 1450.46936, 6000.74609, 0.9);
  390. if(open == 1) MoveDynamicObject(DocCellsFloor1[8], 542.54321, 1450.46936 + 1.58, 6000.74609, 0.9);
  391. }
  392. case 9:
  393. {
  394. if(open == 0) MoveDynamicObject(DocCellsFloor1[9], 542.55432, 1454.13354, 6000.74609, 0.9);//
  395. if(open == 1) MoveDynamicObject(DocCellsFloor1[9], 542.55432, 1454.13354 + 1.58, 6000.74609, 0.9);//
  396. }
  397. case 10:
  398. {
  399. if(open == 0) MoveDynamicObject(DocCellsFloor1[10], 542.55432, 1457.79626, 6000.74609, 0.9);
  400. if(open == 1) MoveDynamicObject(DocCellsFloor1[10], 542.55432, 1457.79626 + 1.58, 6000.74609, 0.9);
  401. }
  402. case 11:
  403. {
  404. if(open == 0) MoveDynamicObject(DocCellsFloor1[11], 543.48657, 1462.26819, 6000.74609, 0.9);
  405. if(open == 1) MoveDynamicObject(DocCellsFloor1[11], 543.48657 + 1.58, 1462.26819, 6000.74609, 0.9);
  406. }
  407. case 12:
  408. {
  409. if(open == 0) MoveDynamicObject(DocCellsFloor1[12], 547.16162, 1462.26819, 6000.74609, 0.9);
  410. if(open == 1) MoveDynamicObject(DocCellsFloor1[12], 547.16162 + 1.58, 1462.26819, 6000.74609, 0.9);
  411. }
  412. case 13:
  413. {
  414. if(open == 0) MoveDynamicObject(DocCellsFloor1[13], 550.84277, 1462.28821, 6000.74609, 0.9);
  415. if(open == 1) MoveDynamicObject(DocCellsFloor1[13], 550.84277 + 1.58, 1462.28821, 6000.74609, 0.9);
  416. }
  417. case 14:
  418. {
  419. if(open == 0) MoveDynamicObject(DocCellsFloor1[14], 556.91632, 1462.26819, 6000.74609, 0.9);
  420. if(open == 1) MoveDynamicObject(DocCellsFloor1[14], 556.91632 + 1.58, 1462.26819, 6000.74609, 0.9);
  421. }
  422. case 15:
  423. {
  424. if(open == 0) MoveDynamicObject(DocCellsFloor1[15], 560.60620, 1462.26819, 6000.74609, 0.9);
  425. if(open == 1) MoveDynamicObject(DocCellsFloor1[15],560.60620 + 1.58, 1462.26819, 6000.74609, 0.9);
  426. }
  427. case 16:
  428. {
  429. if(open == 0) MoveDynamicObject(DocCellsFloor2[0], 567.23071, 1445.88171, 6004.63135, 0.9);
  430. if(open == 1) MoveDynamicObject(DocCellsFloor2[0], 567.23071 - 1.58, 1445.88171, 6004.63135, 0.9);
  431. }
  432. case 17:
  433. {
  434. if(open == 0) MoveDynamicObject(DocCellsFloor2[1], 563.58539, 1445.88171, 6004.63135, 0.9);
  435. if(open == 1) MoveDynamicObject(DocCellsFloor2[1], 563.58539 - 1.58, 1445.88171, 6004.63135, 0.9);
  436. }
  437. case 18:
  438. {
  439. if(open == 0) MoveDynamicObject(DocCellsFloor2[2], 559.87738, 1445.88171, 6004.63135, 0.9);
  440. if(open == 1) MoveDynamicObject(DocCellsFloor2[2], 559.87738 - 1.58, 1445.88171, 6004.63135, 0.9);
  441. }
  442. case 19:
  443. {
  444. if(open == 0) MoveDynamicObject(DocCellsFloor2[3], 556.21832, 1445.88171, 6004.63135, 0.9);
  445. if(open == 1) MoveDynamicObject(DocCellsFloor2[3], 556.21832 - 1.58, 1445.88171, 6004.63135, 0.9);
  446. }
  447. case 20:
  448. {
  449. if(open == 0) MoveDynamicObject(DocCellsFloor2[4], 552.55121, 1445.88171, 6004.63135, 0.9);
  450. if(open == 1) MoveDynamicObject(DocCellsFloor2[4], 552.55121 - 1.58, 1445.88171, 6004.63135, 0.9);
  451. }
  452. case 21:
  453. {
  454. if(open == 0) MoveDynamicObject(DocCellsFloor2[5], 548.86353, 1445.88171, 6004.63135, 0.9);
  455. if(open == 1) MoveDynamicObject(DocCellsFloor2[5], 548.86353 - 1.58, 1445.88171, 6004.63135, 0.9);
  456. }
  457. case 22:
  458. {
  459. if(open == 0) MoveDynamicObject(DocCellsFloor2[6], 545.21039, 1445.86316, 6004.63135, 0.9);
  460. if(open == 1) MoveDynamicObject(DocCellsFloor2[6], 545.21039 - 1.58, 1445.86316, 6004.63135, 0.9);
  461. }
  462. case 23:
  463. {
  464. if(open == 0) MoveDynamicObject(DocCellsFloor2[7], 542.56842, 1446.81152, 6004.63135, 0.9);
  465. if(open == 1) MoveDynamicObject(DocCellsFloor2[7], 542.56842, 1446.81152 + 1.58, 6004.63135, 0.9);
  466. }
  467. case 24:
  468. {
  469. if(open == 0) MoveDynamicObject(DocCellsFloor2[8], 542.54321, 1450.46936, 6004.63135, 0.9);
  470. if(open == 1) MoveDynamicObject(DocCellsFloor2[8], 542.54321, 1450.46936 + 1.58, 6004.63135, 0.9);
  471. }
  472. case 25:
  473. {
  474. if(open == 0) MoveDynamicObject(DocCellsFloor2[9], 542.55432, 1454.13354, 6004.63135, 0.9);
  475. if(open == 1) MoveDynamicObject(DocCellsFloor2[9], 542.55432, 1454.13354 + 1.58, 6004.63135, 0.9);
  476. }
  477. case 26:
  478. {
  479. if(open == 0) MoveDynamicObject(DocCellsFloor2[10], 542.55432, 1457.79626, 6004.63135, 0.9);
  480. if(open == 1) MoveDynamicObject(DocCellsFloor2[10], 542.55432, 1457.79626 + 1.58, 6004.63135, 0.9);
  481. }
  482. case 27:
  483. {
  484. if(open == 0) MoveDynamicObject(DocCellsFloor2[11], 543.48657, 1462.26819, 6004.63135, 0.9);
  485. if(open == 1) MoveDynamicObject(DocCellsFloor2[11], 543.48657 + 1.58, 1462.26819, 6004.63135, 0.9);
  486. }
  487. case 28:
  488. {
  489. if(open == 0) MoveDynamicObject(DocCellsFloor2[12], 547.16162, 1462.26819, 6004.63135, 0.9);
  490. if(open == 1) MoveDynamicObject(DocCellsFloor2[12], 547.16162 + 1.58, 1462.26819, 6004.63135, 0.9);
  491. }
  492. case 29:
  493. {
  494. if(open == 0) MoveDynamicObject(DocCellsFloor2[13], 550.84277, 1462.28821, 6004.63135, 0.9);
  495. if(open == 1) MoveDynamicObject(DocCellsFloor2[13], 550.84277 + 1.58, 1462.28821, 6004.63135, 0.9);
  496. }
  497. case 30:
  498. {
  499. if(open == 0) MoveDynamicObject(DocCellsFloor2[14], 556.91632, 1462.26819, 6004.63135, 0.9);
  500. if(open == 1) MoveDynamicObject(DocCellsFloor2[14], 556.91632 + 1.58, 1462.26819, 6004.63135, 0.9);
  501. }
  502. }
  503. if(open == 0) bDocCellOpen[cellid] = false;
  504. else if(open == 1) bDocCellOpen[cellid] = true;
  505. }
  506. /*GetClosestJailBoxingRing(iTargetID)
  507. {
  508. new iClosest;
  509. for(new i = 0; i < MAX_JAIL_BOXINGS; i++)
  510. {
  511. if(IsPlayerInRangeOfPoint(iTargetID, 5, JailBoxingPos[i][0], JailBoxingPos[i][1], JailBoxingPos[i][2]))
  512. {
  513. iClosest = i;
  514. break;
  515. }
  516. }
  517. return iClosest;
  518. }
  519. IsPlayerAtJailBoxing(iTargetID)
  520. {
  521. for(new i = 0; i < MAX_JAIL_BOXINGS; i++)
  522. {
  523. if(IsPlayerInRangeOfPoint(iTargetID, 5, JailBoxingPos[i][0], JailBoxingPos[i][1], JailBoxingPos[i][2]))
  524. {
  525. return true;
  526. }
  527. }
  528. return 0;
  529. }
  530. SetPlayerIntoJailBoxing(iTargetID)
  531. {
  532. new index = GetClosestJailBoxingRing(iTargetID);
  533. if(arrJailBoxingData[index][bInProgress] == false && arrJailBoxingData[index][iParticipants] < 2)
  534. {
  535. SetPlayerPos(iTargetID, JailBoxingPos[index][0], JailBoxingPos[index][1], JailBoxingPos[index][2]);
  536. arrJailBoxingData[index][iParticipants]++;
  537. SetPVarInt(iTargetID, "_InJailBoxing", index + 1);
  538. SendClientMessageEx(iTargetID, COLOR_WHITE, "You have joined the boxing queue.");
  539. if(arrJailBoxingData[index][iParticipants] == 2)
  540. {
  541. foreach(Player, i)
  542. {
  543. if(GetPVarInt(i, "_InJailBoxing") == index + 1 && i != iTargetID)
  544. {
  545. SetPVarInt(iTargetID, "_JailBoxingChallenger", i);
  546. SetPVarInt(i, "_JailBoxingChallenger", iTargetID);
  547. break;
  548. }
  549. }
  550. arrJailBoxingData[index][iDocBoxingCountdown] = 4;
  551. arrJailBoxingData[index][iDocCountDownTimer] = SetTimerEx("StartJailBoxing", 1000, true, "i", index);
  552. }
  553. }
  554. else SendClientMessageEx(iTargetID, COLOR_WHITE, "You cannot join this arena at the moment.");
  555. }*/
  556. RemoveFromJailBoxing(iTargetID)
  557. {
  558. arrJailBoxingData[GetPVarInt(iTargetID, "_InJailBoxing") - 1][iParticipants]--;
  559. //DeletePVar(GetPVarInt(iTargetID, "_JailBoxingChallenger"));
  560. DeletePVar(iTargetID, "_InJailBoxing");
  561. DeletePVar(iTargetID, "_JailBoxingChallenger");
  562. }
  563. forward StartJailBoxing(iArenaID);
  564. public StartJailBoxing(iArenaID)
  565. {
  566. new string[60 + MAX_PLAYER_NAME];
  567. new iRangePoint;
  568. foreach(Player, i)
  569. {
  570. if(GetPVarType(i, "_InJailBoxing") && GetPVarInt(i, "_InJailBoxing") - 1 == iArenaID)
  571. iRangePoint = i;
  572. break;
  573. }
  574. arrJailBoxingData[iArenaID][iDocBoxingCountdown]--;
  575. if(arrJailBoxingData[iArenaID][iDocBoxingCountdown] == 0)
  576. {
  577. format(string, sizeof(string), "** [Boxing Countdown (Arena:%d)] The bell rings **", iArenaID);
  578. ProxDetector(10.0, iRangePoint, string, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000);
  579. arrJailBoxingData[iArenaID][bInProgress] = true;
  580. KillTimer(arrJailBoxingData[iArenaID][iDocCountDownTimer]);
  581. arrJailBoxingData[iArenaID][iDocBoxingCountdown] = 4;
  582. }
  583. else
  584. {
  585. format(string, sizeof(string), "** [Boxing Countdown (Arena:%d)] %d seconds until start! **", iArenaID, arrJailBoxingData[iArenaID][iDocBoxingCountdown]);
  586. ProxDetector(10.0, iRangePoint, string, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000);
  587. }
  588. return 1;
  589. }
  590. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  591. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  592. szMiscArray[0] = 0;
  593. switch(dialogid)
  594. {
  595. case DIALOG_DOC_CP:
  596. {
  597. if(response)
  598. {
  599. switch(listitem)
  600. {
  601. case 0: ShowDocPrisonControls(playerid, 1);
  602. case 1: ShowDocPrisonControls(playerid, 5);
  603. case 2: ShowDocPrisonControls(playerid, 4);
  604. case 3: DocLockdown(playerid);
  605. }
  606. }
  607. }
  608. case DIALOG_DOC_CP_SUB:
  609. {
  610. if(response)
  611. {
  612. switch(listitem)
  613. {
  614. case 0: // floor 1
  615. {
  616. ShowDocPrisonControls(playerid, 2);
  617. }
  618. case 1: // floor 2
  619. {
  620. ShowDocPrisonControls(playerid, 3);
  621. }
  622. case 2: // all floor 1
  623. {
  624. if(bDocCellsFloorOpen[0] == false)
  625. {
  626. for(new i = 0; i < 16; i++)
  627. {
  628. OpenDocCells(i, 1);
  629. }
  630. bDocCellsFloorOpen[0] = true;
  631. }
  632. else if(bDocCellsFloorOpen[0] == true)
  633. {
  634. for(new i = 0; i < 16; i++)
  635. {
  636. OpenDocCells(i, 0);
  637. }
  638. bDocCellsFloorOpen[0] = false;
  639. }
  640. }
  641. case 3: // all floor 2
  642. {
  643. if(bDocCellsFloorOpen[1] == false)
  644. {
  645. for(new i = 16; i < 31; i++)
  646. {
  647. OpenDocCells(i, 1);
  648. }
  649. bDocCellsFloorOpen[1] = true;
  650. }
  651. else if(bDocCellsFloorOpen[1] == true)
  652. {
  653. for(new i = 16; i < 31; i++)
  654. {
  655. OpenDocCells(i, 0);
  656. }
  657. bDocCellsFloorOpen[1] = false;
  658. }
  659. }
  660. }
  661. }
  662. else ShowDocPrisonControls(playerid, 0);
  663. }
  664. case DIALOG_DOC_CP_AREA:
  665. {
  666. if(response)
  667. {
  668. if(listitem == 9)
  669. {
  670. if(bDocAreaOpen[9] == false) bDocAreaOpen[9] = true;
  671. else bDocAreaOpen[9] = false;
  672. }
  673. else if(listitem == 10)
  674. {
  675. if(bDocAreaOpen[10] == false) bDocAreaOpen[10] = true;
  676. else bDocAreaOpen[10] = false;
  677. }
  678. else
  679. {
  680. if(bDocAreaOpen[listitem] == false) OpenDocAreaDoors(listitem, 1);
  681. else OpenDocAreaDoors(listitem, 0);
  682. }
  683. ShowDocPrisonControls(playerid, 4);
  684. }
  685. else ShowDocPrisonControls(playerid, 0);
  686. }
  687. case DIALOG_DOC_CP_C1F1:
  688. {
  689. if(response)
  690. {
  691. if(bDocCellOpen[listitem] == false) OpenDocCells(listitem, 1);
  692. else OpenDocCells(listitem, 0);
  693. ShowDocPrisonControls(playerid, 2);
  694. }
  695. else ShowDocPrisonControls(playerid, 1);
  696. }
  697. case DIALOG_DOC_CP_C1F2:
  698. {
  699. if(response)
  700. {
  701. if(bDocCellOpen[listitem + 16] == false) OpenDocCells(listitem + 16, 1);
  702. else OpenDocCells(listitem + 16, 0);
  703. ShowDocPrisonControls(playerid, 3);
  704. }
  705. else ShowDocPrisonControls(playerid, 1);
  706. }
  707. case DIALOG_LOAD_DETAINEES:
  708. {
  709. if(response)
  710. {
  711. new stpos = strfind(inputtext, "(");
  712. new fpos = strfind(inputtext, ")");
  713. new prisoneridstr[4], prisonerid;
  714. strmid(prisoneridstr, inputtext, stpos+1, fpos);
  715. prisonerid = strval(prisoneridstr);
  716. new getVW = GetPlayerVirtualWorld(playerid);
  717. new getIW = GetPlayerInterior(playerid);
  718. new getVeh = GetPlayerVehicleID(playerid);
  719. new iVehicleSeat = 0;
  720. for(new i = 1; i < 9; i++)
  721. {
  722. if(IsSeatAvailable(getVeh, i))
  723. {
  724. iVehicleSeat = i;
  725. break;
  726. }
  727. }
  728. LoadPrisoner(playerid, prisonerid, getVeh, iVehicleSeat, getVW, getIW);
  729. }
  730. }
  731. }
  732. return 0;
  733. }
  734. CMD:setbail(playerid, params[]) {
  735. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be in DoC to use this command.");
  736. if(PlayerInfo[playerid][pLeader] == INVALID_GROUP_ID) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a Warden to use this command.");
  737. new uPlayer,
  738. iBail;
  739. if(sscanf(params, "dd", uPlayer, iBail)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /setbail [player] [amount]");
  740. if(!(0 < iBail < 50000000)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You specified an invalid amount ($1 - $50.000.000).");
  741. PlayerInfo[uPlayer][pBailPrice] = iBail;
  742. format(szMiscArray, sizeof(szMiscArray), "You have set %s's bail to: $%s", GetPlayerNameEx(uPlayer), number_format(iBail));
  743. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  744. format(szMiscArray, sizeof(szMiscArray), "Your bail has been set to $%s by %s", number_format(iBail), GetPlayerNameEx(playerid));
  745. SendClientMessageEx(uPlayer, COLOR_YELLOW, szMiscArray);
  746. format(szMiscArray, sizeof szMiscArray, "%s has set %s's bail price to $%s.", GetPlayerNameEx(playerid), GetPlayerNameEx(uPlayer), number_format(PlayerInfo[uPlayer][pBailPrice]));
  747. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  748. return 1;
  749. }
  750. CMD:bail(playerid, params[])
  751. {
  752. if(PlayerInfo[playerid][pJailTime] > 0)
  753. {
  754. if(PlayerInfo[playerid][pBailPrice] > 0)
  755. {
  756. if(GetPlayerCash(playerid) > PlayerInfo[playerid][pBailPrice])
  757. {
  758. new string[128];
  759. format(string, sizeof(string), "You bailed yourself out for $%d.", PlayerInfo[playerid][pBailPrice]);
  760. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  761. format(string, sizeof string, "%s has bailed themselves out for $%s.", GetPlayerNameEx(playerid), number_format(PlayerInfo[playerid][pBailPrice]));
  762. for(new x; x < MAX_GROUPS; ++x) if(arrGroupData[x][g_iDoCAccess] >= 0 && arrGroupData[x][g_iDoCAccess] != INVALID_RANK) GroupLog(x, string);
  763. GivePlayerCash(playerid, -PlayerInfo[playerid][pBailPrice]);
  764. PlayerInfo[playerid][pBailPrice] = 0;
  765. WantLawyer[playerid] = 0; CallLawyer[playerid] = 0;
  766. PlayerInfo[playerid][pJailTime] = 1;
  767. }
  768. else
  769. {
  770. SendClientMessageEx(playerid, COLOR_GRAD1, "You can't afford the bail price.");
  771. }
  772. }
  773. else
  774. {
  775. SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have a bail price.");
  776. }
  777. }
  778. else
  779. {
  780. SendClientMessageEx(playerid, COLOR_GRAD1, "You're not in jail.");
  781. }
  782. return 1;
  783. }
  784. CMD:docarrest(playerid, params[])
  785. {
  786. if(!IsACop(playerid)) SendClientMessageEx(playerid, COLOR_GREY, "You are not part of a LEO faction. ");
  787. else if(!IsAtArrestPoint(playerid, 2)) SendClientMessageEx(playerid, COLOR_GREY, "You are not at the DoC Prison arrest point." );
  788. else
  789. {
  790. new
  791. //moneys,
  792. //time,
  793. string[256];
  794. new suspect = GetClosestPlayer(playerid);
  795. /*if(sscanf(params, "dddd", moneys, time)) SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docarrest [fine] [minutes]");
  796. else if(!(1 <= moneys <= 250000)) SendClientMessageEx(playerid, COLOR_GREY, "The jail fine can't be below $1 or above $250,000.");
  797. else if(!(1 <= time <= 120)) SendClientMessageEx(playerid, COLOR_GREY, "Jail time can't be below 1 or above 120 minutes - take the person to prison for more time.");*/
  798. if(!IsPlayerConnected(suspect)) SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  799. else if(!ProxDetectorS(5.0, playerid, suspect)) SendClientMessageEx(playerid, COLOR_GREY, "You are close enough to the suspect.");
  800. else if(PlayerInfo[suspect][pWantedLevel] < 1 && PlayerInfo[playerid][pMember] != 12) SendClientMessageEx(playerid, COLOR_GREY, "The person must have a wanted level of at least one star.");
  801. else {
  802. SetPVarInt(playerid, "Arrest_Price", PlayerInfo[suspect][pWantedJailFine]);
  803. SetPVarInt(playerid, "Arrest_Time", PlayerInfo[suspect][pWantedJailTime]);
  804. SetPVarInt(playerid, "Arrest_Bail", 1);
  805. SetPVarInt(playerid, "Arrest_BailPrice", PlayerInfo[suspect][pWantedJailFine]*2);
  806. SetPVarInt(playerid, "Arrest_Suspect", suspect);
  807. SetPVarInt(playerid, "Arrest_Type", 2);
  808. format(string, sizeof(string), "Please write a brief arrest report on how %s acted during the arrest.\n\nThis report must be at least 30 characters and no more than 128.", GetPlayerNameEx(suspect));
  809. ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", string, "Submit", "");
  810. }
  811. }
  812. return 1;
  813. }
  814. CMD:arrest(playerid, params[])
  815. {
  816. if(!IsACop(playerid)) {
  817. SendClientMessageEx(playerid, COLOR_GREY, "You are not part of a LEO faction. ");
  818. }
  819. else if(!IsAtArrestPoint(playerid, 0) && !IsAtArrestPoint(playerid, 1)) {
  820. SendClientMessageEx(playerid, COLOR_GREY, "You are not at a arrest point." );
  821. }
  822. else {
  823. new suspect = GetClosestPlayer(playerid);
  824. if(!IsPlayerConnected(suspect)) {
  825. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  826. }
  827. else if(!ProxDetectorS(5.0, playerid, suspect)) {
  828. SendClientMessageEx(playerid, COLOR_GREY, "You are not close enough to the suspect.");
  829. }
  830. else if(PlayerInfo[suspect][pWantedLevel] < 1 && !IsAJudge(playerid)) {
  831. SendClientMessageEx(playerid, COLOR_GREY, "The person must have a wanted level of at least one star.");
  832. }
  833. else {
  834. SetPVarInt(playerid, "Arrest_Price", PlayerInfo[suspect][pWantedJailFine]);
  835. SetPVarInt(playerid, "Arrest_Time", PlayerInfo[suspect][pWantedJailTime]);
  836. SetPVarInt(playerid, "Arrest_Bail", 1);
  837. SetPVarInt(playerid, "Arrest_BailPrice", PlayerInfo[suspect][pWantedJailFine]*2);
  838. SetPVarInt(playerid, "Arrest_Suspect", suspect);
  839. SetPVarInt(playerid, "Arrest_Type", 0);
  840. format(szMiscArray, sizeof(szMiscArray), "Please write a brief arrest report on how %s acted during the arrest.\n\nThis report must be at least 30 characters and no more than 128.", GetPlayerNameEx(suspect));
  841. ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", szMiscArray, "Submit", "");
  842. }
  843. }
  844. return 1;
  845. }
  846. CMD:listprisoners(playerid, params[])
  847. {
  848. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  849. new szInmates[1024],
  850. szString[20],
  851. id;
  852. if(sscanf(params, "d", id)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /listprisoners [arrestpoint id]");
  853. foreach(Player, i)
  854. {
  855. if((GetPVarInt(i, "ArrestPoint") == id + 1) && PlayerInfo[i][pJailTime] > 0)
  856. {
  857. format(szInmates, sizeof(szInmates), "%s\n* [%d] Prisoner Name: %s", szInmates, i, GetPlayerNameEx(i));
  858. }
  859. }
  860. if(strlen(szInmates) == 0) format(szInmates, sizeof(szInmates), "Holding cell empty!");
  861. format(szString, sizeof(szString), "Holding Cell %d", id);
  862. ShowPlayerDialogEx(playerid, DIALOG_DOC_INMATES, DIALOG_STYLE_LIST, szString, szInmates, "Close", "");
  863. return 1;
  864. }
  865. CMD:loadprisoners(playerid, params[])
  866. {
  867. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  868. if(GetArrestPointID(playerid) == -1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not near a arrest point.");
  869. new getVeh = GetPlayerVehicleID(playerid);
  870. if(GetVehicleModel(getVeh) == 431 || GetVehicleModel(getVeh) == 427)
  871. {
  872. ListDetainees(playerid);
  873. }
  874. else SendClientMessage(playerid, COLOR_WHITE, "You need to be in a bus to transport prisoners.");
  875. return 1;
  876. }
  877. CMD:deliverinmates(playerid, params[])
  878. {
  879. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  880. if(!IsPlayerInRangeOfPoint(playerid, 4, -2053.6279,-198.0207,15.0703)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at the doc delivery point");
  881. foreach(Player, i)
  882. {
  883. if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(i) != 0)
  884. {
  885. new rand = random(sizeof(DocPrison));
  886. SetPlayerFacingAngle(i, 0);
  887. SetPlayerPos(i, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2]);
  888. DeletePVar(i, "IsFrozen");
  889. TogglePlayerControllable(i, 1);
  890. SetPlayerInterior(i, 10);
  891. SetPlayerVirtualWorld(i, 0);
  892. PlayerInfo[i][pVW] = 0;
  893. Player_StreamPrep(i, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2], FREEZE_TIME);
  894. }
  895. }
  896. return 1;
  897. }
  898. CMD:getinmatefood(playerid, params[])
  899. {
  900. if(IsPlayerInRangeOfPoint(playerid, 8, 555.8644,1485.1359,6000.4258))
  901. {
  902. new string[64];
  903. if(GetPVarInt(playerid, "inmatefood") < 5)
  904. {
  905. SetPVarInt(playerid, "inmatefood", 5);
  906. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  907. SetPlayerAttachedObject(playerid, 9, 2767, 6, 0.195999, 0.042999, -0.191, -108.6, 168.6, -83.4999);
  908. format(string, sizeof(string), "* %s has picked up a food tray.", GetPlayerNameEx(playerid));
  909. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  910. }
  911. else
  912. {
  913. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot carry anymore food on your tray.");
  914. }
  915. }
  916. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not at the Prison Cafe!");
  917. return 1;
  918. }
  919. CMD:dropfoodtray(playerid, params[])
  920. {
  921. new string[64];
  922. if(GetPVarInt(playerid, "inmatefood") > 0 || GetPVarInt(playerid, "carryingfood") > 0)
  923. {
  924. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  925. RemovePlayerAttachedObject(playerid, 9);
  926. format(string, sizeof(string), "* %s has dropped their food tray.", GetPlayerNameEx(playerid));
  927. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  928. DeletePVar(playerid, "inmatefood");
  929. DeletePVar(playerid, "carryingfood");
  930. DeletePVar(playerid, "OfferedMealTo");
  931. }
  932. else
  933. {
  934. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have a foodtray with food on it.");
  935. }
  936. return 1;
  937. }
  938. CMD:offerinmatefood(playerid, params[])
  939. {
  940. new iGiveTo,
  941. string[92];
  942. if(sscanf(params, "u", iGiveTo)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /offerinmatefood [playerid]");
  943. else if(iGiveTo == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot offer yourself food.");
  944. else if(!IsPlayerConnected(iGiveTo)) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not connected");
  945. //else if(GetPVarInt(playerid, "OfferingMeal") == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You may only offer food to one person at a time.");
  946. else if(!PlayerInfo[iGiveTo][pJailTime]) return SendClientMessageEx(playerid, COLOR_WHITE, "You may only offer food to prison inmates.");
  947. else if(!GetPVarInt(playerid, "inmatefood")) return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any prison food to offer.");
  948. else if(ProxDetectorS(5.0, playerid, iGiveTo))
  949. {
  950. if(GetPVarInt(playerid, "OfferingMeal") == 1) { // added as a bug report fix
  951. new iOfferingToOld = GetPVarInt(playerid, "OfferedMealTo");
  952. DeletePVar(iOfferingToOld, "OfferedMeal");
  953. DeletePVar(iOfferingToOld, "OfferedMealBy");
  954. DeletePVar(playerid, "OfferingMeal");
  955. DeletePVar(playerid, "OfferedMealTo");
  956. }
  957. SetPVarInt(iGiveTo, "OfferedMeal", 1);
  958. SetPVarInt(iGiveTo, "OfferedMealBy", playerid);
  959. SetPVarInt(playerid, "OfferingMeal", 1);
  960. SetPVarInt(playerid, "OfferedMealTo", iGiveTo);
  961. format(string, sizeof(string), "%s has offered you a meal. Type /acceptjailfood to take it.", GetPlayerNameEx(playerid));
  962. SendClientMessageEx(iGiveTo, COLOR_LIGHTBLUE, string);
  963. format(string, sizeof(string), "You have offered %s some prisoner food", GetPlayerNameEx(iGiveTo));
  964. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  965. }
  966. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not in range of that player.");
  967. return 1;
  968. }
  969. CMD:acceptjailfood(playerid, params[])
  970. {
  971. new iOffering = GetPVarInt(playerid, "OfferedMealBy"),
  972. string[101];
  973. if(GetPVarInt(playerid, "OfferedMeal") == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "No one offered you a meal.");
  974. else if(!IsPlayerConnected(GetPVarInt(playerid, "OfferedMealBy"))) return SendClientMessageEx(playerid, COLOR_WHITE, "The person offering you food has disconnected.");
  975. else if(ProxDetectorS(5.0, playerid, iOffering))
  976. {
  977. SetPVarInt(iOffering, "inmatefood", GetPVarInt(iOffering, "inmatefood") - 1);
  978. if(!GetPVarInt(iOffering, "inmatefood")) {
  979. RemovePlayerAttachedObject(iOffering, 9);
  980. SetPlayerSpecialAction(iOffering, SPECIAL_ACTION_NONE);
  981. }
  982. if (PlayerInfo[playerid][pFitness] >= 3)
  983. {
  984. PlayerInfo[playerid][pFitness] -= 3;
  985. }
  986. else
  987. {
  988. PlayerInfo[playerid][pFitness] = 0;
  989. }
  990. DeletePVar(playerid, "OfferedMeal");
  991. DeletePVar(playerid, "OfferedMealBy");
  992. DeletePVar(iOffering, "OfferingMeal");
  993. DeletePVar(iOffering, "OfferedMealTo");
  994. format(string, sizeof(string), "* %s takes a plate of food from %s and begins to eat it.", GetPlayerNameEx(playerid), GetPlayerNameEx(iOffering));
  995. ProxChatBubble(playerid, string);
  996. // ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  997. //ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.1, 0, 1, 0, 4000, 1);
  998. ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 1, 0);
  999. SetTimerEx("ClearAnims", 3000, false, "d", playerid);
  1000. }
  1001. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not in range of the person offering you food.");
  1002. return 1;
  1003. }
  1004. CMD:getfood(playerid, params[])
  1005. {
  1006. if(IsPlayerInRangeOfPoint(playerid, 8, 555.8644,1485.1359,6000.4258))
  1007. {
  1008. new string[94];
  1009. if(GetPVarInt(playerid, "carryingfood") < 1)
  1010. {
  1011. SetPVarInt(playerid, "carryingfood", 1);
  1012. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  1013. SetPlayerAttachedObject(playerid, 9, 2767, 6, 0.195999, 0.042999, -0.191, -108.6, 168.6, -83.4999);
  1014. format(string, sizeof(string), "* %s reaches towards the counter, grabbing a tray of food.", GetPlayerNameEx(playerid));
  1015. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1016. }
  1017. else
  1018. {
  1019. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot carry anymore food on your tray.");
  1020. }
  1021. }
  1022. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not at the Prison Cafe!");
  1023. return 1;
  1024. }
  1025. CMD:eatfood(playerid, params[])
  1026. {
  1027. if(GetPVarInt(playerid, "carryingfood") == 1)
  1028. {
  1029. new string[94];
  1030. format(string, sizeof(string), "* %s grabs the food from the tray and eats it.", GetPlayerNameEx(playerid));
  1031. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1032. DeletePVar(playerid, "carryingfood");
  1033. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  1034. ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 1, 0);
  1035. SetTimerEx("ClearAnims", 3000, false, "d", playerid);
  1036. RemovePlayerAttachedObject(playerid, 9);
  1037. }
  1038. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not carrying a food tray");
  1039. return 1;
  1040. }
  1041. CMD:extendsentence(playerid, params[])
  1042. {
  1043. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1044. new iTargetID,
  1045. iExtended,
  1046. string[64];
  1047. if(sscanf(params, "ud", iTargetID, iExtended)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /extendsentence [playerid] [percentage to extend (1 - 30)]");
  1048. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1049. else if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1050. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1051. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[EXT]", true) != -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player has already had their time extended.");
  1052. else if(iExtended >= 1 && iExtended <= 30)
  1053. {
  1054. new StartJail = PlayerInfo[iTargetID][pJailTime];
  1055. new Float:EndJail;
  1056. new Float:Manip;
  1057. Manip = 1.0 + (float(iExtended) / 100);
  1058. EndJail = StartJail * Manip;
  1059. PlayerInfo[iTargetID][pJailTime] = floatround(EndJail);
  1060. format(string, sizeof(string), "Your jail time has been extended by %s by %d percent.", GetPlayerNameEx(playerid), iExtended);
  1061. SendClientMessageEx(iTargetID, COLOR_RED, string);
  1062. format(string, sizeof(string), "You have extended %s's jail sentence by %d percent.", GetPlayerNameEx(iTargetID), iExtended);
  1063. SendClientMessageEx(playerid, COLOR_RED, string);
  1064. format(string, sizeof(string), "Original Time: %s ------ New Time: %s", TimeConvert(StartJail), TimeConvert(PlayerInfo[iTargetID][pJailTime]));
  1065. SendClientMessageEx(playerid, COLOR_RED, string);
  1066. strcat(PlayerInfo[iTargetID][pPrisonReason], "[EXT]", 128);
  1067. format(string, sizeof string, "%s has extended %s's sentence by %d percent. (Original: %s, New: %s)", GetPlayerNameEx(playerid), GetPlayerNameExt(iTargetID), iExtended, TimeConvert(StartJail), TimeConvert(PlayerInfo[iTargetID][pJailTime]));
  1068. GroupLog(PlayerInfo[playerid][pMember], string);
  1069. }
  1070. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: The extension percentage cannot be less than 1 or greater than 10.");
  1071. return 1;
  1072. }
  1073. CMD:reducesentence(playerid, params[])
  1074. {
  1075. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1076. new iTargetID,
  1077. iReduce,
  1078. string[64];
  1079. if(sscanf(params, "ud", iTargetID, iReduce)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /reducesentence [playerid] [percentage to reduce (1 - 30)]");
  1080. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1081. else if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1082. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1083. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[RED]", true) != -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player has already had their time reduced.");
  1084. else if(iReduce >= 1 && iReduce <= 30)
  1085. {
  1086. new StartJail = PlayerInfo[iTargetID][pJailTime];
  1087. new Float:EndJail;
  1088. new Float:Manip;
  1089. Manip = 1.0 - (float(iReduce) / 100);
  1090. EndJail = StartJail * Manip;
  1091. PlayerInfo[iTargetID][pJailTime] = floatround(EndJail);
  1092. format(string, sizeof(string), "Your jail time has been reduced by %s by %d percent.", GetPlayerNameEx(playerid), iReduce);
  1093. SendClientMessageEx(iTargetID, COLOR_RED, string);
  1094. format(string, sizeof(string), "You have reduced %s's jail sentence by %d percent.", GetPlayerNameEx(iTargetID), iReduce);
  1095. SendClientMessageEx(playerid, COLOR_RED, string);
  1096. format(string, sizeof(string), "Original Time: %s ------ New Time: %s", TimeConvert(StartJail), TimeConvert(PlayerInfo[iTargetID][pJailTime]));
  1097. SendClientMessageEx(playerid, COLOR_RED, string);
  1098. strcat(PlayerInfo[iTargetID][pPrisonReason], "[RED]", 128);
  1099. format(string, sizeof string, "%s has reduced %s's sentence by %d percent. (Original: %s, New: %s)", GetPlayerNameEx(playerid), GetPlayerNameExt(iTargetID), iReduce, TimeConvert(StartJail), TimeConvert(PlayerInfo[iTargetID][pJailTime]));
  1100. GroupLog(PlayerInfo[playerid][pMember], string);
  1101. }
  1102. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: The reduction percentage cannot be less than 1 or greater than 10.");
  1103. return 1;
  1104. }
  1105. CMD:isolateinmate(playerid, params[])
  1106. {
  1107. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1108. new iTargetID,
  1109. iCellID,
  1110. string[128];
  1111. if(sscanf(params, "ud", iTargetID, iCellID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /isolateinmate [playerid] [cellid]");
  1112. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1113. else if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1114. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1115. else if(!(0 <= iCellID < sizeof(DocIsolation))) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: Valid Isolation Cells [0-24]");
  1116. else if(PlayerInfo[iTargetID][pIsolated] == 0)
  1117. {
  1118. DocIsolate(iTargetID, iCellID);
  1119. format(string, sizeof(string), "You have been sent to isolation by %s.", GetPlayerNameEx(playerid));
  1120. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, string);
  1121. format(string, sizeof(string), "You have sent %s to isolation.", GetPlayerNameEx(iTargetID));
  1122. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1123. format(string, sizeof string, "%s has sent %s to isolation.", GetPlayerNameEx(playerid), GetPlayerNameExt(iTargetID));
  1124. GroupLog(PlayerInfo[playerid][pMember], string);
  1125. }
  1126. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is already in isolation.");
  1127. return 1;
  1128. }
  1129. CMD:unisolateinmate(playerid, params[])
  1130. {
  1131. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1132. new iTargetID,
  1133. string[128];
  1134. if(sscanf(params, "u", iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /unisolateinmate [playerid]");
  1135. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail");
  1136. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1137. else if(PlayerInfo[iTargetID][pIsolated] == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in isolation");
  1138. else if(IsPlayerConnected(iTargetID))
  1139. {
  1140. PlayerInfo[iTargetID][pIsolated] = 0;
  1141. format(string, sizeof(string), "You have been released from isolation by %s.", GetPlayerNameEx(playerid));
  1142. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, string);
  1143. format(string, sizeof(string), "You have released %s from isolation.", GetPlayerNameEx(iTargetID));
  1144. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1145. format(string, sizeof string, "%s has brought %s back from isolation.", GetPlayerNameEx(playerid), GetPlayerNameExt(iTargetID));
  1146. GroupLog(PlayerInfo[playerid][pMember], string);
  1147. }
  1148. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1149. return 1;
  1150. }
  1151. CMD:inmates(playerid, params[])
  1152. {
  1153. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1154. new szInmates[1024];
  1155. foreach(Player, i)
  1156. {
  1157. if(PlayerInfo[i][pJailTime] > 0 && strfind(PlayerInfo[i][pPrisonReason], "[IC]", true) != -1)
  1158. {
  1159. if(PlayerInfo[i][pBailPrice]) format(szInmates, sizeof(szInmates), "%s\n* %s: %s - Bail: $%s", szInmates, GetPlayerNameEx(i), TimeConvert(PlayerInfo[i][pJailTime]), number_format(PlayerInfo[i][pBailPrice]));
  1160. else format(szInmates, sizeof(szInmates), "%s\n* %s: %s", szInmates, GetPlayerNameEx(i), TimeConvert(PlayerInfo[i][pJailTime]));
  1161. }
  1162. }
  1163. if(strlen(szInmates) == 0) format(szInmates, sizeof(szInmates), "No inmates");
  1164. ShowPlayerDialogEx(playerid, DIALOG_DOC_INMATES, DIALOG_STYLE_LIST, "DOC Inmates Logbook", szInmates, "Close", "");
  1165. return 1;
  1166. }
  1167. /*CMD:joinjailboxing(playerid, params[])
  1168. {
  1169. if(IsPlayerAtJailBoxing(playerid))
  1170. {
  1171. if(GetPVarInt(playerid, "_InJailBoxing") != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're already in a boxing arena. Use /leavejailboxing to leave.");
  1172. else if(arrJailBoxingData[GetClosestJailBoxingRing(playerid)][bInProgress] == true) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are unable to join a boxing match that is in progress.");
  1173. else SetPlayerIntoJailBoxing(playerid);
  1174. }
  1175. else SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in range of a jail boxing ring.");
  1176. return 1;
  1177. }
  1178. CMD:leavejailboxing(playerid, params[])
  1179. {
  1180. if(GetPVarInt(playerid, "_InJailBoxing") == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not in a boxing arena. Please use /joinjailboxing to join one.");
  1181. else if(arrJailBoxingData[GetClosestJailBoxingRing(playerid)][bInProgress] == true) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are unable to leave a boxing match that is in progress.");
  1182. else
  1183. {
  1184. RemoveFromJailBoxing(playerid);
  1185. SendClientMessageEx(playerid, COLOR_WHITE, "You have withdrawn yourself from the boxing arena queue.");
  1186. }
  1187. return 1;
  1188. }*/
  1189. CMD:startbrawl(playerid, params[])
  1190. {
  1191. new iTargetID,
  1192. string[MAX_PLAYER_NAME + 35];
  1193. if(sscanf(params, "u", iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /startbrawl [playerid]");
  1194. else if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "You must be in IC jail to do this.");
  1195. else if(!ProxDetectorS(8.0, playerid, iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not in range of that player.");
  1196. else if(IsPlayerConnected(iTargetID))
  1197. {
  1198. SetPVarInt(playerid, "_InJailBrawl", iTargetID + 1);
  1199. SetPVarInt(iTargetID, "_InJailBrawl", playerid + 1);
  1200. format(string, sizeof(string), "You have initiated a brawl with %s", GetPlayerNameEx(iTargetID));
  1201. SendClientMessageEx(playerid, COLOR_RED, string);
  1202. format(string, sizeof(string), "%s has initiated a brawl with you", GetPlayerNameEx(playerid));
  1203. SendClientMessageEx(iTargetID, COLOR_RED, string);
  1204. }
  1205. else SendClientMessageEx(playerid, COLOR_GRAD2, "That player is not connected.");
  1206. return 1;
  1207. }
  1208. CMD:docjudgesubpoena(playerid, params[])
  1209. {
  1210. new iTargetID,
  1211. szCaseName[128],
  1212. szString[128];
  1213. if(sscanf(params, "us[128]", iTargetID, szCaseName)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docjudgesubpoena [playerid] [case reason]");
  1214. if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That player is not connected");
  1215. if(!IsPlayerInRangeOfPoint(playerid, 15, 525.86, 1427.05, 11001.28)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at the DOC courthouse to use this");
  1216. else if(IsAJudge(playerid))
  1217. {
  1218. format(szString, sizeof(szString), "You have subpoenaed %s. Case: %s", GetPlayerNameEx(iTargetID), szCaseName);
  1219. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szString);
  1220. format(szString, sizeof(szString), "You have been subpoenaed by %s. Case %s", GetPlayerNameEx(playerid), szCaseName);
  1221. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szString);
  1222. }
  1223. else SendClientMessageEx(playerid, COLOR_GREY, "You must be a judge to use this command");
  1224. return 1;
  1225. }
  1226. CMD:docjudgecharge(playerid, params[])
  1227. {
  1228. new iTargetID,
  1229. iTime,
  1230. iFine,
  1231. szCountry[5],
  1232. szReason[128],
  1233. szCrime[128],
  1234. szMessage[128];
  1235. if(sscanf(params, "udds[128]", iTargetID, iTime, iFine, szReason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docjudgecharge [playerid] [time] [fine] [reason]");
  1236. if(!IsPlayerInRangeOfPoint(playerid, 15, 525.86, 1427.05, 11001.28)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at the DOC courthouse to use this");
  1237. if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That player is not connected");
  1238. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a judge to use this command");
  1239. if(ProxDetectorS(14.0, playerid, iTargetID))
  1240. {
  1241. PlayerInfo[iTargetID][pWantedJailTime] += iTime;
  1242. PlayerInfo[iTargetID][pWantedJailFine] += iFine;
  1243. if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == 1)
  1244. {
  1245. format(szCountry, sizeof(szCountry), "[SA] ");
  1246. }
  1247. else if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == 2)
  1248. {
  1249. format(szCountry, sizeof(szCountry), "[NE] ");
  1250. }
  1251. strcat(szCrime, szCountry);
  1252. strcat(szCrime, szReason);
  1253. AddCrime(playerid, iTargetID, szCrime);
  1254. format(szMessage, sizeof(szMessage), "You've commited a crime ( %s ). Reporter: %s.", szCrime, GetPlayerNameEx(playerid));
  1255. SendClientMessageEx(iTargetID, COLOR_LIGHTRED, szMessage);
  1256. format(szMessage, sizeof(szMessage), "Current wanted level: %d", PlayerInfo[iTargetID][pWantedLevel]);
  1257. SendClientMessageEx(iTargetID, COLOR_YELLOW, szMessage);
  1258. format(szMessage, sizeof(szMessage), "You have charged %s with a crime.", GetPlayerNameEx(iTargetID));
  1259. SendClientMessage(playerid, COLOR_LIGHTRED, szMessage);
  1260. format(szMessage, sizeof(szMessage), "%s: Time: %i minutes. Fine: %i", szCrime, iTime, iFine);
  1261. SendClientMessage(playerid, COLOR_LIGHTRED, szMessage);
  1262. }
  1263. else SendClientMessageEx(playerid, COLOR_WHITE, "You must be in range of that player");
  1264. return 1;
  1265. }
  1266. CMD:docjudgesentence(playerid, params[])
  1267. {
  1268. new iSuspect,
  1269. string[256];
  1270. if(sscanf(params, "u", iSuspect)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docjudgesentence [suspect]");
  1271. if(!IsPlayerInRangeOfPoint(playerid, 15, 525.86, 1427.05, 11001.28)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at the DOC courthouse to use this");
  1272. if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That player is not connected");
  1273. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a judge to use this command");
  1274. if(ProxDetectorS(14.0, playerid, iSuspect))
  1275. {
  1276. SetPVarInt(playerid, "Arrest_Price", PlayerInfo[iSuspect][pWantedJailFine]);
  1277. SetPVarInt(playerid, "Arrest_Time", PlayerInfo[iSuspect][pWantedJailTime]);
  1278. SetPVarInt(playerid, "Arrest_Suspect", iSuspect);
  1279. SetPVarInt(playerid, "Arrest_Type", 3);
  1280. format(string, sizeof(string), "Please write a brief report on how %s acted during the process.\n\nThis report must be at least 30 characters and no more than 128.", GetPlayerNameEx(iSuspect));
  1281. ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", string, "Submit", "");
  1282. }
  1283. else SendClientMessageEx(playerid, COLOR_WHITE, "You must be in range of that player");
  1284. return 1;
  1285. }
  1286. /*CMD:jailcall(playerid, params[])
  1287. {
  1288. new phonenumb,
  1289. JailPhone = GetClosestPrisonPhone(playerid),
  1290. string[128];
  1291. if(sscanf(params, "d", phonenumb)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /jailcall [phone number]");
  1292. if(!IsPlayerInRangeOfJailPhone(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in range of a prison call phone");
  1293. if(bJailPhoneUse[JailPhone] == true) return SendClientMessageEx(playerid, COLOR_GREY, "That phone is in use, please find another");
  1294. if(Mobile[playerid] != INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, " You are already on a call...");
  1295. foreach(new i: Player)
  1296. {
  1297. if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
  1298. {
  1299. new giveplayerid = i;
  1300. Mobile[playerid] = giveplayerid; //caller connecting
  1301. if(IsPlayerConnected(giveplayerid))
  1302. {
  1303. if(giveplayerid != INVALID_PLAYER_ID)
  1304. {
  1305. if(PhoneOnline[giveplayerid] > 0)
  1306. {
  1307. SendClientMessageEx(playerid, COLOR_GREY, "That player's phone is switched off.");
  1308. Mobile[playerid] = INVALID_PLAYER_ID;
  1309. return 1;
  1310. }
  1311. if(Mobile[giveplayerid] != INVALID_PLAYER_ID)
  1312. {
  1313. SendClientMessageEx(playerid, COLOR_GRAD2, "You just get a busy tone...");
  1314. Mobile[playerid] = INVALID_PLAYER_ID;
  1315. return 1;
  1316. }
  1317. if(Spectating[giveplayerid]!=0)
  1318. {
  1319. SendClientMessageEx(playerid, COLOR_GRAD2, "You just get a busy tone...");
  1320. Mobile[playerid] = INVALID_PLAYER_ID;
  1321. return 1;
  1322. }
  1323. if (Mobile[giveplayerid] == INVALID_PLAYER_ID)
  1324. {
  1325. format(string, sizeof(string), "* %s dials in a number.", GetPlayerNameEx(playerid));
  1326. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1327. format(string, sizeof(string), "Your mobile is ringing - type /p to answer it. [Caller ID: DOC Phoneline]");
  1328. SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
  1329. format(string, sizeof(string), "* %s's phone begins to ring.", GetPlayerNameEx(i));
  1330. SendClientMessageEx(playerid, COLOR_WHITE, "HINT: You now use T to talk on your cellphone, type /jailhangup to hang up.");
  1331. ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1332. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  1333. TogglePlayerControllable(playerid, 0);
  1334. SetPVarInt(playerid, "_UsingJailPhone", 1);
  1335. bJailPhoneUse[JailPhone] = true;
  1336. return 1;
  1337. }
  1338. }
  1339. }
  1340. }
  1341. }
  1342. SendClientMessageEx(playerid, COLOR_WHITE, "The call could not completed as requested, please try again");
  1343. return 1;
  1344. }
  1345. CMD:jailhangup(playerid,params[])
  1346. {
  1347. new string[128];
  1348. new caller = Mobile[playerid],
  1349. JailPhone = GetClosestPrisonPhone(playerid);
  1350. if((IsPlayerConnected(caller) && caller != INVALID_PLAYER_ID))
  1351. {
  1352. if(caller < MAX_PLAYERS)
  1353. {
  1354. SendClientMessageEx(caller, COLOR_GRAD2, " They hung up.");
  1355. format(string, sizeof(string), "* %s puts away their cellphone.", GetPlayerNameEx(caller));
  1356. ProxDetector(30.0, caller, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1357. Mobile[caller] = INVALID_PLAYER_ID;
  1358. }
  1359. SendClientMessageEx(playerid, COLOR_GRAD2, " You hung up.");
  1360. format(string, sizeof(string), "* %s steps away from the phone.", GetPlayerNameEx(playerid));
  1361. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1362. Mobile[playerid] = INVALID_PLAYER_ID;
  1363. RemovePlayerAttachedObject(caller, 9);
  1364. TogglePlayerControllable(playerid, 1);
  1365. SetPlayerSpecialAction(caller, SPECIAL_ACTION_STOPUSECELLPHONE);
  1366. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  1367. bJailPhoneUse[JailPhone] = false;
  1368. DeletePVar(playerid, "_UsingJailPhone");
  1369. return 1;
  1370. }
  1371. SendClientMessageEx(playerid, COLOR_GRAD2, " Your phone is in your pocket.");
  1372. return 1;
  1373. }*/
  1374. CMD:jailcuff(playerid, params[])
  1375. {
  1376. if(IsACop(playerid))
  1377. {
  1378. if(GetPVarInt(playerid, "Injured") == 1 || GetPVarInt(playerid, "jailcuffs") > 0 || PlayerCuffed[ playerid ] >= 1 || PlayerInfo[ playerid ][ pJailTime ] > 0 || PlayerInfo[playerid][pHospital] > 0)
  1379. {
  1380. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1381. return 1;
  1382. }
  1383. if(PlayerInfo[playerid][pHasCuff] < 1)
  1384. {
  1385. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any pair of cuffs on you!");
  1386. return 1;
  1387. }
  1388. new string[128], giveplayerid;
  1389. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /jailcuff [player]");
  1390. if(IsPlayerConnected(giveplayerid))
  1391. {
  1392. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1393. {
  1394. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
  1395. if(GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP || PlayerCuffed[giveplayerid] == 1)
  1396. {
  1397. format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
  1398. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1399. format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
  1400. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1401. format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1402. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1403. GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
  1404. ClearAnimationsEx(giveplayerid);
  1405. TogglePlayerControllable(giveplayerid, 0);
  1406. SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
  1407. TogglePlayerControllable(giveplayerid, 1);
  1408. SetPVarInt(giveplayerid, "jailcuffs", 1);
  1409. }
  1410. else if(GetPVarType(giveplayerid, "IsTackled"))
  1411. {
  1412. format(string, sizeof(string), "* %s removes a set of cuffs from his belt and attempts to cuff %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1413. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1414. SetTimerEx("CuffTackled", 4000, 0, "ii", playerid, giveplayerid);
  1415. }
  1416. else
  1417. {
  1418. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't restrained!");
  1419. return 1;
  1420. }
  1421. }
  1422. else
  1423. {
  1424. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1425. return 1;
  1426. }
  1427. }
  1428. else
  1429. {
  1430. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1431. return 1;
  1432. }
  1433. }
  1434. else
  1435. {
  1436. SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
  1437. }
  1438. return 1;
  1439. }