prison_system.pwn 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744
  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) 2014, 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. new g_aMaleSkins[185] = {
  35. 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
  36. 30, 32, 33, 34, 35, 36, 37, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 57, 58, 59, 60,
  37. 61, 62, 66, 68, 72, 73, 78, 79, 80, 81, 82, 83, 84, 94, 95, 96, 97, 98, 99, 100, 101, 102,
  38. 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
  39. 121, 122, 123, 124, 125, 126, 127, 128, 132, 133, 134, 135, 136, 137, 142, 143, 144, 146,
  40. 147, 153, 154, 155, 156, 158, 159, 160, 161, 162, 167, 168, 170, 171, 173, 174, 175, 176,
  41. 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 200, 202, 203, 204, 206,
  42. 208, 209, 210, 212, 213, 217, 220, 221, 222, 223, 228, 229, 230, 234, 235, 236, 239, 240,
  43. 241, 242, 247, 248, 249, 250, 253, 254, 255, 258, 259, 260, 261, 262, 268, 272, 273, 289,
  44. 290, 291, 292, 293, 294, 295, 296, 297, 299
  45. };
  46. new g_aFemaleSkins[77] = {
  47. 9, 10, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 63, 64, 65, 69,
  48. 75, 76, 77, 85, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 140, 141,
  49. 145, 148, 150, 151, 152, 157, 169, 178, 190, 191, 192, 193, 194, 195,
  50. 196, 197, 198, 199, 201, 205, 207, 211, 214, 215, 216, 219, 224, 225,
  51. 226, 231, 232, 233, 237, 238, 243, 244, 245, 246, 251, 256, 257, 263, 298
  52. };
  53. DocIsolate(playerid, cellid, ooc)
  54. {
  55. SetPlayerPos(playerid, DocIsolation[cellid][0], DocIsolation[cellid][1], DocIsolation[cellid][2]);
  56. SetPlayerFacingAngle(playerid, 0);
  57. SetPlayerInterior(playerid, 1);
  58. Player_StreamPrep(playerid, DocIsolation[cellid][0], DocIsolation[cellid][1], DocIsolation[cellid][2], FREEZE_TIME);
  59. PlayerInfo[playerid][pIsolated] = cellid + 1;
  60. if(ooc >= 1)
  61. {
  62. SetPlayerVirtualWorld(playerid, 666);
  63. PlayerInfo[playerid][pVW] = 666;
  64. }
  65. }
  66. ListDetainees(playerid)
  67. {
  68. new szPrisoners[1028],
  69. iCount = 0,
  70. temp[4];
  71. foreach(Player, i)
  72. {
  73. if(GetPVarInt(i, "ArrestPoint") == GetArrestPointID(playerid) + 1)
  74. {
  75. strcat(szPrisoners, "{3333CC}Prisoner:{FFFFFF}");
  76. strcat(szPrisoners, "(");
  77. valstr(temp, i);
  78. strcat(szPrisoners, temp);
  79. strcat(szPrisoners, ")");
  80. strcat(szPrisoners, GetPlayerNameEx(i));
  81. strcat(szPrisoners, "\n");
  82. iCount++;
  83. }
  84. }
  85. if(iCount == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "No prisoners at this arrest point.");
  86. return ShowPlayerDialogEx(playerid, DIALOG_LOAD_DETAINEES, DIALOG_LOAD_DETAINEES, "Detainees List", szPrisoners, "Load", "Cancel");
  87. }
  88. LoadPrisoner(iLoadingID, iPrisonerID, iVehicleID, iVehicleSeat, iNewVW, iNewIW)
  89. {
  90. SetPlayerVirtualWorld(iPrisonerID, iNewVW);
  91. PlayerInfo[iPrisonerID][pVW] = iNewVW;
  92. SetPlayerInterior(iPrisonerID, iNewIW);
  93. PlayerInfo[iPrisonerID][pInt] = iNewIW;
  94. PutPlayerInVehicle(iPrisonerID, iVehicleID, iVehicleSeat);
  95. TogglePlayerControllable(iPrisonerID, 0);
  96. DeletePVar(iPrisonerID, "ArrestPoint");
  97. SendClientMessageEx(iPrisonerID, COLOR_LIGHTBLUE, "You have been loaded into a prisoner transport bus by and will be transported to DOC");
  98. ListDetainees(iLoadingID);
  99. }
  100. ShowDocPrisonControls(playerid, icontrolid)
  101. {
  102. szMiscArray[0] = 0;
  103. switch(icontrolid)
  104. {
  105. case 0:
  106. {
  107. // main dialog
  108. format(szMiscArray, sizeof(szMiscArray), "Cell-block A\nIsolation Cells\nArea Doors\nLockdown\nIntercom");
  109. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Cancel");
  110. }
  111. case 1:
  112. {
  113. // sub-dialog
  114. format(szMiscArray, sizeof(szMiscArray), "Floor 1\nFloor 2\nAll Floor 1\nAll Floor 2");
  115. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_SUB, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  116. }
  117. case 2:
  118. {
  119. // floor 1
  120. format(szMiscArray, sizeof(szMiscArray), "Cell 1 (%s)\n\
  121. Cell 2 (%s)\n\
  122. Cell 3 (%s)\n\
  123. Cell 4 (%s)\n\
  124. Cell 5 (%s)\n\
  125. Cell 6 (%s)\n\
  126. Cell 7 (%s)\n\
  127. Cell 8 (%s)\n\
  128. Cell 9 (%s)\n\
  129. Cell 10 (%s)\n\
  130. Cell 11 (%s)\n\
  131. Cell 12 (%s)\n\
  132. Cell 13 (%s)\n\
  133. Cell 14 (%s)\n\
  134. Cell 15 (%s)\n\
  135. Cell 16 (%s)",
  136. ((bDocCellOpen[0] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  137. ((bDocCellOpen[1] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  138. ((bDocCellOpen[2] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  139. ((bDocCellOpen[3] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  140. ((bDocCellOpen[4] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  141. ((bDocCellOpen[5] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  142. ((bDocCellOpen[6] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  143. ((bDocCellOpen[7] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  144. ((bDocCellOpen[8] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  145. ((bDocCellOpen[9] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  146. ((bDocCellOpen[10] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  147. ((bDocCellOpen[11] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  148. ((bDocCellOpen[12] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  149. ((bDocCellOpen[13] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  150. ((bDocCellOpen[14] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  151. ((bDocCellOpen[15] == false) ? ("{FF0000}Closed"):("{00FF00}Open"))
  152. );
  153. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_C1F1, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  154. }
  155. case 3:
  156. {
  157. // floor 2
  158. format(szMiscArray, sizeof(szMiscArray), "Cell 1 (%s)\n\
  159. Cell 2 (%s)\n\
  160. Cell 3 (%s)\n\
  161. Cell 4 (%s)\n\
  162. Cell 5 (%s)\n\
  163. Cell 6 (%s)\n\
  164. Cell 7 (%s)\n\
  165. Cell 8 (%s)\n\
  166. Cell 9 (%s)\n\
  167. Cell 10 (%s)\n\
  168. Cell 11 (%s)\n\
  169. Cell 12 (%s)\n\
  170. Cell 13 (%s)\n\
  171. Cell 14 (%s)\n\
  172. Cell 15 (%s)",
  173. ((bDocCellOpen[16] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  174. ((bDocCellOpen[17] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  175. ((bDocCellOpen[18] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  176. ((bDocCellOpen[19] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  177. ((bDocCellOpen[20] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  178. ((bDocCellOpen[21] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  179. ((bDocCellOpen[22] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  180. ((bDocCellOpen[23] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  181. ((bDocCellOpen[24] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  182. ((bDocCellOpen[25] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  183. ((bDocCellOpen[26] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  184. ((bDocCellOpen[27] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  185. ((bDocCellOpen[28] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  186. ((bDocCellOpen[29] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  187. ((bDocCellOpen[30] == false) ? ("{FF0000}Closed"):("{00FF00}Open"))
  188. );
  189. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_C1F2, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  190. }
  191. case 4:
  192. {
  193. // area controls
  194. format(szMiscArray, sizeof(szMiscArray), "Cell-block 1(%s)\n\
  195. Cell-block 2 (%s)\n\
  196. Showers (%s)\n\
  197. Cafe 1 (%s)\n\
  198. Cafe 2 (%s)\n\
  199. Laundry Room (%s)\n\
  200. Isolation Block (%s)\n\
  201. Control Room (%s)\n\
  202. Processing 1 (%s)\n\
  203. Processing 2 (%s)\n\
  204. Processing 3 (%s)\n\
  205. Classroom (%s)\n\
  206. Janitor's Closet (%s)\n\
  207. Medical Ward (%s)\n\
  208. Hallway(%s)\n\
  209. Lobby 1 (%s)\n\
  210. Lobby 2 (%s)\n\
  211. Visitation (%s)",
  212. ((bDocAreaOpen[0] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  213. ((bDocAreaOpen[1] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  214. ((bDocAreaOpen[2] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  215. ((bDocAreaOpen[3] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  216. ((bDocAreaOpen[4] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  217. ((bDocAreaOpen[5] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  218. ((bDocAreaOpen[6] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  219. ((bDocAreaOpen[7] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  220. ((bDocAreaOpen[8] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  221. ((bDocAreaOpen[9] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  222. ((bDocAreaOpen[10] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  223. ((bDocAreaOpen[11] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  224. ((bDocAreaOpen[12] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  225. ((bDocAreaOpen[13] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  226. ((bDocAreaOpen[14] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  227. ((bDocAreaOpen[15] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  228. ((bDocAreaOpen[16] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  229. ((bDocAreaOpen[17] == false) ? ("{FF0000}Closed"):("{00FF00}Open")),
  230. ((bDocAreaOpen[18] == false) ? ("{FF0000}Closed"):("{00FF00}Open"))
  231. );
  232. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_AREA, DIALOG_STYLE_LIST, "Doc Control Pannel", szMiscArray, "Select", "Back");
  233. }
  234. }
  235. return 1;
  236. }
  237. DocLockdown(playerid)
  238. {
  239. new szWarning[128];
  240. if(bDocLockdown == false)
  241. {
  242. bDocLockdown = true;
  243. for(new i = 0; i < 31; i++)
  244. {
  245. OpenDocCells(i, 0);
  246. }
  247. for(new i = 0; i < 19; i++)
  248. {
  249. OpenDocAreaDoors(i, 0);
  250. }
  251. format( szWarning, sizeof(szWarning), "ALERT: The DeMorgan Correctional Facility is now on lockdown for an emergency (( %s ))", GetPlayerNameEx(playerid));
  252. SendGroupMessage(1, COLOR_RED, szWarning);
  253. format(szMiscArray, sizeof szMiscArray, "%s has set the DeMorgan Correctional Facilty on lockdown.", GetPlayerNameEx(playerid));
  254. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  255. }
  256. else
  257. {
  258. bDocLockdown = false;
  259. format( szWarning, sizeof(szWarning), "ALERT: The DeMorgan Correctional Facility is no longer on lockdown (( %s ))", GetPlayerNameEx(playerid));
  260. SendGroupMessage(1, COLOR_YELLOW, szWarning);
  261. format(szMiscArray, sizeof szMiscArray, "%s has removed the DeMorgan Correctional Facilty from lockdown.", GetPlayerNameEx(playerid));
  262. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  263. }
  264. }
  265. Prison_SetPlayerSkin(playerid) {
  266. switch(PlayerInfo[playerid][pSex]) {
  267. case 1: {
  268. SetPlayerSkin(playerid, 8);
  269. PlayerInfo[playerid][pModel] = 8;
  270. }
  271. case 2: {
  272. SetPlayerSkin(playerid, 211);
  273. PlayerInfo[playerid][pModel] = 211;
  274. }
  275. }
  276. }
  277. GetClosestPrisonPhone(playerid)
  278. {
  279. new returnval;
  280. for(new i = 0; i < 5; i++)
  281. {
  282. if(IsPlayerInRangeOfPoint(playerid, 2, JailPhonePos[i][0], JailPhonePos[i][1], JailPhonePos[i][2]))
  283. {
  284. returnval = i;
  285. break;
  286. }
  287. }
  288. return returnval;
  289. }
  290. forward OpenDocAreaDoors(doorid, open);
  291. public OpenDocAreaDoors(doorid, open)
  292. {
  293. switch(doorid)
  294. {
  295. case 0: {
  296. if(open == 0) MoveDynamicObject(DocCellRoomDoors[0], 568.36981, 1453.9955, 5999.47168, 0.9);
  297. if(open == 1) MoveDynamicObject(DocCellRoomDoors[0], 568.36981, 1455.3355, 5999.47168, 0.9);
  298. }
  299. case 1: {
  300. if(open == 0) MoveDynamicObject(DocCellRoomDoors[1], 572.8498, 1453.9955, 5999.47168, 0.9);
  301. if(open == 1) MoveDynamicObject(DocCellRoomDoors[1], 572.8498, 1455.3155, 5999.47168, 0.9);
  302. }
  303. case 2: {
  304. if(open == 0) MoveDynamicObject(DocCellRoomDoors[2], 585.77289, 1448.87915, 5999.45947, 0.9);
  305. if(open == 1) MoveDynamicObject(DocCellRoomDoors[2], 585.7729, 1447.5592, 5999.4595, 0.9);
  306. }
  307. case 3: {
  308. if(open == 0) MoveDynamicObject(DocCellRoomDoors[3], 553.98120, 1466.11426, 5999.44971, 0.9);
  309. if(open == 1) MoveDynamicObject(DocCellRoomDoors[3], 552.6612, 1466.1143, 5999.4497, 0.9);
  310. }
  311. case 4: {
  312. if(open == 0) MoveDynamicObject(DocCellRoomDoors[4], 553.98169, 1474.47205, 5999.48877, 0.9);
  313. if(open == 1) MoveDynamicObject(DocCellRoomDoors[4], 552.6617, 1474.4720, 5999.4888, 0.9);
  314. }
  315. case 5: {
  316. if(open == 0) MoveDynamicObject(DocCellRoomDoors[5], 583.51978, 1455.05212, 5999.47266, 0.9);
  317. if(open == 1) MoveDynamicObject(DocCellRoomDoors[5], 582.1798, 1455.0521, 5999.4727, 0.9);
  318. }
  319. case 6: {
  320. if(open == 0) MoveDynamicObject(DocCellRoomDoors[6], 531.66589, 1428.00647, 10999.45703, 0.9);
  321. if(open == 1) MoveDynamicObject(DocCellRoomDoors[6], 530.3259, 1428.0065, 10999.4570, 0.9);
  322. }
  323. case 7: {
  324. if(open == 0) MoveDynamicObject(DocCellRoomDoors[7], 566.54053, 1462.30774, 6003.41699, 0.9);
  325. if(open == 1) MoveDynamicObject(DocCellRoomDoors[7], 565.2205, 1462.30774, 6003.41699, 0.9);
  326. }
  327. case 8: {
  328. if(open == 0) MoveDynamicObject(DocCellRoomDoors[8], 572.98657, 1447.5975, 5999.4727, 0.9);
  329. if(open == 1) MoveDynamicObject(DocCellRoomDoors[8], 572.98657, 1449.12683, 5999.4727, 0.9);
  330. }
  331. case 9: {
  332. if(open == 0) MoveDynamicObject(DocCellRoomDoors[9], 597.01477, 1452.43774, 5999.44873 , 0.9);
  333. if(open == 1) MoveDynamicObject(DocCellRoomDoors[9], 597.0148, 1451.0177, 5999.4487, 0.9);
  334. }
  335. case 10: {
  336. if(open == 0) MoveDynamicObject(DocCellRoomDoors[10], 599.12000, 1451.45422, 5999.47754, 0.9);
  337. if(open == 1) MoveDynamicObject(DocCellRoomDoors[10], 597.7200, 1451.4742, 5999.4775, 0.9);
  338. }
  339. case 11: {
  340. if(open == 0) MoveDynamicObject(DocCellRoomDoors[11], 589.21820, 1448.87537, 5999.46826, 0.9);
  341. if(open == 1) MoveDynamicObject(DocCellRoomDoors[11], 589.2182, 1447.4754, 5999.4683, 0.9);
  342. }
  343. case 12: {
  344. if(open == 0) MoveDynamicObject(DocCellRoomDoors[12], 579.57898, 1463.63379, 5999.46143, 0.9);
  345. if(open == 1) MoveDynamicObject(DocCellRoomDoors[12], 579.5790, 1462.3338, 5999.4614, 0.9);
  346. }
  347. case 13: {
  348. if(open == 0) MoveDynamicObject(DocCellRoomDoors[13], 572.99377, 1468.63940, 5999.43994, 0.9);
  349. if(open == 1) MoveDynamicObject(DocCellRoomDoors[13], 572.9938, 1467.3394, 5999.4399, 0.9);
  350. }
  351. case 14: {
  352. if(open == 0) MoveDynamicObject(DocCellRoomDoors[14], 572.98419, 1434.65295, 5999.52295, 0.9);
  353. if(open == 1) MoveDynamicObject(DocCellRoomDoors[14], 572.9842, 1433.2330, 5999.5229, 0.9);
  354. }
  355. case 15: {
  356. if(open == 0) MoveDynamicObject(DocCellRoomDoors[15], 575.50751, 1461.82019, 5999.47168, 0.9);
  357. if(open == 1) MoveDynamicObject(DocCellRoomDoors[15], 574.1475, 1461.82019, 5999.47168, 0.9);
  358. }
  359. case 16: {
  360. if(open == 0) MoveDynamicObject(DocCellRoomDoors[16], 526.92139, 1414.63281, 10999.45703, 0.9);
  361. if(open == 1) MoveDynamicObject(DocCellRoomDoors[16], 526.92139, 1415.9528, 10999.45703, 0.9);
  362. }
  363. case 17: {
  364. if(open == 0) MoveDynamicObject(DocCellRoomDoors[17], 529.96143, 1414.63281, 10999.45703, 0.9);
  365. if(open == 1) MoveDynamicObject(DocCellRoomDoors[17], 529.96143, 1415.9528, 10999.45703, 0.9);
  366. }
  367. case 18: {
  368. if(open == 0) MoveDynamicObject(DocCellRoomDoors[18], 542.2069, 1417.86682, 10999.45703, 0.9);
  369. if(open == 1) MoveDynamicObject(DocCellRoomDoors[18], 542.2069, 1416.5468, 10999.45703, 0.9);
  370. }
  371. }
  372. if(open == 0) bDocAreaOpen[doorid] = false;
  373. else if(open == 1) bDocAreaOpen[doorid] = true;
  374. }
  375. OpenDocCells(cellid, open)
  376. {
  377. switch(cellid)
  378. {
  379. case 0:
  380. {
  381. if(open == 0) MoveDynamicObject(DocCellsFloor1[0], 567.21069, 1445.88171, 6000.74609, 0.9);
  382. if(open == 1) MoveDynamicObject(DocCellsFloor1[0], 567.21069 - 1.58, 1445.88171, 6000.74609, 0.9);
  383. }
  384. case 1:
  385. {
  386. if(open == 0) MoveDynamicObject(DocCellsFloor1[1], 563.58539, 1445.88171, 6000.74609, 0.9);
  387. if(open == 1) MoveDynamicObject(DocCellsFloor1[1], 563.58539 - 1.58, 1445.88171, 6000.74609, 0.9);
  388. }
  389. case 2:
  390. {
  391. if(open == 0) MoveDynamicObject(DocCellsFloor1[2], 559.87738, 1445.88171, 6000.74609, 0.9);
  392. if(open == 1) MoveDynamicObject(DocCellsFloor1[2], 559.87738 - 1.58, 1445.88171, 6000.74609, 0.9);
  393. }
  394. case 3:
  395. {
  396. if(open == 0) MoveDynamicObject(DocCellsFloor1[3], 556.21832, 1445.88171, 6000.74609, 0.9);
  397. if(open == 1) MoveDynamicObject(DocCellsFloor1[3], 556.21832 - 1.58, 1445.88171, 6000.74609, 0.9);
  398. }
  399. case 4:
  400. {
  401. if(open == 0) MoveDynamicObject(DocCellsFloor1[4], 552.55121, 1445.88171, 6000.74609, 0.9);
  402. if(open == 1) MoveDynamicObject(DocCellsFloor1[4], 552.55121 - 1.58, 1445.88171, 6000.74609, 0.9);
  403. }
  404. case 5:
  405. {
  406. if(open == 0) MoveDynamicObject(DocCellsFloor1[5], 548.86353, 1445.88171, 6000.74609, 0.9);
  407. if(open == 1) MoveDynamicObject(DocCellsFloor1[5], 548.86353 - 1.58, 1445.88171, 6000.74609, 0.9);
  408. }
  409. case 6:
  410. {
  411. if(open == 0) MoveDynamicObject(DocCellsFloor1[6], 545.21039, 1445.86316, 6000.74609, 0.9);
  412. if(open == 1) MoveDynamicObject(DocCellsFloor1[6], 545.21039 - 1.58, 1445.86316, 6000.74609, 0.9);
  413. }
  414. case 7:
  415. {
  416. if(open == 0) MoveDynamicObject(DocCellsFloor1[7], 542.56842, 1446.81152, 6000.74609, 0.9);
  417. if(open == 1) MoveDynamicObject(DocCellsFloor1[7], 542.56842, 1446.81152 + 1.58, 6000.74609, 0.9);
  418. }
  419. case 8:
  420. {
  421. if(open == 0) MoveDynamicObject(DocCellsFloor1[8], 542.54321, 1450.46936, 6000.74609, 0.9);
  422. if(open == 1) MoveDynamicObject(DocCellsFloor1[8], 542.54321, 1450.46936 + 1.58, 6000.74609, 0.9);
  423. }
  424. case 9:
  425. {
  426. if(open == 0) MoveDynamicObject(DocCellsFloor1[9], 542.55432, 1454.13354, 6000.74609, 0.9);//
  427. if(open == 1) MoveDynamicObject(DocCellsFloor1[9], 542.55432, 1454.13354 + 1.58, 6000.74609, 0.9);//
  428. }
  429. case 10:
  430. {
  431. if(open == 0) MoveDynamicObject(DocCellsFloor1[10], 542.55432, 1457.79626, 6000.74609, 0.9);
  432. if(open == 1) MoveDynamicObject(DocCellsFloor1[10], 542.55432, 1457.79626 + 1.58, 6000.74609, 0.9);
  433. }
  434. case 11:
  435. {
  436. if(open == 0) MoveDynamicObject(DocCellsFloor1[11], 543.48657, 1462.26819, 6000.74609, 0.9);
  437. if(open == 1) MoveDynamicObject(DocCellsFloor1[11], 543.48657 + 1.58, 1462.26819, 6000.74609, 0.9);
  438. }
  439. case 12:
  440. {
  441. if(open == 0) MoveDynamicObject(DocCellsFloor1[12], 547.16162, 1462.26819, 6000.74609, 0.9);
  442. if(open == 1) MoveDynamicObject(DocCellsFloor1[12], 547.16162 + 1.58, 1462.26819, 6000.74609, 0.9);
  443. }
  444. case 13:
  445. {
  446. if(open == 0) MoveDynamicObject(DocCellsFloor1[13], 550.84277, 1462.28821, 6000.74609, 0.9);
  447. if(open == 1) MoveDynamicObject(DocCellsFloor1[13], 550.84277 + 1.58, 1462.28821, 6000.74609, 0.9);
  448. }
  449. case 14:
  450. {
  451. if(open == 0) MoveDynamicObject(DocCellsFloor1[14], 556.91632, 1462.26819, 6000.74609, 0.9);
  452. if(open == 1) MoveDynamicObject(DocCellsFloor1[14], 556.91632 + 1.58, 1462.26819, 6000.74609, 0.9);
  453. }
  454. case 15:
  455. {
  456. if(open == 0) MoveDynamicObject(DocCellsFloor1[15], 560.60620, 1462.26819, 6000.74609, 0.9);
  457. if(open == 1) MoveDynamicObject(DocCellsFloor1[15],560.60620 + 1.58, 1462.26819, 6000.74609, 0.9);
  458. }
  459. case 16:
  460. {
  461. if(open == 0) MoveDynamicObject(DocCellsFloor2[0], 567.23071, 1445.88171, 6004.63135, 0.9);
  462. if(open == 1) MoveDynamicObject(DocCellsFloor2[0], 567.23071 - 1.58, 1445.88171, 6004.63135, 0.9);
  463. }
  464. case 17:
  465. {
  466. if(open == 0) MoveDynamicObject(DocCellsFloor2[1], 563.58539, 1445.88171, 6004.63135, 0.9);
  467. if(open == 1) MoveDynamicObject(DocCellsFloor2[1], 563.58539 - 1.58, 1445.88171, 6004.63135, 0.9);
  468. }
  469. case 18:
  470. {
  471. if(open == 0) MoveDynamicObject(DocCellsFloor2[2], 559.87738, 1445.88171, 6004.63135, 0.9);
  472. if(open == 1) MoveDynamicObject(DocCellsFloor2[2], 559.87738 - 1.58, 1445.88171, 6004.63135, 0.9);
  473. }
  474. case 19:
  475. {
  476. if(open == 0) MoveDynamicObject(DocCellsFloor2[3], 556.21832, 1445.88171, 6004.63135, 0.9);
  477. if(open == 1) MoveDynamicObject(DocCellsFloor2[3], 556.21832 - 1.58, 1445.88171, 6004.63135, 0.9);
  478. }
  479. case 20:
  480. {
  481. if(open == 0) MoveDynamicObject(DocCellsFloor2[4], 552.55121, 1445.88171, 6004.63135, 0.9);
  482. if(open == 1) MoveDynamicObject(DocCellsFloor2[4], 552.55121 - 1.58, 1445.88171, 6004.63135, 0.9);
  483. }
  484. case 21:
  485. {
  486. if(open == 0) MoveDynamicObject(DocCellsFloor2[5], 548.86353, 1445.88171, 6004.63135, 0.9);
  487. if(open == 1) MoveDynamicObject(DocCellsFloor2[5], 548.86353 - 1.58, 1445.88171, 6004.63135, 0.9);
  488. }
  489. case 22:
  490. {
  491. if(open == 0) MoveDynamicObject(DocCellsFloor2[6], 545.21039, 1445.86316, 6004.63135, 0.9);
  492. if(open == 1) MoveDynamicObject(DocCellsFloor2[6], 545.21039 - 1.58, 1445.86316, 6004.63135, 0.9);
  493. }
  494. case 23:
  495. {
  496. if(open == 0) MoveDynamicObject(DocCellsFloor2[7], 542.56842, 1446.81152, 6004.63135, 0.9);
  497. if(open == 1) MoveDynamicObject(DocCellsFloor2[7], 542.56842, 1446.81152 + 1.58, 6004.63135, 0.9);
  498. }
  499. case 24:
  500. {
  501. if(open == 0) MoveDynamicObject(DocCellsFloor2[8], 542.54321, 1450.46936, 6004.63135, 0.9);
  502. if(open == 1) MoveDynamicObject(DocCellsFloor2[8], 542.54321, 1450.46936 + 1.58, 6004.63135, 0.9);
  503. }
  504. case 25:
  505. {
  506. if(open == 0) MoveDynamicObject(DocCellsFloor2[9], 542.55432, 1454.13354, 6004.63135, 0.9);
  507. if(open == 1) MoveDynamicObject(DocCellsFloor2[9], 542.55432, 1454.13354 + 1.58, 6004.63135, 0.9);
  508. }
  509. case 26:
  510. {
  511. if(open == 0) MoveDynamicObject(DocCellsFloor2[10], 542.55432, 1457.79626, 6004.63135, 0.9);
  512. if(open == 1) MoveDynamicObject(DocCellsFloor2[10], 542.55432, 1457.79626 + 1.58, 6004.63135, 0.9);
  513. }
  514. case 27:
  515. {
  516. if(open == 0) MoveDynamicObject(DocCellsFloor2[11], 543.48657, 1462.26819, 6004.63135, 0.9);
  517. if(open == 1) MoveDynamicObject(DocCellsFloor2[11], 543.48657 + 1.58, 1462.26819, 6004.63135, 0.9);
  518. }
  519. case 28:
  520. {
  521. if(open == 0) MoveDynamicObject(DocCellsFloor2[12], 547.16162, 1462.26819, 6004.63135, 0.9);
  522. if(open == 1) MoveDynamicObject(DocCellsFloor2[12], 547.16162 + 1.58, 1462.26819, 6004.63135, 0.9);
  523. }
  524. case 29:
  525. {
  526. if(open == 0) MoveDynamicObject(DocCellsFloor2[13], 550.84277, 1462.28821, 6004.63135, 0.9);
  527. if(open == 1) MoveDynamicObject(DocCellsFloor2[13], 550.84277 + 1.58, 1462.28821, 6004.63135, 0.9);
  528. }
  529. case 30:
  530. {
  531. if(open == 0) MoveDynamicObject(DocCellsFloor2[14], 556.91632, 1462.26819, 6004.63135, 0.9);
  532. if(open == 1) MoveDynamicObject(DocCellsFloor2[14], 556.91632 + 1.58, 1462.26819, 6004.63135, 0.9);
  533. }
  534. }
  535. if(open == 0) bDocCellOpen[cellid] = false;
  536. else if(open == 1) bDocCellOpen[cellid] = true;
  537. }
  538. /*GetClosestJailBoxingRing(iTargetID)
  539. {
  540. new iClosest;
  541. for(new i = 0; i < MAX_JAIL_BOXINGS; i++)
  542. {
  543. if(IsPlayerInRangeOfPoint(iTargetID, 5, JailBoxingPos[i][0], JailBoxingPos[i][1], JailBoxingPos[i][2]))
  544. {
  545. iClosest = i;
  546. break;
  547. }
  548. }
  549. return iClosest;
  550. }
  551. IsPlayerAtJailBoxing(iTargetID)
  552. {
  553. for(new i = 0; i < MAX_JAIL_BOXINGS; i++)
  554. {
  555. if(IsPlayerInRangeOfPoint(iTargetID, 5, JailBoxingPos[i][0], JailBoxingPos[i][1], JailBoxingPos[i][2]))
  556. {
  557. return true;
  558. }
  559. }
  560. return 0;
  561. }
  562. SetPlayerIntoJailBoxing(iTargetID)
  563. {
  564. new index = GetClosestJailBoxingRing(iTargetID);
  565. if(arrJailBoxingData[index][bInProgress] == false && arrJailBoxingData[index][iParticipants] < 2)
  566. {
  567. SetPlayerPos(iTargetID, JailBoxingPos[index][0], JailBoxingPos[index][1], JailBoxingPos[index][2]);
  568. arrJailBoxingData[index][iParticipants]++;
  569. SetPVarInt(iTargetID, "_InJailBoxing", index + 1);
  570. SendClientMessageEx(iTargetID, COLOR_WHITE, "You have joined the boxing queue.");
  571. if(arrJailBoxingData[index][iParticipants] == 2)
  572. {
  573. foreach(Player, i)
  574. {
  575. if(GetPVarInt(i, "_InJailBoxing") == index + 1 && i != iTargetID)
  576. {
  577. SetPVarInt(iTargetID, "_JailBoxingChallenger", i);
  578. SetPVarInt(i, "_JailBoxingChallenger", iTargetID);
  579. break;
  580. }
  581. }
  582. arrJailBoxingData[index][iDocBoxingCountdown] = 4;
  583. arrJailBoxingData[index][iDocCountDownTimer] = SetTimerEx("StartJailBoxing", 1000, true, "i", index);
  584. }
  585. }
  586. else SendClientMessageEx(iTargetID, COLOR_WHITE, "You cannot join this arena at the moment.");
  587. }*/
  588. RemoveFromJailBoxing(iTargetID)
  589. {
  590. arrJailBoxingData[GetPVarInt(iTargetID, "_InJailBoxing") - 1][iParticipants]--;
  591. //DeletePVar(GetPVarInt(iTargetID, "_JailBoxingChallenger"));
  592. DeletePVar(iTargetID, "_InJailBoxing");
  593. DeletePVar(iTargetID, "_JailBoxingChallenger");
  594. }
  595. forward StartJailBoxing(iArenaID);
  596. public StartJailBoxing(iArenaID)
  597. {
  598. new string[60 + MAX_PLAYER_NAME];
  599. new iRangePoint;
  600. foreach(Player, i)
  601. {
  602. if(GetPVarType(i, "_InJailBoxing") && GetPVarInt(i, "_InJailBoxing") - 1 == iArenaID)
  603. iRangePoint = i;
  604. break;
  605. }
  606. arrJailBoxingData[iArenaID][iDocBoxingCountdown]--;
  607. if(arrJailBoxingData[iArenaID][iDocBoxingCountdown] == 0)
  608. {
  609. format(string, sizeof(string), "** [Boxing Countdown (Arena:%d)] The bell rings **", iArenaID);
  610. ProxDetector(10.0, iRangePoint, string, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000);
  611. arrJailBoxingData[iArenaID][bInProgress] = true;
  612. KillTimer(arrJailBoxingData[iArenaID][iDocCountDownTimer]);
  613. arrJailBoxingData[iArenaID][iDocBoxingCountdown] = 4;
  614. }
  615. else
  616. {
  617. format(string, sizeof(string), "** [Boxing Countdown (Arena:%d)] %d seconds until start! **", iArenaID, arrJailBoxingData[iArenaID][iDocBoxingCountdown]);
  618. ProxDetector(10.0, iRangePoint, string, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000, 0xEB41000);
  619. }
  620. return 1;
  621. }
  622. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  623. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  624. switch(dialogid)
  625. {
  626. case DIALOG_DOC_CP:
  627. {
  628. if(response)
  629. {
  630. switch(listitem)
  631. {
  632. case 0: ShowDocPrisonControls(playerid, 1);
  633. case 1: ShowDocPrisonControls(playerid, 5);
  634. case 2: ShowDocPrisonControls(playerid, 4);
  635. case 3: DocLockdown(playerid);
  636. case 4: ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_INT, DIALOG_STYLE_LIST, "Doc Control Pannel - Intercom", "Prison\nYard\nAll", "Select", "Back");
  637. }
  638. }
  639. }
  640. case DIALOG_DOC_CP_SUB:
  641. {
  642. if(response)
  643. {
  644. switch(listitem)
  645. {
  646. case 0: // floor 1
  647. {
  648. ShowDocPrisonControls(playerid, 2);
  649. }
  650. case 1: // floor 2
  651. {
  652. ShowDocPrisonControls(playerid, 3);
  653. }
  654. case 2: // all floor 1
  655. {
  656. if(bDocCellsFloorOpen[0] == false)
  657. {
  658. for(new i = 0; i < 16; i++)
  659. {
  660. OpenDocCells(i, 1);
  661. }
  662. bDocCellsFloorOpen[0] = true;
  663. }
  664. else if(bDocCellsFloorOpen[0] == true)
  665. {
  666. for(new i = 0; i < 16; i++)
  667. {
  668. OpenDocCells(i, 0);
  669. }
  670. bDocCellsFloorOpen[0] = false;
  671. }
  672. }
  673. case 3: // all floor 2
  674. {
  675. if(bDocCellsFloorOpen[1] == false)
  676. {
  677. for(new i = 16; i < 31; i++)
  678. {
  679. OpenDocCells(i, 1);
  680. }
  681. bDocCellsFloorOpen[1] = true;
  682. }
  683. else if(bDocCellsFloorOpen[1] == true)
  684. {
  685. for(new i = 16; i < 31; i++)
  686. {
  687. OpenDocCells(i, 0);
  688. }
  689. bDocCellsFloorOpen[1] = false;
  690. }
  691. }
  692. }
  693. }
  694. else ShowDocPrisonControls(playerid, 0);
  695. }
  696. case DIALOG_DOC_CP_AREA:
  697. {
  698. if(response)
  699. {
  700. if(listitem == 9)
  701. {
  702. if(bDocAreaOpen[9] == false) bDocAreaOpen[9] = true;
  703. else bDocAreaOpen[9] = false;
  704. }
  705. else if(listitem == 10)
  706. {
  707. if(bDocAreaOpen[10] == false) bDocAreaOpen[10] = true;
  708. else bDocAreaOpen[10] = false;
  709. }
  710. else
  711. {
  712. if(bDocAreaOpen[listitem] == false) OpenDocAreaDoors(listitem, 1);
  713. else OpenDocAreaDoors(listitem, 0);
  714. }
  715. ShowDocPrisonControls(playerid, 4);
  716. }
  717. else ShowDocPrisonControls(playerid, 0);
  718. }
  719. case DIALOG_DOC_CP_C1F1:
  720. {
  721. if(response)
  722. {
  723. if(bDocCellOpen[listitem] == false) OpenDocCells(listitem, 1);
  724. else OpenDocCells(listitem, 0);
  725. ShowDocPrisonControls(playerid, 2);
  726. }
  727. else ShowDocPrisonControls(playerid, 1);
  728. }
  729. case DIALOG_DOC_CP_C1F2:
  730. {
  731. if(response)
  732. {
  733. if(bDocCellOpen[listitem + 16] == false) OpenDocCells(listitem + 16, 1);
  734. else OpenDocCells(listitem + 16, 0);
  735. ShowDocPrisonControls(playerid, 3);
  736. }
  737. else ShowDocPrisonControls(playerid, 1);
  738. }
  739. case DIALOG_DOC_CP_INT:
  740. {
  741. if(response)
  742. {
  743. ShowPlayerDialogEx(playerid, DIALOG_DOC_CP_INT2, DIALOG_STYLE_INPUT, "DoC Control Panel - Intercom", "Enter your message below:", "Login", "Cancel");
  744. switch(listitem)
  745. {
  746. case 0: SetPVarInt(playerid, "pPrisonIntercom", 1);
  747. case 1: SetPVarInt(playerid, "pPrisonIntercom", 2);
  748. case 2: SetPVarInt(playerid, "pPrisonIntercom", 3);
  749. default: return 0;
  750. }
  751. }
  752. }
  753. case DIALOG_DOC_CP_INT2:
  754. {
  755. if(response)
  756. {
  757. new string[256];
  758. format(string, sizeof(string), "[Intercom] %s: %s", GetPlayerNameEx(playerid), inputtext);
  759. switch(GetPVarInt(playerid, "pPrisonIntercom"))
  760. {
  761. case 1:
  762. {
  763. foreach(new i: Player)
  764. {
  765. if(IsPlayerInRangeOfPoint(i, 90.0, 584.2271,1443.5724,6000.4751) || IsPlayerInRangeOfPoint(i, 90.0, 554.5073,1424.2986,11000.4756) && GetPlayerVirtualWorld(i) != 666)
  766. {
  767. SendClientMessageEx(i, COLOR_YELLOW, string);
  768. }
  769. }
  770. DeletePVar(playerid, "pPrisonIntercom");
  771. }
  772. case 2:
  773. {
  774. foreach(new i: Player)
  775. {
  776. if(IsPlayerInRangeOfPoint(i, 90.0, 129.0239,1847.9410,17.6697))
  777. {
  778. SendClientMessageEx(i, COLOR_YELLOW, string);
  779. }
  780. }
  781. DeletePVar(playerid, "pPrisonIntercom");
  782. }
  783. case 3:
  784. {
  785. foreach(new i: Player)
  786. {
  787. if(IsPlayerInRangeOfPoint(i, 90.0, 584.2271,1443.5724,6000.4751) || IsPlayerInRangeOfPoint(i, 90.0, 554.5073,1424.2986,11000.4756) && GetPlayerVirtualWorld(i) != 666 || IsPlayerInRangeOfPoint(i, 90.0, 129.0239,1847.9410,17.6697))
  788. {
  789. SendClientMessageEx(i, COLOR_YELLOW, string);
  790. }
  791. }
  792. DeletePVar(playerid, "pPrisonIntercom");
  793. }
  794. default: return 0;
  795. }
  796. }
  797. }
  798. case DIALOG_LOAD_DETAINEES:
  799. {
  800. if(response)
  801. {
  802. new stpos = strfind(inputtext, "(");
  803. new fpos = strfind(inputtext, ")");
  804. new prisoneridstr[4], prisonerid;
  805. strmid(prisoneridstr, inputtext, stpos+1, fpos);
  806. prisonerid = strval(prisoneridstr);
  807. new getVW = GetPlayerVirtualWorld(playerid);
  808. new getIW = GetPlayerInterior(playerid);
  809. new getVeh = GetPlayerVehicleID(playerid);
  810. new iVehicleSeat = 0;
  811. for(new i = 1; i < 9; i++)
  812. {
  813. if(IsSeatAvailable(getVeh, i))
  814. {
  815. iVehicleSeat = i;
  816. break;
  817. }
  818. }
  819. LoadPrisoner(playerid, prisonerid, getVeh, iVehicleSeat, getVW, getIW);
  820. }
  821. }
  822. case DIALOG_STAYPRISON:
  823. {
  824. if(!response)
  825. {
  826. strcpy(PlayerInfo[playerid][pPrisonReason], "[IC] [DNRL] Prison Gang", 128);
  827. SendClientMessageEx(playerid, COLOR_GRAD1, "You have chosen to stay in prison. Use /docrelease if you wish to finish serving your sentence.");
  828. PlayerInfo[playerid][pJailTime] = 9999999;
  829. }
  830. else
  831. {
  832. ReleasePlayerFromPrison(playerid);
  833. }
  834. }
  835. case DIALOG_PRISONCREDS:
  836. {
  837. if(response)
  838. {
  839. switch(listitem)
  840. {
  841. case 5:
  842. {
  843. if(PlayerInfo[playerid][pPrisonCredits] >= 10)
  844. {
  845. PlayerInfo[playerid][pCigar] = 1;
  846. PlayerInfo[playerid][pPrisonCredits] -= 10;
  847. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  848. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased some cigarettes from the prison shop for 10 credits.");
  849. }
  850. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  851. }
  852. case 0:
  853. {
  854. if(PlayerInfo[playerid][pPrisonCredits] >= 5)
  855. {
  856. if(PlayerInfo[playerid][pDice] >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "You already have a dice!");
  857. PlayerInfo[playerid][pDice] = 1;
  858. PlayerInfo[playerid][pPrisonCredits] -= 5;
  859. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  860. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased a dice from the prison shop for 5 credits.");
  861. }
  862. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  863. }
  864. case 1:
  865. {
  866. if(PlayerInfo[playerid][pPrisonCredits] >= 5)
  867. {
  868. PlayerInfo[playerid][pPaper] += 1;
  869. PlayerInfo[playerid][pPrisonCredits] -= 5;
  870. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  871. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased some paper from the prison shop for 5 credits.");
  872. }
  873. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  874. }
  875. case 6:
  876. {
  877. if(PlayerInfo[playerid][pCDPlayer] >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "You already have a MP3!");
  878. if(PlayerInfo[playerid][pPrisonCredits] >= 50)
  879. {
  880. PlayerInfo[playerid][pCDPlayer] = 1;
  881. PlayerInfo[playerid][pPrisonCredits] -= 50;
  882. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  883. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased an MP3 Player from the prison shop for 50 credits.");
  884. }
  885. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  886. }
  887. case 7:
  888. {
  889. if(PlayerInfo[playerid][pPrisonCredits] >= 250)
  890. {
  891. SetPVarInt(playerid, "pPrisonSelectingSkin", 1);
  892. switch(PlayerInfo[playerid][pSex])
  893. {
  894. case 1: return ShowModelSelectionMenuEx(playerid, g_aMaleSkins, sizeof(g_aMaleSkins), "Skin Model", PRISON_SKINSELECT, -16.0, 0.0, -55.0);
  895. case 2: return ShowModelSelectionMenuEx(playerid, g_aFemaleSkins, sizeof(g_aFemaleSkins), "Skin Model", PRISON_SKINSELECT, -16.0, 0.0, -55.0);
  896. }
  897. }
  898. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  899. }
  900. case 2:
  901. {
  902. if(PlayerInfo[playerid][pPrisonCredits] >= 5)
  903. {
  904. if(GetPVarInt(playerid, "pPrisonSoap") >= 5) return SendClientMessageEx(playerid, COLOR_GREY, "You can only cary five soap at a time!");
  905. SetPVarInt(playerid, "pPrisonSoap", GetPVarInt(playerid, "pPrisonSoap") + 1); // these need to be added to the db and the enum
  906. PlayerInfo[playerid][pPrisonCredits] -= 5;
  907. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  908. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased a bar of soap from the prison shop for 5 credits.");
  909. }
  910. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  911. }
  912. case 3:
  913. {
  914. if(PlayerInfo[playerid][pPrisonCredits] >= 5)
  915. {
  916. SetPVarInt(playerid, "pPrisonSugar", GetPVarInt(playerid, "pPrisonSugar") + 1); // these need to be added to the db and the enum
  917. PlayerInfo[playerid][pPrisonCredits] -= 5;
  918. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  919. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased a packet of sugar from the prison shop for 5 credits.");
  920. }
  921. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  922. }
  923. case 4:
  924. {
  925. if(PlayerInfo[playerid][pPrisonCredits] >= 5)
  926. {
  927. if(GetPVarInt(playerid, "pPrisonBread") >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "You can only carry one loaf of bread at a time!");
  928. SetPVarInt(playerid, "pPrisonBread", 1); // these need to be added to the db and the enum
  929. PlayerInfo[playerid][pPrisonCredits] -= 10;
  930. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  931. SendClientMessageEx(playerid, COLOR_GREY, "You have purchased a loaf of bread from the prison shop for 10 credits.");
  932. }
  933. else return SendClientMessageEx(playerid, COLOR_GREY, " You do not have enough prison credits!");
  934. }
  935. }
  936. }
  937. }
  938. }
  939. return 0;
  940. }
  941. CMD:bail(playerid, params[])
  942. {
  943. if(PlayerInfo[playerid][pJailTime] > 0)
  944. {
  945. if(PlayerInfo[playerid][pBailPrice] > 0)
  946. {
  947. if(GetPlayerCash(playerid) > PlayerInfo[playerid][pBailPrice])
  948. {
  949. new string[128];
  950. format(string, sizeof(string), "You bailed yourself out for $%d.", PlayerInfo[playerid][pBailPrice]);
  951. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  952. GivePlayerCash(playerid, -PlayerInfo[playerid][pBailPrice]);
  953. PlayerInfo[playerid][pBailPrice] = 0;
  954. WantLawyer[playerid] = 0; CallLawyer[playerid] = 0;
  955. PlayerInfo[playerid][pJailTime] = 1;
  956. format(string, sizeof string, "%s has bailed themselves out for $%s.", GetPlayerNameEx(playerid), number_format(PlayerInfo[playerid][pBailPrice]));
  957. GroupLog(2, string); // Prison Group ID (September 2015).
  958. }
  959. else
  960. {
  961. SendClientMessageEx(playerid, COLOR_GRAD1, "You can't afford the bail price.");
  962. }
  963. }
  964. else
  965. {
  966. SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have a bail price.");
  967. }
  968. }
  969. else
  970. {
  971. SendClientMessageEx(playerid, COLOR_GRAD1, "You're not in jail.");
  972. }
  973. return 1;
  974. }
  975. CMD:docarrest(playerid, params[])
  976. {
  977. new giveplayerid, time, fine;
  978. if(!IsACop(playerid)) SendClientMessageEx(playerid, COLOR_GREY, "You are not part of a LEO faction. ");
  979. else if(!IsAtArrestPoint(playerid, 2)) SendClientMessageEx(playerid, COLOR_GREY, "You are not at the DoC Prison arrest point." );
  980. else if(sscanf(params, "udd", giveplayerid, time, fine))
  981. {
  982. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docarrest [playerid] [time] [fine]");
  983. return 1;
  984. }
  985. else
  986. {
  987. new string[256];
  988. new totalwealth = PlayerInfo[giveplayerid][pCash] + PlayerInfo[giveplayerid][pAccount];
  989. if(!IsPlayerConnected(giveplayerid)) SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  990. else if(!ProxDetectorS(5.0, playerid, giveplayerid)) SendClientMessageEx(playerid, COLOR_GREY, "You are close enough to the suspect.");
  991. else if(PlayerInfo[giveplayerid][pWantedLevel] < 1 && PlayerInfo[playerid][pMember] != 12) SendClientMessageEx(playerid, COLOR_GREY, "The person must have a wanted level of at least one star.");
  992. else if(time > 60 || time < 5)
  993. {
  994. SendClientMessageEx(playerid, COLOR_GREY, "The time has to be between 5-60 minutes.");
  995. }
  996. else if(fine > 250000 || fine < 0)
  997. {
  998. SendClientMessageEx(playerid, COLOR_GREY, "The fine amount has to be $0 - $250,000");
  999. }
  1000. else if(totalwealth < 250000 && fine > 50000)
  1001. {
  1002. SendClientMessageEx(playerid, COLOR_GREY, "You can only fine this person $50, 000.");
  1003. }
  1004. else {
  1005. SetPVarInt(playerid, "Arrest_Price", fine);
  1006. SetPVarInt(playerid, "Arrest_Time", time);
  1007. SetPVarInt(playerid, "Arrest_Bail", 1);
  1008. SetPVarInt(playerid, "Arrest_BailPrice", fine*2);
  1009. SetPVarInt(playerid, "Arrest_Suspect", giveplayerid);
  1010. SetPVarInt(playerid, "Arrest_Type", 2);
  1011. 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(giveplayerid));
  1012. ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", string, "Submit", "");
  1013. }
  1014. }
  1015. return 1;
  1016. }
  1017. CMD:arrest(playerid, params[])
  1018. {
  1019. new giveplayerid, time, fine;
  1020. if(!IsACop(playerid)) {
  1021. SendClientMessageEx(playerid, COLOR_GREY, "You are not part of a LEO faction. ");
  1022. }
  1023. else if(!IsAtArrestPoint(playerid, 0) && !IsAtArrestPoint(playerid, 1)) {
  1024. SendClientMessageEx(playerid, COLOR_GREY, "You are not at a arrest point." );
  1025. } else if(sscanf(params, "udd", giveplayerid, time, fine))
  1026. {
  1027. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /arrest [playerid] [time] [fine]");
  1028. return 1;
  1029. }
  1030. else {
  1031. new string[256], totalwealth;
  1032. totalwealth = PlayerInfo[giveplayerid][pCash] + PlayerInfo[giveplayerid][pAccount];
  1033. if(!IsPlayerConnected(giveplayerid)) {
  1034. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1035. }
  1036. else if(!ProxDetectorS(5.0, playerid, giveplayerid)) {
  1037. SendClientMessageEx(playerid, COLOR_GREY, "You are not close enough to the suspect.");
  1038. }
  1039. else if(time > 30 || time < 5)
  1040. {
  1041. SendClientMessageEx(playerid, COLOR_GREY, "The time has to be between 5-30 minutes.");
  1042. }
  1043. else if(fine > 250000 || fine < 0)
  1044. {
  1045. SendClientMessageEx(playerid, COLOR_GREY, "The fine amount has to be $0 - $250,000");
  1046. }
  1047. else if(PlayerInfo[giveplayerid][pWantedLevel] < 1 && !IsAJudge(playerid)) {
  1048. SendClientMessageEx(playerid, COLOR_GREY, "The person must have a wanted level of at least one star.");
  1049. }
  1050. else if(totalwealth < 250000 && fine > 50000)
  1051. {
  1052. SendClientMessageEx(playerid, COLOR_GREY, "You can only fine this person $50, 000.");
  1053. }
  1054. else {
  1055. SetPVarInt(playerid, "Arrest_Price", fine);
  1056. SetPVarInt(playerid, "Arrest_Time", time);
  1057. SetPVarInt(playerid, "Arrest_Bail", 1);
  1058. SetPVarInt(playerid, "Arrest_BailPrice", fine*2);
  1059. SetPVarInt(playerid, "Arrest_Suspect", giveplayerid);
  1060. SetPVarInt(playerid, "Arrest_Type", 0);
  1061. 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(giveplayerid));
  1062. ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", string, "Submit", "");
  1063. }
  1064. }
  1065. return 1;
  1066. }
  1067. CMD:listprisoners(playerid, params[])
  1068. {
  1069. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1070. new szInmates[1024],
  1071. szString[20],
  1072. id;
  1073. if(sscanf(params, "d", id)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /listprisoners [arrestpoint id]");
  1074. foreach(Player, i)
  1075. {
  1076. if((GetPVarInt(i, "ArrestPoint") == id + 1) && PlayerInfo[i][pJailTime] > 0)
  1077. {
  1078. format(szInmates, sizeof(szInmates), "%s\n* [%d] Prisoner Name: %s", szInmates, i, GetPlayerNameEx(i));
  1079. }
  1080. }
  1081. if(strlen(szInmates) == 0) format(szInmates, sizeof(szInmates), "Holding cell empty!");
  1082. format(szString, sizeof(szString), "Holding Cell %d", id);
  1083. ShowPlayerDialogEx(playerid, DIALOG_DOC_INMATES, DIALOG_STYLE_LIST, szString, szInmates, "Close", "");
  1084. return 1;
  1085. }
  1086. CMD:inmates(playerid, params[])
  1087. {
  1088. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1089. ListInmates(playerid);
  1090. return 1;
  1091. }
  1092. ListInmates(playerid)
  1093. {
  1094. new szInmates[2000], IsoString[24], BailString[50], TimeString[50];
  1095. foreach(Player, i)
  1096. {
  1097. if(PlayerInfo[i][pJailTime] > 0 && strfind(PlayerInfo[i][pPrisonReason], "[IC]", true) != -1)
  1098. {
  1099. if(PlayerInfo[i][pIsolated] >= 1)
  1100. {
  1101. if(GetPlayerVirtualWorld(i) == 666) {
  1102. format(IsoString, sizeof(IsoString), "[OOC-ISO] ");
  1103. }
  1104. else { format(IsoString, sizeof(IsoString), "[ISO] "); }
  1105. }
  1106. else format(IsoString, sizeof(IsoString), "");
  1107. if(PlayerInfo[i][pBailPrice])
  1108. {
  1109. format(BailString, sizeof(BailString), "| Bail: $%s", number_format(PlayerInfo[i][pBailPrice]));
  1110. }
  1111. else format(BailString, sizeof(BailString), "", number_format(PlayerInfo[i][pBailPrice]));
  1112. if(strfind(PlayerInfo[i][pPrisonReason], "[DNRL]", true) != -1)
  1113. {
  1114. format(TimeString, sizeof(TimeString), "Lifetime");
  1115. }
  1116. else format(TimeString, sizeof(TimeString), "%s", TimeConvert(PlayerInfo[i][pJailTime]));
  1117. format(szInmates, sizeof(szInmates), "%s\n* %s%s: %s | Cell: %d | Credits: %d %s", szInmates, IsoString, GetPlayerNameEx(i), TimeString, PlayerInfo[i][pPrisonCell], PlayerInfo[i][pPrisonCredits], BailString);
  1118. }
  1119. }
  1120. if(strlen(szInmates) == 0) format(szInmates, sizeof(szInmates), "No inmates");
  1121. ShowPlayerDialogEx(playerid, DIALOG_DOC_INMATES, DIALOG_STYLE_LIST, "DOC Inmates Logbook", szInmates, "Close", "");
  1122. }
  1123. CMD:loadprisoners(playerid, params[])
  1124. {
  1125. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1126. if(GetArrestPointID(playerid) == -1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not near a arrest point.");
  1127. new getVeh = GetPlayerVehicleID(playerid);
  1128. if(GetVehicleModel(getVeh) == 431 || GetVehicleModel(getVeh) == 427)
  1129. {
  1130. ListDetainees(playerid);
  1131. }
  1132. else SendClientMessage(playerid, COLOR_WHITE, "You need to be in a bus to transport prisoners.");
  1133. return 1;
  1134. }
  1135. CMD:deliverinmates(playerid, params[])
  1136. {
  1137. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1138. if(!IsPlayerInRangeOfPoint(playerid, 4, -2053.6279,-198.0207,15.0703)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be at the doc delivery point");
  1139. foreach(Player, i)
  1140. {
  1141. if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(i) != 0)
  1142. {
  1143. new rand = random(sizeof(DocPrison));
  1144. SetPlayerFacingAngle(i, 0);
  1145. SetPlayerPos(i, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2]);
  1146. DeletePVar(i, "IsFrozen");
  1147. TogglePlayerControllable(i, 1);
  1148. SetPlayerInterior(i, 10);
  1149. SetPlayerVirtualWorld(i, 0);
  1150. PlayerInfo[i][pVW] = 0;
  1151. Player_StreamPrep(i, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2], FREEZE_TIME);
  1152. }
  1153. }
  1154. return 1;
  1155. }
  1156. CMD:getinmatefood(playerid, params[])
  1157. {
  1158. if(IsPlayerInRangeOfPoint(playerid, 8, 555.8644,1485.1359,6000.4258))
  1159. {
  1160. new string[64];
  1161. if(GetPVarInt(playerid, "inmatefood") < 5)
  1162. {
  1163. SetPVarInt(playerid, "inmatefood", 5);
  1164. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  1165. SetPlayerAttachedObject(playerid, 9, 2767, 6, 0.195999, 0.042999, -0.191, -108.6, 168.6, -83.4999);
  1166. format(string, sizeof(string), "* %s has picked up a food tray.", GetPlayerNameEx(playerid));
  1167. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1168. }
  1169. else
  1170. {
  1171. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot carry anymore food on your tray.");
  1172. }
  1173. }
  1174. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not at the Prison Cafe!");
  1175. return 1;
  1176. }
  1177. CMD:dropfoodtray(playerid, params[])
  1178. {
  1179. new string[64];
  1180. if(GetPVarInt(playerid, "inmatefood") > 0 || GetPVarInt(playerid, "carryingfood") > 0)
  1181. {
  1182. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  1183. RemovePlayerAttachedObject(playerid, 9);
  1184. format(string, sizeof(string), "* %s has dropped their food tray.", GetPlayerNameEx(playerid));
  1185. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1186. DeletePVar(playerid, "inmatefood");
  1187. DeletePVar(playerid, "carryingfood");
  1188. DeletePVar(playerid, "OfferedMealTo");
  1189. }
  1190. else
  1191. {
  1192. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have a foodtray with food on it.");
  1193. }
  1194. return 1;
  1195. }
  1196. CMD:offerinmatefood(playerid, params[])
  1197. {
  1198. new iGiveTo,
  1199. string[92];
  1200. if(sscanf(params, "u", iGiveTo)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /offerinmatefood [playerid]");
  1201. else if(iGiveTo == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot offer yourself food.");
  1202. else if(!IsPlayerConnected(iGiveTo)) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not connected");
  1203. //else if(GetPVarInt(playerid, "OfferingMeal") == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You may only offer food to one person at a time.");
  1204. else if(!PlayerInfo[iGiveTo][pJailTime]) return SendClientMessageEx(playerid, COLOR_WHITE, "You may only offer food to prison inmates.");
  1205. else if(!GetPVarInt(playerid, "inmatefood")) return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any prison food to offer.");
  1206. else if(ProxDetectorS(5.0, playerid, iGiveTo))
  1207. {
  1208. if(GetPVarInt(playerid, "OfferingMeal") == 1) { // added as a bug report fix
  1209. new iOfferingToOld = GetPVarInt(playerid, "OfferedMealTo");
  1210. DeletePVar(iOfferingToOld, "OfferedMeal");
  1211. DeletePVar(iOfferingToOld, "OfferedMealBy");
  1212. DeletePVar(playerid, "OfferingMeal");
  1213. DeletePVar(playerid, "OfferedMealTo");
  1214. }
  1215. SetPVarInt(iGiveTo, "OfferedMeal", 1);
  1216. SetPVarInt(iGiveTo, "OfferedMealBy", playerid);
  1217. SetPVarInt(playerid, "OfferingMeal", 1);
  1218. SetPVarInt(playerid, "OfferedMealTo", iGiveTo);
  1219. format(string, sizeof(string), "%s has offered you a meal. Type /acceptjailfood to take it.", GetPlayerNameEx(playerid));
  1220. SendClientMessageEx(iGiveTo, COLOR_LIGHTBLUE, string);
  1221. format(string, sizeof(string), "You have offered %s some prisoner food", GetPlayerNameEx(iGiveTo));
  1222. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1223. }
  1224. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not in range of that player.");
  1225. return 1;
  1226. }
  1227. CMD:acceptjailfood(playerid, params[])
  1228. {
  1229. new iOffering = GetPVarInt(playerid, "OfferedMealBy"),
  1230. string[101];
  1231. if(GetPVarInt(playerid, "OfferedMeal") == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "No one offered you a meal.");
  1232. else if(!IsPlayerConnected(GetPVarInt(playerid, "OfferedMealBy"))) return SendClientMessageEx(playerid, COLOR_WHITE, "The person offering you food has disconnected.");
  1233. else if(ProxDetectorS(5.0, playerid, iOffering))
  1234. {
  1235. SetPVarInt(iOffering, "inmatefood", GetPVarInt(iOffering, "inmatefood") - 1);
  1236. if(!GetPVarInt(iOffering, "inmatefood")) {
  1237. RemovePlayerAttachedObject(iOffering, 9);
  1238. SetPlayerSpecialAction(iOffering, SPECIAL_ACTION_NONE);
  1239. }
  1240. if (PlayerInfo[playerid][pFitness] >= 3)
  1241. {
  1242. PlayerInfo[playerid][pFitness] -= 3;
  1243. }
  1244. else
  1245. {
  1246. PlayerInfo[playerid][pFitness] = 0;
  1247. }
  1248. DeletePVar(playerid, "OfferedMeal");
  1249. DeletePVar(playerid, "OfferedMealBy");
  1250. DeletePVar(iOffering, "OfferingMeal");
  1251. DeletePVar(iOffering, "OfferedMealTo");
  1252. format(string, sizeof(string), "* %s takes a plate of food from %s and begins to eat it.", GetPlayerNameEx(playerid), GetPlayerNameEx(iOffering));
  1253. ProxChatBubble(playerid, string);
  1254. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1255. //PlayAnimEx(playerid, "FOOD", "EAT_Burger", 4.1, 0, 1, 0, 4000, 1);
  1256. PlayAnimEx(playerid, "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 1, 0, 0);
  1257. SetTimerEx("ClearAnims", 3000, false, "d", playerid);
  1258. }
  1259. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not in range of the person offering you food.");
  1260. return 1;
  1261. }
  1262. CMD:getfood(playerid, params[])
  1263. {
  1264. if(IsPlayerInRangeOfPoint(playerid, 8, 555.8644,1485.1359,6000.4258))
  1265. {
  1266. new string[94];
  1267. if(GetPVarInt(playerid, "carryingfood") < 1)
  1268. {
  1269. SetPVarInt(playerid, "carryingfood", 1);
  1270. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  1271. SetPlayerAttachedObject(playerid, 9, 2767, 6, 0.195999, 0.042999, -0.191, -108.6, 168.6, -83.4999);
  1272. format(string, sizeof(string), "* %s reaches towards the counter, grabbing a tray of food.", GetPlayerNameEx(playerid));
  1273. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1274. }
  1275. else
  1276. {
  1277. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot carry anymore food on your tray.");
  1278. }
  1279. }
  1280. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not at the Prison Cafe!");
  1281. return 1;
  1282. }
  1283. CMD:eatfood(playerid, params[])
  1284. {
  1285. if(GetPVarInt(playerid, "carryingfood") == 1)
  1286. {
  1287. new string[94];
  1288. if (PlayerInfo[playerid][pFitness] >= 3)
  1289. {
  1290. PlayerInfo[playerid][pFitness] -= 3;
  1291. }
  1292. else
  1293. {
  1294. PlayerInfo[playerid][pFitness] = 0;
  1295. }
  1296. format(string, sizeof(string), "* %s grabs the food from the tray and eats it.", GetPlayerNameEx(playerid));
  1297. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1298. DeletePVar(playerid, "carryingfood");
  1299. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  1300. PlayAnimEx(playerid, "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 1, 0, 0);
  1301. SetTimerEx("ClearAnims", 3000, false, "d", playerid);
  1302. RemovePlayerAttachedObject(playerid, 9);
  1303. }
  1304. else SendClientMessageEx(playerid, COLOR_WHITE, "You are not carrying a food tray");
  1305. return 1;
  1306. }
  1307. CMD:extendsentence(playerid, params[])
  1308. {
  1309. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1310. new iTargetID,
  1311. iExtended,
  1312. string[64];
  1313. if(sscanf(params, "ud", iTargetID, iExtended)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /extendsentence [playerid] [percentage to extend (1 - 30)]");
  1314. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1315. else if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1316. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1317. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[EXT]", true) != -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player has already had their time extended.");
  1318. else if(iExtended >= 1 && iExtended <= 30)
  1319. {
  1320. new StartJail = PlayerInfo[iTargetID][pJailTime];
  1321. new Float:EndJail;
  1322. new Float:Manip;
  1323. Manip = 1.0 + (float(iExtended) / 100);
  1324. EndJail = StartJail * Manip;
  1325. PlayerInfo[iTargetID][pJailTime] = floatround(EndJail);
  1326. format(string, sizeof(string), "Your jail time has been extended by %s by %d percent.", GetPlayerNameEx(playerid), iExtended);
  1327. SendClientMessageEx(iTargetID, COLOR_RED, string);
  1328. format(string, sizeof(string), "You have extended %s's jail sentence by %d percent.", GetPlayerNameEx(iTargetID), iExtended);
  1329. SendClientMessageEx(playerid, COLOR_RED, string);
  1330. format(string, sizeof(string), "Original Time: %s ------ New Time: %s", TimeConvert(StartJail), TimeConvert(PlayerInfo[iTargetID][pJailTime]));
  1331. SendClientMessageEx(playerid, COLOR_RED, string);
  1332. strcat(PlayerInfo[iTargetID][pPrisonReason], "[EXT]", 128);
  1333. 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]));
  1334. GroupLog(PlayerInfo[playerid][pMember], string);
  1335. }
  1336. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: The extension percentage cannot be less than 1 or greater than 10.");
  1337. return 1;
  1338. }
  1339. CMD:reducesentence(playerid, params[])
  1340. {
  1341. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1342. new iTargetID,
  1343. iReduce,
  1344. string[64];
  1345. if(sscanf(params, "ud", iTargetID, iReduce)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /reducesentence [playerid] [percentage to reduce (1 - 30)]");
  1346. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1347. else if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1348. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1349. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[RED]", true) != -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player has already had their time reduced.");
  1350. else if(iReduce >= 1 && iReduce <= 30)
  1351. {
  1352. new StartJail = PlayerInfo[iTargetID][pJailTime];
  1353. new Float:EndJail;
  1354. new Float:Manip;
  1355. Manip = 1.0 - (float(iReduce) / 100);
  1356. EndJail = StartJail * Manip;
  1357. PlayerInfo[iTargetID][pJailTime] = floatround(EndJail);
  1358. format(string, sizeof(string), "Your jail time has been reduced by %s by %d percent.", GetPlayerNameEx(playerid), iReduce);
  1359. SendClientMessageEx(iTargetID, COLOR_RED, string);
  1360. format(string, sizeof(string), "You have reduced %s's jail sentence by %d percent.", GetPlayerNameEx(iTargetID), iReduce);
  1361. SendClientMessageEx(playerid, COLOR_RED, string);
  1362. format(string, sizeof(string), "Original Time: %s ------ New Time: %s", TimeConvert(StartJail), TimeConvert(PlayerInfo[iTargetID][pJailTime]));
  1363. SendClientMessageEx(playerid, COLOR_RED, string);
  1364. strcat(PlayerInfo[iTargetID][pPrisonReason], "[RED]", 128);
  1365. 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]));
  1366. GroupLog(PlayerInfo[playerid][pMember], string);
  1367. }
  1368. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: The reduction percentage cannot be less than 1 or greater than 10.");
  1369. return 1;
  1370. }
  1371. CMD:isolateinmate(playerid, params[])
  1372. {
  1373. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1374. new iTargetID,
  1375. iCellID,
  1376. string[128];
  1377. if(sscanf(params, "ud", iTargetID, iCellID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /isolateinmate [playerid] [cellid]");
  1378. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1379. else if(!IsPlayerConnected(iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1380. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1381. else if(!(0 <= iCellID < sizeof(DocIsolation))) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: Valid Isolation Cells [0-24]");
  1382. else if(PlayerInfo[iTargetID][pIsolated] == 0)
  1383. {
  1384. DocIsolate(iTargetID, iCellID, 0);
  1385. format(string, sizeof(string), "You have been sent to isolation by %s.", GetPlayerNameEx(playerid));
  1386. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, string);
  1387. format(string, sizeof(string), "You have sent %s to isolation.", GetPlayerNameEx(iTargetID));
  1388. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1389. format(string, sizeof string, "%s has sent %s to isolation.", GetPlayerNameEx(playerid), GetPlayerNameExt(iTargetID));
  1390. GroupLog(PlayerInfo[playerid][pMember], string);
  1391. }
  1392. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is already in isolation.");
  1393. return 1;
  1394. }
  1395. CMD:unisolateinmate(playerid, params[])
  1396. {
  1397. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1398. new iTargetID,
  1399. string[128];
  1400. if(sscanf(params, "u", iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /unisolateinmate [playerid]");
  1401. else if(strfind(PlayerInfo[iTargetID][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail");
  1402. else if(iTargetID == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1403. else if(PlayerInfo[iTargetID][pIsolated] == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in isolation");
  1404. else if(IsPlayerConnected(iTargetID))
  1405. {
  1406. PlayerInfo[iTargetID][pIsolated] = 0;
  1407. PlayerInfo[iTargetID][pVW] = 0;
  1408. format(string, sizeof(string), "You have been released from isolation by %s.", GetPlayerNameEx(playerid));
  1409. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, string);
  1410. format(string, sizeof(string), "You have released %s from isolation.", GetPlayerNameEx(iTargetID));
  1411. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1412. format(string, sizeof string, "%s has brought %s back from isolation.", GetPlayerNameEx(playerid), GetPlayerNameExt(iTargetID));
  1413. GroupLog(PlayerInfo[playerid][pMember], string);
  1414. }
  1415. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1416. return 1;
  1417. }
  1418. /*CMD:joinjailboxing(playerid, params[])
  1419. {
  1420. if(IsPlayerAtJailBoxing(playerid))
  1421. {
  1422. if(GetPVarInt(playerid, "_InJailBoxing") != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're already in a boxing arena. Use /leavejailboxing to leave.");
  1423. else if(arrJailBoxingData[GetClosestJailBoxingRing(playerid)][bInProgress] == true) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are unable to join a boxing match that is in progress.");
  1424. else SetPlayerIntoJailBoxing(playerid);
  1425. }
  1426. else SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in range of a jail boxing ring.");
  1427. return 1;
  1428. }
  1429. CMD:leavejailboxing(playerid, params[])
  1430. {
  1431. if(GetPVarInt(playerid, "_InJailBoxing") == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not in a boxing arena. Please use /joinjailboxing to join one.");
  1432. else if(arrJailBoxingData[GetClosestJailBoxingRing(playerid)][bInProgress] == true) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are unable to leave a boxing match that is in progress.");
  1433. else
  1434. {
  1435. RemoveFromJailBoxing(playerid);
  1436. SendClientMessageEx(playerid, COLOR_WHITE, "You have withdrawn yourself from the boxing arena queue.");
  1437. }
  1438. return 1;
  1439. }*/
  1440. /*CMD:startbrawl(playerid, params[])
  1441. {
  1442. new iTargetID,
  1443. string[MAX_PLAYER_NAME + 35];
  1444. if(sscanf(params, "u", iTargetID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /startbrawl [playerid]");
  1445. else if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "You must be in IC jail to do this.");
  1446. else if(!ProxDetectorS(8.0, playerid, iTargetID)) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not in range of that player.");
  1447. else if(IsPlayerConnected(iTargetID))
  1448. {
  1449. SetPVarInt(playerid, "_InJailBrawl", iTargetID + 1);
  1450. SetPVarInt(iTargetID, "_InJailBrawl", playerid + 1);
  1451. format(string, sizeof(string), "You have initiated a brawl with %s", GetPlayerNameEx(iTargetID));
  1452. SendClientMessageEx(playerid, COLOR_RED, string);
  1453. format(string, sizeof(string), "%s has initiated a brawl with you", GetPlayerNameEx(playerid));
  1454. SendClientMessageEx(iTargetID, COLOR_RED, string);
  1455. }
  1456. else SendClientMessageEx(playerid, COLOR_GRAD2, "That player is not connected.");
  1457. return 1;
  1458. }*/
  1459. CMD:docjudgesubpoena(playerid, params[])
  1460. {
  1461. new iTargetID,
  1462. szCaseName[128],
  1463. szString[128];
  1464. if(sscanf(params, "us[128]", iTargetID, szCaseName)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docjudgesubpoena [playerid] [case reason]");
  1465. if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That player is not connected");
  1466. 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");
  1467. else if(IsAJudge(playerid))
  1468. {
  1469. format(szString, sizeof(szString), "You have subpoenaed %s. Case: %s", GetPlayerNameEx(iTargetID), szCaseName);
  1470. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szString);
  1471. format(szString, sizeof(szString), "You have been subpoenaed by %s. Case %s", GetPlayerNameEx(playerid), szCaseName);
  1472. SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szString);
  1473. }
  1474. else SendClientMessageEx(playerid, COLOR_GREY, "You must be a judge to use this command");
  1475. return 1;
  1476. }
  1477. CMD:docjudgecharge(playerid, params[])
  1478. {
  1479. new iTargetID,
  1480. iTime,
  1481. iFine,
  1482. szCountry[5],
  1483. szReason[128],
  1484. szCrime[128],
  1485. szMessage[128];
  1486. if(sscanf(params, "udds[128]", iTargetID, iTime, iFine, szReason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docjudgecharge [playerid] [time] [fine] [reason]");
  1487. 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");
  1488. if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That player is not connected");
  1489. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a judge to use this command");
  1490. if(ProxDetectorS(14.0, playerid, iTargetID))
  1491. {
  1492. PlayerInfo[iTargetID][pWantedJailTime] += iTime;
  1493. PlayerInfo[iTargetID][pWantedJailFine] += iFine;
  1494. if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == 1)
  1495. {
  1496. format(szCountry, sizeof(szCountry), "[SA] ");
  1497. }
  1498. else if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == 2)
  1499. {
  1500. format(szCountry, sizeof(szCountry), "[NE] ");
  1501. }
  1502. strcat(szCrime, szCountry);
  1503. strcat(szCrime, szReason);
  1504. AddCrime(playerid, iTargetID, szCrime);
  1505. format(szMessage, sizeof(szMessage), "You've commited a crime ( %s ). Reporter: %s.", szCrime, GetPlayerNameEx(playerid));
  1506. SendClientMessageEx(iTargetID, COLOR_LIGHTRED, szMessage);
  1507. format(szMessage, sizeof(szMessage), "Current wanted level: %d", PlayerInfo[iTargetID][pWantedLevel]);
  1508. SendClientMessageEx(iTargetID, COLOR_YELLOW, szMessage);
  1509. format(szMessage, sizeof(szMessage), "You have charged %s with a crime.", GetPlayerNameEx(iTargetID));
  1510. SendClientMessage(playerid, COLOR_LIGHTRED, szMessage);
  1511. format(szMessage, sizeof(szMessage), "%s: Time: %i minutes. Fine: %i", szCrime, iTime, iFine);
  1512. SendClientMessage(playerid, COLOR_LIGHTRED, szMessage);
  1513. }
  1514. else SendClientMessageEx(playerid, COLOR_WHITE, "You must be in range of that player");
  1515. return 1;
  1516. }
  1517. CMD:docjudgesentence(playerid, params[])
  1518. {
  1519. new iSuspect,
  1520. string[256];
  1521. if(sscanf(params, "u", iSuspect)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docjudgesentence [suspect]");
  1522. 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");
  1523. if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "ERROR: That player is not connected");
  1524. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a judge to use this command");
  1525. if(ProxDetectorS(14.0, playerid, iSuspect))
  1526. {
  1527. SetPVarInt(playerid, "Arrest_Price", PlayerInfo[iSuspect][pWantedJailFine]);
  1528. SetPVarInt(playerid, "Arrest_Time", PlayerInfo[iSuspect][pWantedJailTime]);
  1529. SetPVarInt(playerid, "Arrest_Suspect", iSuspect);
  1530. SetPVarInt(playerid, "Arrest_Type", 3);
  1531. 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));
  1532. ShowPlayerDialogEx(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Arrest Report", string, "Submit", "");
  1533. }
  1534. else SendClientMessageEx(playerid, COLOR_WHITE, "You must be in range of that player");
  1535. return 1;
  1536. }
  1537. CMD:jailcuff(playerid, params[])
  1538. {
  1539. if(IsACop(playerid))
  1540. {
  1541. if(GetPVarInt(playerid, "Injured") == 1 || GetPVarInt(playerid, "jailcuffs") > 0 || PlayerCuffed[ playerid ] >= 1 || PlayerInfo[ playerid ][ pJailTime ] > 0 || PlayerInfo[playerid][pHospital] > 0)
  1542. {
  1543. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1544. return 1;
  1545. }
  1546. if(PlayerInfo[playerid][pHasCuff] < 1)
  1547. {
  1548. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any pair of cuffs on you!");
  1549. return 1;
  1550. }
  1551. new string[128], giveplayerid;
  1552. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /jailcuff [player]");
  1553. if(IsPlayerConnected(giveplayerid))
  1554. {
  1555. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1556. {
  1557. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
  1558. if(GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP || PlayerCuffed[giveplayerid] == 1 || GetPVarInt(playerid, "pBagged") >= 1)
  1559. {
  1560. format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
  1561. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1562. format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
  1563. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1564. format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1565. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1566. GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
  1567. ClearAnimationsEx(giveplayerid);
  1568. TogglePlayerControllable(giveplayerid, 0);
  1569. SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
  1570. TogglePlayerControllable(giveplayerid, 1);
  1571. DeletePVar(playerid, "pBagged");
  1572. SetPVarInt(giveplayerid, "jailcuffs", 1);
  1573. }
  1574. else if(GetPVarType(giveplayerid, "IsTackled"))
  1575. {
  1576. format(string, sizeof(string), "* %s removes a set of cuffs from his belt and attempts to cuff %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1577. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1578. SetTimerEx("CuffTackled", 4000, 0, "ii", playerid, giveplayerid);
  1579. }
  1580. else
  1581. {
  1582. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't restrained!");
  1583. return 1;
  1584. }
  1585. }
  1586. else
  1587. {
  1588. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1589. return 1;
  1590. }
  1591. }
  1592. else
  1593. {
  1594. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1595. return 1;
  1596. }
  1597. }
  1598. else
  1599. {
  1600. SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
  1601. }
  1602. return 1;
  1603. }
  1604. // WINTERFIELD: VERSION .278 PRISON SYSTEM
  1605. CMD:prisonhelp(playerid, params[])
  1606. {
  1607. SendClientMessageEx(playerid, COLOR_WHITE, "-------------------------------------------------------------------------------------------------------------------------------------");
  1608. SendClientMessageEx(playerid, COLOR_GREY, "GENERAL: /prisonhelp, /getfood, /eatfood, /dropfoodtray, /acceptinmatefood, /jailcall, /jailhangup, /prisoncraft, /prisoninv(entory)");
  1609. if(strfind(PlayerInfo[playerid][pPrisonReason], "[DNRL]", true) != -1) { SendClientMessageEx(playerid, COLOR_GREY, "LIFE SENTENCE: /docrelease"); }
  1610. if(IsADocGuard(playerid)) {
  1611. SendClientMessageEx(playerid, COLOR_GREY, "GUARD: /reducesentence, /extendsentence, /(jail)cuff, /(get)(offer)inmatefood, /listprisoners, /inmates, /acceptrelease");
  1612. SendClientMessageEx(playerid, COLOR_GREY, "GUARD: /denyrelease, /beanbag, /(un)isolateinmate, /oocisolateinmate, /loadinmates, /deliverinmates, /giveprisoncredits");
  1613. }
  1614. if(IsADocGuard(playerid) && PlayerInfo[playerid][pLeader] != INVALID_GROUP_ID) {
  1615. SendClientMessageEx(playerid, COLOR_GREY, "LEADER: /setbail, /takeprisoncredits, /changeinmatecell, /prisonermotd");
  1616. }
  1617. if(IsAJudge(playerid)) { SendClientMessageEx(playerid, COLOR_GREY, "JUDGE: /docjudgesentence, /docjudgecharge, /docjudgesubpoena"); }
  1618. if(GetPVarInt(playerid, "pPrisonShank") >= 1) { SendClientMessageEx(playerid, COLOR_GREY, "SHANK: /shank - increases damage upon punching. | usable 15 times before 'breaking.'"); }
  1619. if(GetPVarInt(playerid, "pPrisonCellChisel") >= 1) { SendClientMessageEx(playerid, COLOR_GREY, "CELL: /celldeposit, /cellwithdraw"); }
  1620. if(GetPVarInt(playerid, "pPrisonWine") >= 1 || GetPVarInt(playerid, "pPrisonMWine") >= 1) { SendClientMessageEx(playerid, COLOR_GREY, "WINE: /finishpruno, /drinkpruno - increases damage upon punching. | forces drunk walk."); }
  1621. SendClientMessageEx(playerid, COLOR_WHITE, "-------------------------------------------------------------------------------------------------------------------------------------");
  1622. return 1;
  1623. }
  1624. CMD:beanbag(playerid, params[])
  1625. {
  1626. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1627. if(GetPlayerWeapon(playerid) == 25)
  1628. {
  1629. new string[128];
  1630. if(GetPVarInt(playerid, "pBeanBag") >= 1)
  1631. {
  1632. format(string, sizeof string, "{FF8000}* {C2A2DA}%s loads their shotgun with live action rounds.", GetPlayerNameEx(playerid));
  1633. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
  1634. format(string, sizeof string, "{FF8000}> {C2A2DA}%s loads their shotgun with live action rounds.", GetPlayerNameEx(playerid));
  1635. SendClientMessage(playerid, COLOR_PURPLE, string);
  1636. DeletePVar(playerid, "pBeanBag");
  1637. }
  1638. else
  1639. {
  1640. format(string, sizeof string, "{FF8000}* {C2A2DA}%s loads their shotgun with beanbag rounds.", GetPlayerNameEx(playerid));
  1641. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
  1642. format(string, sizeof string, "{FF8000}> {C2A2DA}%s loads their shotgun with beanbag rounds.", GetPlayerNameEx(playerid));
  1643. SendClientMessage(playerid, COLOR_PURPLE, string);
  1644. SetPVarInt(playerid, "pBeanBag", 1);
  1645. }
  1646. }
  1647. else SendClientMessageEx(playerid, COLOR_GREY, "You need to equip a shotgun!");
  1648. return 1;
  1649. }
  1650. CMD:giveprisoncredits(playerid, params[]) // these NEED to show up on /frisk and /inv (only when the player is in prison)
  1651. {
  1652. new id, amount, string[128];
  1653. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1654. if(sscanf(params, "ud", id, amount)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /giveprisoncredits [playerid] [amount]");
  1655. if(strfind(PlayerInfo[id][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_GREY, "This player is not in prison!");
  1656. if(!(0 < amount < 51)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You specified an invalid amount (1 - 50).");
  1657. if (ProxDetectorS(16.0, playerid, id))
  1658. {
  1659. if(GetPVarInt(playerid, "pGivePCred") < gettime())
  1660. {
  1661. format(string, sizeof string, "{FF8000}* {C2A2DA}%s has handed %s some prison credits.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  1662. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
  1663. SendClientMessage(playerid, COLOR_PURPLE, string);
  1664. PlayerInfo[id][pPrisonCredits] += amount; // these need to be added to the db and the enum
  1665. SetPVarInt(playerid, "pGivePCred", gettime() + 10);
  1666. format(string, sizeof string, "%s has gifted %s %d prison credits.", GetPlayerNameEx(playerid), GetPlayerNameEx(id), amount);
  1667. GroupLog(PlayerInfo[playerid][pMember], string);
  1668. }
  1669. else return SendClientMessageEx(playerid, COLOR_GREY, " You must wait 10 seconds between each prison credit transaction.");
  1670. }
  1671. else SendClientMessageEx(playerid, COLOR_GREY, " You must be near this player.");
  1672. return 1;
  1673. }
  1674. CMD:takeprisoncredits(playerid, params[])
  1675. {
  1676. new id, amount, string[128];
  1677. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1678. if(PlayerInfo[playerid][pLeader] == INVALID_GROUP_ID) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a group leader.");
  1679. if(sscanf(params, "ud", id, amount)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /takeprisoncredits [playerid] [amount]");
  1680. if(!(0 < amount < 100)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You specified an invalid amount (1 - 100).");
  1681. if(amount > PlayerInfo[id][pPrisonCredits]) return SendClientMessageEx(playerid, COLOR_GRAD1, " They don't have that many.");
  1682. if(strfind(PlayerInfo[id][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_GREY, "This player is not in prison!");
  1683. if (ProxDetectorS(16.0, playerid, id))
  1684. {
  1685. if(GetPVarInt(playerid, "pGivePCred") < gettime())
  1686. {
  1687. format(string, sizeof string, "{FF8000}* {C2A2DA}%s has taken some of %s's prison credits.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  1688. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
  1689. SendClientMessage(playerid, COLOR_PURPLE, string);
  1690. PlayerInfo[id][pPrisonCredits] -= amount; // these need to be added to the db and the enum
  1691. SetPVarInt(playerid, "pGivePCred", gettime() + 10);
  1692. format(string, sizeof string, "%s has taken %d prison credits from %s.", GetPlayerNameEx(playerid), amount, GetPlayerNameEx(id));
  1693. GroupLog(PlayerInfo[playerid][pMember], string);
  1694. }
  1695. else return SendClientMessageEx(playerid, COLOR_GREY, " You must wait 10 seconds between each prison credit transaction.");
  1696. }
  1697. else SendClientMessageEx(playerid, COLOR_GREY, " You must be near this player.");
  1698. return 1;
  1699. }
  1700. CMD:changeinmatecell(playerid, params[])
  1701. {
  1702. new id, amount;
  1703. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1704. if(PlayerInfo[playerid][pLeader] == INVALID_GROUP_ID) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a group leader.");
  1705. if(sscanf(params, "ud", id, amount)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /changeinmatecell [playerid] [cell]");
  1706. if(!(-1 < amount < 30)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You specified an invalid amount (0 - 29).");
  1707. if(PlayerInfo[id][pIsolated] >= 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't change the cell of an insolated inmate.");
  1708. if(strfind(PlayerInfo[id][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_GREY, "This player is not in prison!");
  1709. PlayerInfo[id][pPrisonCell] = amount;
  1710. format(szMiscArray, sizeof(szMiscArray), "You have set %s's cell to: %d", GetPlayerNameEx(id), amount);
  1711. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  1712. format(szMiscArray, sizeof(szMiscArray), "Your cell has been set to %d by %s", amount, GetPlayerNameEx(playerid));
  1713. SendClientMessageEx(id, COLOR_YELLOW, szMiscArray);
  1714. format(szMiscArray, sizeof szMiscArray, "%s has set %s's bail price to $%s.", GetPlayerNameEx(playerid), GetPlayerNameEx(id), PlayerInfo[id][pPrisonCell]);
  1715. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  1716. return 1;
  1717. }
  1718. CMD:setbail(playerid, params[]) { // Can no longer set negative bail prices & bail price deducted significantly.
  1719. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be in DoC to use this command.");
  1720. if(PlayerInfo[playerid][pLeader] == INVALID_GROUP_ID) return SendClientMessageEx(playerid, COLOR_GREY, " You must be a group leader.");
  1721. new uPlayer,
  1722. iBail;
  1723. if(sscanf(params, "ud", uPlayer, iBail)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /setbail [player] [amount]");
  1724. if(strfind(PlayerInfo[uPlayer][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_GREY, "This player is not in prison!");
  1725. if(!(0 < iBail <= 15000000)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You specified an invalid amount ($1 - $15,000,000).");
  1726. PlayerInfo[uPlayer][pBailPrice] = iBail;
  1727. format(szMiscArray, sizeof(szMiscArray), "You have set %s's bail to: $%s", GetPlayerNameEx(uPlayer), number_format(iBail));
  1728. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  1729. format(szMiscArray, sizeof(szMiscArray), "Your bail has been set to $%s by %s", number_format(iBail), GetPlayerNameEx(playerid));
  1730. SendClientMessageEx(uPlayer, COLOR_YELLOW, szMiscArray);
  1731. format(szMiscArray, sizeof szMiscArray, "%s has set %s's bail price to $%s.", GetPlayerNameEx(playerid), GetPlayerNameEx(uPlayer), number_format(PlayerInfo[uPlayer][pBailPrice]));
  1732. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  1733. return 1;
  1734. }
  1735. CMD:shank(playerid, params[])
  1736. {
  1737. if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) != -1)
  1738. {
  1739. if(GetPVarInt(playerid, "pPrisonShank") >= 1)
  1740. {
  1741. new string[156];
  1742. if(GetPVarInt(playerid, "pPrisonShankOut") == 1)
  1743. {
  1744. format(string, sizeof string, "{FF8000}> {C2A2DA}%s secretly holsters a prison shank.", GetPlayerNameEx(playerid));
  1745. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1746. SendClientMessage(playerid, COLOR_PURPLE, string);
  1747. DeletePVar(playerid, "pPrisonShankOut");
  1748. RemovePlayerAttachedObject(playerid, 9);
  1749. }
  1750. else
  1751. {
  1752. format(string, sizeof string, "{FF8000}> {C2A2DA}%s secretly unholsters a prison shank.", GetPlayerNameEx(playerid));
  1753. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1754. SendClientMessage(playerid, COLOR_PURPLE, string);
  1755. SetPVarInt(playerid, "pPrisonShankOut", 1);
  1756. SetPlayerAttachedObject(playerid, 9, 335, 6);
  1757. }
  1758. }
  1759. else return SendClientMessageEx(playerid, COLOR_GREY, " You don't have a shank!");
  1760. }
  1761. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  1762. return 1;
  1763. }
  1764. CMD:oocisolateinmate(playerid, params[])
  1765. {
  1766. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1767. new id, cell, string[128];
  1768. if(sscanf(params, "ud", id, cell)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /oocisolateinmate [playerid] [cellid]");
  1769. else if(id == playerid) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You cannot use this command on yourself.");
  1770. else if(!IsPlayerConnected(id)) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
  1771. else if(strfind(PlayerInfo[id][pPrisonReason], "[IC]", true) == -1) return SendClientMessageEx(playerid, COLOR_WHITE, "That player is not in IC Jail.");
  1772. else if(!(0 <= cell < sizeof(DocIsolation))) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: Valid Isolation Cells [0-24]");
  1773. else if(PlayerInfo[id][pIsolated] == 0)
  1774. {
  1775. DocIsolate(id, cell, 1);
  1776. format(string, sizeof(string), "You have been sent to OOC isolation by %s.", GetPlayerNameEx(playerid));
  1777. SendClientMessageEx(id, COLOR_LIGHTBLUE, string);
  1778. format(string, sizeof(string), "You have sent %s to OOC isolation.", GetPlayerNameEx(id));
  1779. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1780. format(string, sizeof string, "%s has sent %s to OOC isolation.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  1781. GroupLog(PlayerInfo[playerid][pMember], string);
  1782. }
  1783. else SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: That player is already in (ooc)isolation.");
  1784. return 1;
  1785. }
  1786. CMD:docrelease(playerid, params)
  1787. {
  1788. if(PlayerInfo[playerid][pJailTime] > 0 && strfind(PlayerInfo[playerid][pPrisonReason], "[DNRL]", true) != -1)
  1789. {
  1790. if(GetPVarInt(playerid, "Injured") == 1 || GetPVarInt(playerid, "jailcuffs") > 0 || GetPVarInt(playerid, "_pBeingReleased") >= 1 || PlayerCuffed[ playerid ] >= 1 || PlayerInfo[playerid][pHospital] > 0)
  1791. {
  1792. return SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1793. }
  1794. if(GetPVarInt(playerid, "_pBeingReleased") == -1) return SendClientMessageEx(playerid, COLOR_GREY, "You must wait 45 seconds before doing this again.");
  1795. new string[258];
  1796. format( string, sizeof(string), "ALERT: Inmate %s is requesting to be released. Type /acceptrelease or /denyrelease. They will be released in 45 seconds.", GetPlayerNameEx(playerid));
  1797. foreach(new i: Player)
  1798. {
  1799. if(IsADocGuard(i)) { SendClientMessageEx(i, COLOR_RED, string); }
  1800. }
  1801. SetPVarInt(playerid, "_pBeingReleased", 1);
  1802. TogglePlayerControllable(playerid, FALSE);
  1803. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have requested to be released from prison, waiting for a guard to accept...");
  1804. SetTimerEx("_ReleaseTimer", 45000, false, "d", playerid);
  1805. }
  1806. else SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command when you're serving a life sentence.");
  1807. return 1;
  1808. }
  1809. CMD:acceptrelease(playerid, params[])
  1810. {
  1811. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1812. new id;
  1813. if(sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_GREY, "Usage: /acceptrelease [player]");
  1814. if(strfind(PlayerInfo[id][pPrisonReason], "[DNRL]", true) != -1 && GetPVarInt(id, "_pBeingReleased") >= 1)
  1815. {
  1816. new string[128];
  1817. ReleasePlayerFromPrison(id);
  1818. format(string, sizeof(string), "You have accepted %s's release request.", GetPlayerNameEx(id));
  1819. SendClientMessageEx(playerid, COLOR_GREY, string);
  1820. DeletePVar(id, "_pBeingReleased");
  1821. format(szMiscArray, sizeof szMiscArray, "%s has accepted %s's release request.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  1822. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  1823. }
  1824. else SendClientMessage(playerid, COLOR_GRAD1, "You cannot use this command on an inmate who has not served their initial sentence or does not have a release request.");
  1825. return 1;
  1826. }
  1827. CMD:denyrelease(playerid, params[])
  1828. {
  1829. if(!IsADocGuard(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You must be a DOC Guard to use this command.");
  1830. new id, reason[128];
  1831. if(sscanf(params, "us[128]", id, reason)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /denyrelease [player] [reason]");
  1832. if(strfind(PlayerInfo[id][pPrisonReason], "[DNRL]", true) != -1 && GetPVarInt(id, "_pBeingReleased") >= 1)
  1833. {
  1834. new string[128];
  1835. format(string, sizeof(string), "You have denied %s's release request for: %s.", GetPlayerNameEx(id), reason);
  1836. SendClientMessageEx(playerid, COLOR_GREY, string);
  1837. format(string, sizeof(string), "%s has denied your release request. Reason: %s", GetPlayerNameEx(playerid), reason);
  1838. SendClientMessageEx(id, COLOR_GREY, string);
  1839. DeletePVar(id, "_pBeingReleased");
  1840. TogglePlayerControllable(id, TRUE);
  1841. format(szMiscArray, sizeof szMiscArray, "%s has denied %s's release request. Reason: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(id), reason);
  1842. GroupLog(PlayerInfo[playerid][pMember], szMiscArray);
  1843. }
  1844. else SendClientMessage(playerid, COLOR_GRAD1, "You cannot use this command on an inmate who has not served their initial sentence or does not have a release request.");
  1845. return 1;
  1846. }
  1847. CMD:prisoncraft(playerid, params[])
  1848. {
  1849. if (PlayerInfo[playerid][pJailTime] > 0)
  1850. {
  1851. if(GetPVarInt(playerid, "Injured") == 1 || GetPVarInt(playerid, "jailcuffs") > 0 || GetPVarInt(playerid, "_pBeingReleased") >= 1 || PlayerCuffed[ playerid ] >= 1 || PlayerInfo[playerid][pHospital] > 0)
  1852. {
  1853. return SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1854. }
  1855. new value[32], string[128];
  1856. if(sscanf(params, "s[32]", value))
  1857. {
  1858. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  1859. SendClientMessageEx(playerid, COLOR_YELLOW, "<< Available prison crafts >>");
  1860. SendClientMessageEx(playerid, COLOR_GRAD1, "shank\t\t\t\t\t\t\t\t\t\tpruno");
  1861. SendClientMessageEx(playerid, COLOR_GRAD1, "radio\t\t\t\t\t\t\t\t\t\tchisel");
  1862. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  1863. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /prisoncraft [craftname]");
  1864. return 1;
  1865. }
  1866. if(strcmp(value, "shank", true) == 0)
  1867. {
  1868. if(GetPVarInt(playerid, "pPrisonShank") >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "You already have a prison shank.");
  1869. if(PlayerInfo[playerid][pPrisonMaterials] <= 3) return SendClientMessageEx(playerid, COLOR_GREY, "You need to obtain 4 prison materials.");
  1870. format(string, sizeof string, "{FF8000}> {C2A2DA}%s secretly crafts a shank.", GetPlayerNameEx(playerid));
  1871. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1872. SendClientMessage(playerid, COLOR_PURPLE, string);
  1873. PlayerInfo[playerid][pPrisonMaterials] -= 3;
  1874. SetPVarInt(playerid, "pPrisonShank", 1);
  1875. SetPVarInt(playerid, "pShankUsages", 15);
  1876. DeletePVar(playerid, "pPrisonShankOut");
  1877. }
  1878. else if(strcmp(value, "pruno", true) == 0)
  1879. {
  1880. if(GetPVarInt(playerid, "pPrisonWine") >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "You already have wine.");
  1881. if(PlayerInfo[playerid][pPrisonMaterials] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You need to obtain a prison material.");
  1882. if(GetPVarInt(playerid, "pPrisonSugar") < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You need to buy 3 packets of sugar.");
  1883. if(GetPVarInt(playerid, "pPrisonBread") == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You need to buy a loaf of bread.");
  1884. if(IsPlayerInCell(playerid))
  1885. {
  1886. format(string, sizeof string, "{FF8000}> {C2A2DA}%s stuffs some bread into their toilet, pouring sugar over it.", GetPlayerNameEx(playerid));
  1887. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1888. SendClientMessage(playerid, COLOR_PURPLE, string);
  1889. SendClientMessage(playerid, COLOR_GREY, "You have started to make pruno. It will be ready in twelve hours. Use /prisoninv(entory) to check the progress.");
  1890. PlayerInfo[playerid][pPrisonMaterials] -= 1;
  1891. SetPVarInt(playerid, "pPrisonSugar", GetPVarInt(playerid, "pPrisonSugar") - 3);
  1892. SetPVarInt(playerid, "pPrisonBread", GetPVarInt(playerid, "pPrisonBread") - 1);
  1893. SetPVarInt(playerid, "pPrisonMWine", 1);
  1894. PlayerInfo[playerid][pPrisonWineTime] = gettime()+43200;
  1895. }
  1896. else return SendClientMessageEx(playerid, COLOR_GREY, " You are not in your prison cell!");
  1897. }
  1898. else if(strcmp(value, "radio", true) == 0)
  1899. {
  1900. if(PlayerInfo[playerid][pPrisonMaterials] < 9) return SendClientMessageEx(playerid, COLOR_GREY, "You need to obtain ten prison materials.");
  1901. if(PlayerInfo[playerid][pRadio] == 1) return SendClientMessageEx(playerid, COLOR_GREY, "You already have a radio.");
  1902. format(string, sizeof string, "{FF8000}> {C2A2DA}%s crafts a radio with some materials.", GetPlayerNameEx(playerid));
  1903. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1904. SendClientMessage(playerid, COLOR_PURPLE, string);
  1905. PlayerInfo[playerid][pRadio] = 1;
  1906. SendClientMessage(playerid, COLOR_GREY, "You have crafted a radio. Use /pr to communicate.");
  1907. }
  1908. else if(strcmp(value, "chisel", true) == 0)
  1909. {
  1910. if(GetPVarInt(playerid, "pPrisonChisel") >= 1) return SendClientMessageEx(playerid, COLOR_GREY, "You already have a chisel.");
  1911. if(PlayerInfo[playerid][pPrisonMaterials] < 4) return SendClientMessageEx(playerid, COLOR_GREY, "You need to obtain five prison materials.");
  1912. format(string, sizeof string, "{FF8000}> {C2A2DA}%s flattens some metal into an object.", GetPlayerNameEx(playerid));
  1913. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1914. SendClientMessage(playerid, COLOR_PURPLE, string);
  1915. SetPVarInt(playerid, "pPrisonChisel", 1);
  1916. SendClientMessage(playerid, COLOR_GREY, "You have crafted a chisel. Press Y in your cell to dig a hole. This chisel will go away after one use.");
  1917. PlayerInfo[playerid][pPrisonMaterials] -= 5;
  1918. }
  1919. else if(isnull(value))
  1920. {
  1921. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  1922. SendClientMessageEx(playerid, COLOR_YELLOW, "<< Available prison crafts >>");
  1923. SendClientMessageEx(playerid, COLOR_GRAD1, "shank\t\t\t\t\t\t\t\t\t\tpruno");
  1924. SendClientMessageEx(playerid, COLOR_GRAD1, "radio\t\t\t\t\t\t\t\t\t\tchisel");
  1925. SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
  1926. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /prisoncraft [craftname]");
  1927. return 1;
  1928. }
  1929. }
  1930. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  1931. return 1;
  1932. }
  1933. CMD:drinkpruno(playerid, params[])
  1934. {
  1935. if(PlayerInfo[playerid][pJailTime] > 0)
  1936. {
  1937. if(GetPVarInt(playerid, "pPrisonWine") >= 1)
  1938. {
  1939. new string[256];
  1940. SetPVarInt(playerid, "pPrisonWine", GetPVarInt(playerid, "pPrisonWine") - 1);
  1941. format(string, sizeof string, "{FF8000}> {C2A2DA}%s drinks some pruno from a bottle.", GetPlayerNameEx(playerid));
  1942. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1943. SendClientMessage(playerid, COLOR_PURPLE, string);
  1944. SetPVarInt(playerid, "pWineConsumed", 1);
  1945. ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, 1, 1, 1, 1, 1, 1);
  1946. SetPlayerDrunkLevel(playerid, 10000);
  1947. SetTimerEx("_DrinkWineTimer", 30000, false, "d", playerid);
  1948. }
  1949. else return SendClientMessageEx(playerid, COLOR_GREY, " You do you not have any wine!");
  1950. }
  1951. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  1952. return 1;
  1953. }
  1954. CMD:finishpruno(playerid, params[]) // add to /interact
  1955. {
  1956. if(PlayerInfo[playerid][pJailTime] > 0)
  1957. {
  1958. if(GetPVarInt(playerid, "pPrisonMWine") >= 2)
  1959. {
  1960. if(PlayerInfo[playerid][pPrisonWineTime] <= gettime())
  1961. {
  1962. if(IsPlayerInCell(playerid))
  1963. {
  1964. new string[256];
  1965. SetPVarInt(playerid, "pPrisonWine", GetPVarInt(playerid, "pPrisonWine") + 1);
  1966. DeletePVar(playerid, "pPrisonMWine");
  1967. SendClientMessage(playerid, COLOR_WHITE, "You now have pruno, use /prisonhelp to learn how to use it.");
  1968. PlayerInfo[playerid][pPrisonWineTime] = 0;
  1969. format(string, sizeof string, "{FF8000}> {C2A2DA}%s dips a bottle into their toilet, secretly filling it with pruno.", GetPlayerNameEx(playerid));
  1970. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  1971. SendClientMessage(playerid, COLOR_PURPLE, string);
  1972. }
  1973. else return SendClientMessageEx(playerid, COLOR_GREY, " You are not in your cell");
  1974. }
  1975. else return SendClientMessageEx(playerid, COLOR_GREY, " Your pruno is not finished yet!");
  1976. }
  1977. else return SendClientMessageEx(playerid, COLOR_GREY, " You are not making pruno or your pruno is not finished yet!");
  1978. }
  1979. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  1980. return 1;
  1981. }
  1982. CMD:celldeposit(playerid, params[])
  1983. {
  1984. if(PlayerInfo[playerid][pJailTime] > 0)
  1985. {
  1986. new value, amount;
  1987. if(sscanf(params, "dd", value, amount))
  1988. {
  1989. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /celldeposit [value] [amount]");
  1990. SendClientMessageEx(playerid, COLOR_GREY, "Drugs: (1) LSD - (2) Cannabis - (3) Meth - (4) Heroin - (5) Cocaine - (6) Crack - (7) Opium");
  1991. SendClientMessageEx(playerid, COLOR_GREY, "Drugs: (8) Ecstasy - (9) Speed - (10) Alcohol - (11) Demerol - (12) Morphine - (13) Haloperidol - (14) Aspirin");
  1992. return 1;
  1993. }
  1994. if(IsPlayerInCell(playerid))
  1995. {
  1996. if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "Your amount must be greater than one.");
  1997. if(GetPVarInt(playerid, "pPrisonCellChisel") <= 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You need to use a chisel to cut a storage space. Otherwise, the guards will find it.");
  1998. switch(value)
  1999. {
  2000. case 1 .. 14:
  2001. {
  2002. new string[255];
  2003. if(PlayerInfo[playerid][pDrugs][value - 1] >= amount)
  2004. {
  2005. PlayerInfo[playerid][pDrugs][value - 1] -= amount;
  2006. PlayerInfo[playerid][p_iPrisonDrug][value - 1] += amount;
  2007. format(string, sizeof string, "{FF8000}> {C2A2DA}%s stashes some drugs in their cell.", GetPlayerNameEx(playerid));
  2008. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  2009. SendClientMessage(playerid, COLOR_PURPLE, string);
  2010. }
  2011. else return SendClientMessage(playerid, COLOR_GREY, "You don't have enough.");
  2012. }
  2013. default:
  2014. {
  2015. return SendClientMessageEx(playerid, COLOR_GREY, "Values are 1-14");
  2016. }
  2017. }
  2018. }
  2019. else return SendClientMessageEx(playerid, COLOR_GREY, " You are not in your cell!");
  2020. }
  2021. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  2022. return 1;
  2023. }
  2024. CMD:cellwithdraw(playerid, params[])
  2025. {
  2026. if(PlayerInfo[playerid][pJailTime] > 0)
  2027. {
  2028. new value, amount;
  2029. if(sscanf(params, "dd", value, amount))
  2030. {
  2031. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /prisoncellwithdraw [value] [amount]");
  2032. SendClientMessageEx(playerid, COLOR_GREY, "Drugs: (1) LSD - (2) Cannabis - (3) Meth - (4) Heroin - (5) Cocaine - (6) Crack - (7) Opium");
  2033. SendClientMessageEx(playerid, COLOR_GREY, "Drugs: (8) Ecstasy - (9) Speed - (10) Alcohol - (11) Demerol - (12) Morphine - (13) Haloperidol - (14) Aspirin");
  2034. return 1;
  2035. }
  2036. if(IsPlayerInCell(playerid))
  2037. {
  2038. if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "Your amount must be greater than one.");
  2039. if(GetPVarInt(playerid, "pPrisonCellChisel") <= 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You need to use a chisel to cut a storage space. Otherwise, the guards will find it.");
  2040. switch(value)
  2041. {
  2042. case 1 .. 14:
  2043. {
  2044. new string[255];
  2045. if(PlayerInfo[playerid][p_iPrisonDrug][value - 1] >= amount)
  2046. {
  2047. PlayerInfo[playerid][pDrugs][value - 1] += amount;
  2048. PlayerInfo[playerid][p_iPrisonDrug][value - 1] -= amount;
  2049. format(string, sizeof string, "{FF8000}> {C2A2DA}%s takes some drugs stashed their cell.", GetPlayerNameEx(playerid));
  2050. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  2051. SendClientMessage(playerid, COLOR_PURPLE, string);
  2052. }
  2053. else return SendClientMessage(playerid, COLOR_GREY, "You don't have enough.");
  2054. }
  2055. default:
  2056. {
  2057. return SendClientMessageEx(playerid, COLOR_GREY, "Values are 1-14");
  2058. }
  2059. }
  2060. }
  2061. else return SendClientMessageEx(playerid, COLOR_GREY, " You are not in your cell!");
  2062. }
  2063. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  2064. return 1;
  2065. }
  2066. CMD:prisoninv(playerid, params[])
  2067. {
  2068. if(PlayerInfo[playerid][pJailTime] > 0)
  2069. {
  2070. ShowPrisonInventory(playerid);
  2071. }
  2072. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  2073. return 1;
  2074. }
  2075. CMD:prisoninventory(playerid, params[])
  2076. {
  2077. if(PlayerInfo[playerid][pJailTime] > 0)
  2078. {
  2079. ShowPrisonInventory(playerid);
  2080. }
  2081. else SendClientMessageEx(playerid, COLOR_GREY, " You are not in prison!");
  2082. return 1;
  2083. }
  2084. IsPlayerInCell(playerid)
  2085. {
  2086. switch(PlayerInfo[playerid][pPrisonCell])
  2087. {
  2088. case 0: { if(IsPlayerInRangeOfPoint(playerid, 2, 566.7456,1444.0634,6000.4751)) return 1; }
  2089. case 1: { if(IsPlayerInRangeOfPoint(playerid, 2, 563.0581,1444.1854,6000.4751)) return 1; }
  2090. case 2: { if(IsPlayerInRangeOfPoint(playerid, 2, 559.4159,1443.9288,6000.4751)) return 1; }
  2091. case 3: { if(IsPlayerInRangeOfPoint(playerid, 2, 555.6315,1444.2306,6000.4751)) return 1; }
  2092. case 4: { if(IsPlayerInRangeOfPoint(playerid, 2, 552.0065,1444.1968,6000.4751)) return 1; }
  2093. case 5: { if(IsPlayerInRangeOfPoint(playerid, 2, 548.0844,1444.0985,6000.4751)) return 1; }
  2094. case 6: { if(IsPlayerInRangeOfPoint(playerid, 2, 544.6454,1444.1449,6000.4751)) return 1; }
  2095. case 7: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.5981,1447.5231,6000.4751)) return 1; }
  2096. case 8: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.4813,1450.9047,6000.4751)) return 1; }
  2097. case 9: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.4357,1454.4258,6000.4751)) return 1; }
  2098. case 10: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.7283,1458.2170,6000.4751)) return 1; }
  2099. case 11: { if(IsPlayerInRangeOfPoint(playerid, 2, 544.1293,1464.5228,6000.4751)) return 1; }
  2100. case 12: { if(IsPlayerInRangeOfPoint(playerid, 2, 547.7798,1464.7081,6000.4751)) return 1; }
  2101. case 13: { if(IsPlayerInRangeOfPoint(playerid, 2, 551.2144,1464.6027,6000.4751)) return 1; }
  2102. case 14: { if(IsPlayerInRangeOfPoint(playerid, 2, 557.2998,1464.8198,6000.4751)) return 1; }
  2103. // end of first floor
  2104. case 15: { if(IsPlayerInRangeOfPoint(playerid, 2, 566.3901,1443.7551,6004.4946)) return 1; }
  2105. case 16: { if(IsPlayerInRangeOfPoint(playerid, 2, 562.5015,1443.7295,6004.4946)) return 1; }
  2106. case 17: { if(IsPlayerInRangeOfPoint(playerid, 2, 559.0636,1444.0476,6004.4946)) return 1; }
  2107. case 18: { if(IsPlayerInRangeOfPoint(playerid, 2, 555.3583,1444.0355,6004.4946)) return 1; }
  2108. case 19: { if(IsPlayerInRangeOfPoint(playerid, 2, 551.9474,1443.7928,6004.4946)) return 1; }
  2109. case 20: { if(IsPlayerInRangeOfPoint(playerid, 2, 548.2891,1444.0117,6004.4946)) return 1; }
  2110. case 21: { if(IsPlayerInRangeOfPoint(playerid, 2, 544.8405,1444.0632,6004.4946)) return 1; }
  2111. case 22: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.6741,1447.4341,6004.4946)) return 1; }
  2112. case 23: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.6885,1451.2081,6004.4946)) return 1; }
  2113. case 24: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.7267,1454.9779,6004.4946)) return 1; }
  2114. case 25: { if(IsPlayerInRangeOfPoint(playerid, 2, 540.4955,1458.8861,6004.4946)) return 1; }
  2115. case 26: { if(IsPlayerInRangeOfPoint(playerid, 2, 543.8416,1464.8979,6004.4946)) return 1; }
  2116. case 27: { if(IsPlayerInRangeOfPoint(playerid, 2, 547.9120,1464.5593,6004.4946)) return 1; }
  2117. case 28: { if(IsPlayerInRangeOfPoint(playerid, 2, 551.5958,1464.7749,6004.4946)) return 1; }
  2118. case 29: { if(IsPlayerInRangeOfPoint(playerid, 2, 557.6133,1464.9932,6004.4946)) return 1; }
  2119. // end of second floor
  2120. }
  2121. return 0;
  2122. }
  2123. IsPlayerInAShower(playerid)
  2124. {
  2125. if(IsPlayerInRangeOfPoint(playerid, 1, 588.8344,1445.8480,6000.4751)) return 1;
  2126. if(IsPlayerInRangeOfPoint(playerid, 1, 588.8367,1444.4164,6000.4751)) return 1;
  2127. if(IsPlayerInRangeOfPoint(playerid, 1, 588.8370,1443.2065,6000.4751)) return 1;
  2128. if(IsPlayerInRangeOfPoint(playerid, 1, 588.8370,1441.8711,6000.4751)) return 1;
  2129. if(IsPlayerInRangeOfPoint(playerid, 1, 588.7004,1438.7772,6000.4751)) return 1;
  2130. if(IsPlayerInRangeOfPoint(playerid, 1, 587.4869,1438.7759,6000.4751)) return 1;
  2131. if(IsPlayerInRangeOfPoint(playerid, 1, 586.3864,1438.7767,6000.4751)) return 1;
  2132. if(IsPlayerInRangeOfPoint(playerid, 1, 585.2564,1438.7821,6000.4751)) return 1;
  2133. if(IsPlayerInRangeOfPoint(playerid, 1, 584.0064,1438.7770,6000.4751)) return 1;
  2134. if(IsPlayerInRangeOfPoint(playerid, 1, 582.7442,1438.7784,6000.4751)) return 1;
  2135. if(IsPlayerInRangeOfPoint(playerid, 1, 581.4688,1438.7760,6000.4751)) return 1;
  2136. if(IsPlayerInRangeOfPoint(playerid, 1, 580.2315,1438.7755,6000.4751)) return 1;
  2137. else return 0;
  2138. }
  2139. /* TESTING COMANDS - REMOVE removed*/
  2140. /*CMD:givemematerials(playerid, params[])
  2141. {
  2142. PlayerInfo[playerid][pPrisonMaterials] += 100000;
  2143. return 1;
  2144. }
  2145. CMD:givemeprisoncredits(playerid, params[])
  2146. {
  2147. PlayerInfo[playerid][pPrisonCredits] += 100000;
  2148. return 1;
  2149. }
  2150. CMD:mycell(playerid, params[])
  2151. {
  2152. new string[255];
  2153. format(string, sizeof(string), "%d.", PlayerInfo[playerid][pPrisonCell]);
  2154. SendClientMessage(playerid, COLOR_WHITE, string);
  2155. return 1;
  2156. }*/
  2157. ShowPrisonInventory(playerid)
  2158. {
  2159. new string[64];
  2160. SendClientMessageEx(playerid, COLOR_GREY, "------------------------------------------------------");
  2161. format(string, sizeof(string), "Prison Cell: %d.", PlayerInfo[playerid][pPrisonCell]);
  2162. SendClientMessageEx(playerid, COLOR_GREY, string);
  2163. SendClientMessage(playerid, COLOR_WHITE, "");
  2164. if(PlayerInfo[playerid][pPrisonCredits] >= 1)
  2165. {
  2166. format(string, sizeof string, "Prison Credits: %d.", PlayerInfo[playerid][pPrisonCredits]);
  2167. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2168. }
  2169. if(PlayerInfo[playerid][pPrisonMaterials] >= 1)
  2170. {
  2171. format(string, sizeof string, "Prison Materials: %d.", PlayerInfo[playerid][pPrisonMaterials]);
  2172. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2173. }
  2174. if(GetPVarInt(playerid, "pPrisonSoap") >= 1)
  2175. {
  2176. format(string, sizeof string, "Soap: %d.", GetPVarInt(playerid, "pPrisonSoap"));
  2177. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2178. }
  2179. if(GetPVarInt(playerid, "pPrisonSugar") >= 1)
  2180. {
  2181. format(string, sizeof string, "Sugar: %d.", GetPVarInt(playerid, "pPrisonSugar"));
  2182. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2183. }
  2184. if(GetPVarInt(playerid, "pPrisonBread") >= 1)
  2185. {
  2186. format(string, sizeof string, "Bread: %d.", GetPVarInt(playerid, "pPrisonBread"));
  2187. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2188. }
  2189. if(GetPVarInt(playerid, "pPrisonWine") >= 1)
  2190. {
  2191. format(string, sizeof string, "Pruno: %d.", GetPVarInt(playerid, "pPrisonWine"));
  2192. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2193. }
  2194. if(GetPVarInt(playerid, "pPrisonShank") >= 1)
  2195. {
  2196. format(string, sizeof string, "Shank: %d | Uses: %d", GetPVarInt(playerid, "pPrisonShank"), GetPVarInt(playerid, "pShankUsages"));
  2197. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2198. }
  2199. if(GetPVarInt(playerid, "pPrisonMWine") >= 1)
  2200. {
  2201. if(PlayerInfo[playerid][pPrisonWineTime] <= gettime())
  2202. {
  2203. SendClientMessageEx(playerid, COLOR_WHITE, "");
  2204. SendClientMessageEx(playerid, COLOR_GREY, "Pruno Time Left: 0 seconds.");
  2205. }
  2206. else
  2207. {
  2208. format(string, sizeof(string), "Pruno Time Left: %s.", TimeConvert(PlayerInfo[playerid][pPrisonWineTime]-gettime()));
  2209. SendClientMessageEx(playerid, COLOR_WHITE, "");
  2210. SendClientMessageEx(playerid, COLOR_GREY, string);
  2211. }
  2212. }
  2213. SendClientMessageEx(playerid, COLOR_GREY, "------------------------------------------------------");
  2214. return 1;
  2215. }
  2216. forward _UnbeanbagTimer(playerid);
  2217. public _UnbeanbagTimer(playerid)
  2218. {
  2219. if(GetPVarInt(playerid, "pBagged") >= 1)
  2220. {
  2221. ClearAnimationsEx(playerid);
  2222. TogglePlayerControllable(playerid, TRUE);
  2223. DeletePVar(playerid, "IsFrozen");
  2224. SetPlayerDrunkLevel(playerid, 0);
  2225. DeletePVar(playerid, "pBagged");
  2226. ClearAnimationsEx(playerid);
  2227. }
  2228. else
  2229. {
  2230. SetPlayerDrunkLevel(playerid, 0);
  2231. }
  2232. return 1;
  2233. }
  2234. forward _ShowerTimer(playerid);
  2235. public _ShowerTimer(playerid)
  2236. {
  2237. new Float: health;
  2238. GetPlayerHealth(playerid, health);
  2239. SetHealth(playerid, 150.0);
  2240. ClearAnimationsEx(playerid);
  2241. switch(GetPVarInt(playerid, "pPrisonShowerStage"))
  2242. {
  2243. case 1:
  2244. {
  2245. SendClientMessage(playerid, COLOR_GREY, "You have finished showering.");
  2246. TogglePlayerControllable(playerid, TRUE);
  2247. DeletePVar(playerid, "pPrisonShowerStage");
  2248. DeletePVar(playerid, "IsFrozen");
  2249. }
  2250. default:
  2251. {
  2252. ApplyAnimation(playerid, "MISC", "Scratchballs_01", 4.0, 0, 0, 0, 0, 0, 1);
  2253. SetPVarInt(playerid, "pPrisonShowerStage", 1);
  2254. SetTimerEx("_ShowerTimer", 8000, false, "d", playerid);
  2255. }
  2256. }
  2257. RandomMaterialChance(playerid);
  2258. return 1;
  2259. }
  2260. forward _DrinkWineTimer(playerid);
  2261. public _DrinkWineTimer(playerid)
  2262. {
  2263. new Float: health;
  2264. GetPlayerHealth(playerid, health);
  2265. SetHealth(playerid, 200.0);
  2266. SendClientMessage(playerid, COLOR_GREY, "You begin to stabalize, you also feel stronger.");
  2267. SetPVarInt(playerid, "pWineConsumed", 2);
  2268. SetTimerEx("_DrinkWineTimer2", 60000, false, "d", playerid);
  2269. SetPlayerDrunkLevel(playerid, 1000);
  2270. ClearAnimationsEx(playerid);
  2271. return 1;
  2272. }
  2273. forward _DrinkWineTimer2(playerid);
  2274. public _DrinkWineTimer2(playerid)
  2275. {
  2276. new Float: health;
  2277. GetPlayerHealth(playerid, health);
  2278. SendClientMessage(playerid, COLOR_GREY, "The pruno has lost it's effect.");
  2279. DeletePVar(playerid, "pWineConsumed");
  2280. SetPlayerDrunkLevel(playerid, 0);
  2281. ClearAnimationsEx(playerid);
  2282. return 1;
  2283. }
  2284. forward _KitchenTimer(playerid);
  2285. public _KitchenTimer(playerid)
  2286. {
  2287. PlayerInfo[playerid][pMechTime] = gettime()+60;
  2288. SendClientMessage(playerid, COLOR_GREY, "You have finished preparing food.");
  2289. TogglePlayerControllable(playerid, TRUE);
  2290. DeletePVar(playerid, "pDoingPJob");
  2291. PlayerInfo[playerid][pPrisonCredits] += 3;
  2292. RandomMaterialChance(playerid);
  2293. DeletePVar(playerid, "IsFrozen");
  2294. ClearAnimationsEx(playerid);
  2295. return 1;
  2296. }
  2297. forward _ReleaseTimer(playerid);
  2298. public _ReleaseTimer(playerid)
  2299. {
  2300. if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) != -1 && GetPVarInt(playerid, "_pBeingReleased") >= 1)
  2301. {
  2302. ReleasePlayerFromPrison(playerid);
  2303. DeletePVar(playerid, "_pBeingReleased");
  2304. }
  2305. else if(GetPVarInt(playerid, "_pBeingReleased") == -1) { DeletePVar(playerid, "_pBeingReleased"); }
  2306. return 1;
  2307. }
  2308. ReleasePlayerFromPrison(playerid)
  2309. {
  2310. if(playerTabbed[playerid] == 0)
  2311. {
  2312. if(PlayerInfo[playerid][pJailTime] > 0 && --PlayerInfo[playerid][pJailTime] <= 0)
  2313. {
  2314. if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) != -1)
  2315. {
  2316. SetPlayerInterior(playerid, 0);
  2317. PlayerInfo[playerid][pInt] = 0;
  2318. SetPlayerVirtualWorld(playerid, 0);
  2319. PlayerInfo[playerid][pVW] = 0;
  2320. SetPlayerPos(playerid, -1528.5812,489.6914,7.1797);
  2321. PlayerInfo[playerid][pPrisonCredits] = 0;
  2322. PlayerInfo[playerid][pPrisonMaterials] = 0;
  2323. PlayerInfo[playerid][pPrisonWineTime] = 0;
  2324. PlayerInfo[playerid][pPrisonCell] = 0;
  2325. DeletePVar(playerid, "pPrisonSoap");
  2326. DeletePVar(playerid, "pPrisonSugar");
  2327. DeletePVar(playerid, "pPrisonBread");
  2328. DeletePVar(playerid, "pPrisonShank");
  2329. DeletePVar(playerid, "pPrisonShankOut");
  2330. DeletePVar(playerid, "pShankUsages");
  2331. DeletePVar(playerid, "pPrisonWine");
  2332. DeletePVar(playerid, "pPrisonMWine");
  2333. DeletePVar(playerid, "pPrisonChisel");
  2334. DeletePVar(playerid, "pPrisonCellChisel");
  2335. DeletePVar(playerid, "_pBeingReleased");
  2336. }
  2337. }
  2338. else
  2339. {
  2340. SetPlayerInterior(playerid, 0);
  2341. PlayerInfo[playerid][pInt] = 0;
  2342. SetPlayerVirtualWorld(playerid, 0);
  2343. PlayerInfo[playerid][pVW] = 0;
  2344. SetPlayerPos(playerid, 1544.5059,-1675.5673,13.5585);
  2345. }
  2346. }
  2347. SetHealth(playerid, 100);
  2348. PlayerInfo[playerid][pJailTime] = 0;
  2349. PlayerInfo[playerid][pIsolated] = 0;
  2350. PlayerInfo[playerid][pPrisonCredits] = 0;
  2351. strcpy(PlayerInfo[playerid][pPrisonReason], "None");
  2352. PhoneOnline[playerid] = 0;
  2353. SendClientMessageEx(playerid, COLOR_GRAD1," You have paid your debt to society.");
  2354. GameTextForPlayer(playerid, "~g~Freedom~n~~w~Try to be a better citizen", 5000, 1);
  2355. TogglePlayerControllable(playerid, TRUE);
  2356. SetPlayerToTeamColor(playerid); //For some reason this is a being a bitch now so let's reset their colour to white and let the script decide what colour they should have afterwords
  2357. ClearCrimes(playerid);
  2358. }
  2359. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2360. {
  2361. if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
  2362. {
  2363. if(IsPlayerInRangeOfPoint(playerid, 2, 567.7756,1450.0720,6000.4751))
  2364. {
  2365. if(strfind(PlayerInfo[playerid][pPrisonReason], "[IC]", true) != -1) { ShowPlayerDialogEx(playerid, DIALOG_PRISONCREDS, DIALOG_STYLE_LIST, "Prison Canteen", "Dice\t\t\t\t\t\t5\nPaper\t\t\t\t\t\t5\nSoap\t\t\t\t\t\t5\nSugar\t\t\t\t\t\t5\nBread\t\t\t\t\t\t10\nCigarettes\t\t\t\t\t10\n\nMP3 Player\t\t\t\t\t50\nClothes\t\t\t\t\t250", "Purchase", "Cancel"); }
  2366. }
  2367. else if(IsPlayerInRangeOfPoint(playerid, 5, 546.7458,1484.4885,6000.4678))
  2368. {
  2369. new string[255];
  2370. if(gettime() < PlayerInfo[playerid][pMechTime])
  2371. {
  2372. format(string, sizeof(string), "You must wait %d seconds!", PlayerInfo[playerid][pMechTime]-gettime());
  2373. return SendClientMessageEx(playerid, COLOR_GRAD1, string);
  2374. }
  2375. if(GetPVarInt(playerid, "pDoingPJob") >= 1) return SendClientMessageEx(playerid, COLOR_GRAD1, " You are already on a job!");
  2376. TogglePlayerControllable(playerid, FALSE);
  2377. SetTimerEx("_KitchenTimer", 25000, false, "d", playerid);
  2378. SetPVarInt(playerid, "IsFrozen", 1);
  2379. format(string, sizeof string, "{FF8000}> {C2A2DA}%s begins to prepare some food for the kitchen.", GetPlayerNameEx(playerid));
  2380. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
  2381. SendClientMessage(playerid, COLOR_PURPLE, string);
  2382. SetPVarInt(playerid, "pDoingPJob", 1);
  2383. TogglePlayerControllable(playerid, FALSE);
  2384. PlayAnimEx(playerid, "BD_FIRE", "wash_up", 4.0, 1, 0, 0, 0, 0, 1);
  2385. }
  2386. else if(IsPlayerInAShower(playerid))
  2387. {
  2388. if(GetPVarInt(playerid, "pPrisonSoap") >= 1)
  2389. {
  2390. new string[128];
  2391. new Float: health;
  2392. GetPlayerHealth(playerid, health);
  2393. if(health >= 150.0) return SendClientMessage(playerid, COLOR_GREY, " You don't need to shower.");
  2394. format(string, sizeof string, "{FF8000}> {C2A2DA}%s wipes theirselves down with a bar of soap.", GetPlayerNameEx(playerid));
  2395. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  2396. SendClientMessage(playerid, COLOR_PURPLE, string);
  2397. SetPVarInt(playerid, "pPrisonSoap", GetPVarInt(playerid, "pPrisonSoap") - 1);
  2398. TogglePlayerControllable(playerid, FALSE);
  2399. SetPVarInt(playerid, "IsFrozen", 1);
  2400. SetTimerEx("_ShowerTimer", 10000, false, "d", playerid);
  2401. PlayAnimEx(playerid, "BD_FIRE", "wash_up", 4.0, 1, 0, 0, 0, 0, 1);
  2402. }
  2403. else return SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any soap.");
  2404. }
  2405. else if(GetPVarInt(playerid, "pPrisonChisel") >= 1 && IsPlayerInCell(playerid))
  2406. {
  2407. new string[255];
  2408. format(string, sizeof string, "{FF8000}> {C2A2DA}%s digs at their cell wall with a small object.", GetPlayerNameEx(playerid));
  2409. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 4000);
  2410. SendClientMessage(playerid, COLOR_PURPLE, string);
  2411. SetPVarInt(playerid, "pPrisonCellChisel", 1);
  2412. SetPVarInt(playerid, "pPrisonChisel", 0);
  2413. PlayAnimEx(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0,0);
  2414. SendClientMessage(playerid, COLOR_WHITE, "You have chiseled a hole in your cell, type /celldeposit to deposit contraband.");
  2415. }
  2416. }
  2417. return 1;
  2418. }
  2419. hook OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
  2420. {
  2421. new string[128];
  2422. if(GetPVarInt(playerid, "pPrisonShankOut") >= 1 && weaponid == 0)
  2423. {
  2424. new Float:health;
  2425. GetPlayerHealth(damagedid, health);
  2426. SetHealth(damagedid, health - random(40));
  2427. SetPVarInt(playerid, "pShankUsages", GetPVarInt(playerid, "pShankUsages") - 1);
  2428. if(GetPVarInt(playerid, "pShankUsages") <= 0)
  2429. {
  2430. SetPVarInt(playerid, "pShankUsages", 0);
  2431. SetPVarInt(playerid, "pPrisonShank", 0);
  2432. SetPVarInt(playerid, "pPrisonShankOut", 0);
  2433. format(string, sizeof string, "{FF8000}> {C2A2DA}%s shank dulls.", GetPlayerNameEx(playerid));
  2434. SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
  2435. SendClientMessageEx(playerid, COLOR_GREY, "Your prison shank has exceeded it's uses.");
  2436. RemovePlayerAttachedObject(playerid, 9);
  2437. }
  2438. }
  2439. if(GetPVarInt(playerid, "pWineConsumed") >= 2)
  2440. {
  2441. new Float:health;
  2442. GetPlayerHealth(damagedid, health);
  2443. SetHealth(damagedid, health - 15.0);
  2444. }
  2445. return 1;
  2446. }
  2447. RandomMaterialChance(playerid)
  2448. {
  2449. switch(random(100))
  2450. {
  2451. case 0 .. 80:
  2452. {
  2453. return 0;
  2454. }
  2455. default:
  2456. {
  2457. switch(random(10))
  2458. {
  2459. case 0 .. 5:
  2460. {
  2461. PlayerInfo[playerid][pPrisonMaterials] +=1;
  2462. SendClientMessage(playerid, COLOR_WHITE, "You have found a secret prison material. You can use these in /prisoncraft.");
  2463. }
  2464. case 6 .. 8:
  2465. {
  2466. PlayerInfo[playerid][pPrisonMaterials] +=2;
  2467. SendClientMessage(playerid, COLOR_WHITE, "You have found two secret prison materials. You can use these in /prisoncraft.");
  2468. }
  2469. default:
  2470. {
  2471. PlayerInfo[playerid][pPrisonMaterials] +=3;
  2472. SendClientMessage(playerid, COLOR_WHITE, "You have found three secret prison materials. You can use these in /prisoncraft.");
  2473. }
  2474. }
  2475. }
  2476. }
  2477. return 1;
  2478. }