lea.pwn 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. LEA Group Type
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. stock ShowBackupActiveForPlayer(playerid)
  34. {
  35. PlayerTextDrawShow(playerid, BackupText[playerid]);
  36. }
  37. stock HideBackupActiveForPlayer(playerid)
  38. {
  39. PlayerTextDrawHide(playerid, BackupText[playerid]);
  40. }
  41. forward SetPlayerFree(playerid,declare,reason[]);
  42. public SetPlayerFree(playerid,declare,reason[])
  43. {
  44. if(IsPlayerConnected(playerid))
  45. {
  46. ClearCrimes(playerid, declare);
  47. new string[128];
  48. foreach(new i: Player)
  49. {
  50. if(IsACop(i))
  51. {
  52. format(string, sizeof(string), "HQ: All units, officer %s has completed their assignment.", GetPlayerNameEx(declare));
  53. SendClientMessageEx(i, COLOR_DBLUE, string);
  54. format(string, sizeof(string), "HQ: %s has been processed, %s.", GetPlayerNameEx(playerid), reason);
  55. SendClientMessageEx(i, COLOR_DBLUE, string);
  56. }
  57. }
  58. }
  59. }
  60. stock IsACopCar(carid)
  61. {
  62. if(DynVeh[carid] != -1)
  63. {
  64. new iDvSlotID = DynVeh[carid], iGroupID = DynVehicleInfo[iDvSlotID][gv_igID];
  65. if((0 <= iGroupID < MAX_GROUPS))
  66. {
  67. if(arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_LEA) return 1;
  68. }
  69. }
  70. return 0;
  71. }
  72. stock CuffTacklee(playerid, giveplayerid)
  73. {
  74. new string[128], Float: health, Float: armor;
  75. ClearTackle(giveplayerid);
  76. format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
  77. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  78. format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
  79. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  80. format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  81. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  82. GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
  83. TogglePlayerControllable(giveplayerid, 0);
  84. ClearAnimationsEx(giveplayerid);
  85. ClearAnimationsEx(playerid);
  86. GetHealth(giveplayerid, health);
  87. GetArmour(giveplayerid, armor);
  88. SetPVarFloat(giveplayerid, "cuffhealth",health);
  89. SetPVarFloat(giveplayerid, "cuffarmor",armor);
  90. SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
  91. ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0,1);
  92. PlayerCuffed[giveplayerid] = 2;
  93. SetPVarInt(giveplayerid, "PlayerCuffed", 2);
  94. SetPVarInt(giveplayerid, "IsFrozen", 1);
  95. //Frozen[giveplayerid] = 1;
  96. PlayerCuffedTime[giveplayerid] = 300;
  97. PlayerFacePlayer(playerid, giveplayerid);
  98. return 1;
  99. }
  100. stock ClearTackle(playerid)
  101. {
  102. TogglePlayerControllable(playerid, 1);
  103. //PreloadAnimLib(playerid, "SUNBATHE");
  104. //PreloadAnimLib(GetPVarInt(playerid, "IsTackled"), "SUNBATHE");
  105. ApplyAnimation(playerid, "SUNBATHE", "Lay_Bac_out", 4.1, 0, 1, 1, 0, 0, 1);
  106. SetPVarInt(playerid, "CantBeTackledCount", 15); // cant be tackled again for 15 seconds
  107. DeletePVar(GetPVarInt(playerid, "IsTackled"), "Tackling");
  108. DeletePVar(playerid, "IsTackled");
  109. DeletePVar(playerid, "TackleCooldown");
  110. DeletePVar(playerid, "TackledResisting");
  111. DeletePVar(playerid, "IsFrozen");
  112. ShowPlayerDialogEx(playerid, -1, DIALOG_STYLE_LIST, "Close", "Close", "Close", "Close");
  113. return 1;
  114. }
  115. forward DragPlayer(dragger, dragee);
  116. public DragPlayer(dragger, dragee)
  117. {
  118. if(!IsPlayerConnected(dragger)) SendClientMessageEx(dragee, COLOR_GRAD2, "The player that was dragging you has disconnected.");
  119. if(!IsPlayerConnected(dragee))
  120. {
  121. DeletePVar(dragger, "DraggingPlayer");
  122. SendClientMessageEx(dragger, COLOR_GRAD2, "The player you were dragging has disconnected.");
  123. }
  124. if(GetPVarType(dragger, "DraggingPlayer") && GetPVarType(dragger, "DraggingPlayer"))
  125. {
  126. new Float:dX, Float:dY, Float:dZ;
  127. GetPlayerPos(dragger, dX, dY, dZ);
  128. floatsub(dX, 0.4);
  129. floatsub(dY, 0.4);
  130. SetPVarFloat(dragee, "DragX", dX);
  131. SetPVarFloat(dragee, "DragY", dY-1.5);
  132. SetPVarFloat(dragee, "DragZ", dZ);
  133. SetPVarInt(dragee, "DragWorld", GetPlayerVirtualWorld(dragger));
  134. SetPVarInt(dragee, "DragInt", GetPlayerInterior(dragger));
  135. Streamer_UpdateEx(dragee, dX, dY-1, dZ);
  136. SetPlayerPos(dragee, dX, dY-1, dZ);
  137. SetPlayerInterior(dragee, GetPlayerInterior(dragger));
  138. SetPlayerVirtualWorld(dragee, GetPlayerVirtualWorld(dragger));
  139. ClearAnimationsEx(dragee);
  140. ApplyAnimation(dragee, "ped","cower",1,1,0,0,0,0,1);
  141. SetTimerEx("DragPlayer", 1000, 0, "ii", dragger, dragee);
  142. }
  143. return 1;
  144. }
  145. forward CuffTackled(playerid, giveplayerid);
  146. public CuffTackled(playerid, giveplayerid)
  147. {
  148. new string[128];
  149. if(!GetPVarType(giveplayerid, "IsTackled"))
  150. {
  151. return SendClientMessageEx(playerid, COLOR_GRAD1, "The suspect has escaped your tackle. Tackle or Taze him again or get them to comply!");
  152. }
  153. if(GetPVarType(giveplayerid, "TackledResisting")) // If they haven't chosen - we assume they're resisting
  154. {
  155. if(GetPVarInt(giveplayerid, "TackledResisting") == 1) // complying
  156. {
  157. if(GetPVarType(giveplayerid, "IsTackled"))
  158. {
  159. return CuffTacklee(playerid, giveplayerid);
  160. }
  161. }
  162. if(GetPVarInt(giveplayerid, "TackledResisting") == 2) // resisting
  163. {
  164. new copcount;
  165. foreach(new j: Player)
  166. {
  167. if(ProxDetectorS(4.0, giveplayerid, j) && IsACop(j) && j != giveplayerid)
  168. {
  169. copcount++;
  170. }
  171. }
  172. format(string, sizeof(string), "* %s pushes and attempts to resist %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  173. ProxDetector(30.0, giveplayerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  174. new cuffchance = random(11);
  175. if(copcount >= 2 && copcount < 5) cuffchance = random(6);
  176. else if(copcount >= 5) cuffchance = 1;
  177. switch(cuffchance)
  178. {
  179. case 0..4: // success
  180. {
  181. return CuffTacklee(playerid, giveplayerid);
  182. }
  183. default: // fail
  184. {
  185. format(string, sizeof(string), "* %s pushes %s aside and is able to escape.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  186. ProxDetector(30.0, giveplayerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  187. TogglePlayerControllable(playerid, 0);
  188. ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 1, 1, 1, 0, 1);
  189. SetTimerEx("CopGetUp", 3500, 0, "i", playerid);
  190. ClearTackle(giveplayerid);
  191. }
  192. }
  193. }
  194. }
  195. else
  196. {
  197. ShowPlayerDialogEx(giveplayerid, -1, DIALOG_STYLE_LIST, "Close", "Close", "Close", "Close");
  198. SetPVarInt(giveplayerid, "TackledResisting", 2);
  199. CuffTackled(playerid, giveplayerid);
  200. }
  201. return 1;
  202. }
  203. forward CopGetUp(playerid);
  204. public CopGetUp(playerid)
  205. {
  206. SetPVarInt(playerid, "CopTackleCooldown", 30); // a Cooldown on when the cop can tackle again after tackling someone
  207. DeletePVar(playerid, "Tackling");
  208. SendClientMessageEx(playerid, COLOR_GRAD2, "It will be 30 seconds before you can tackle again.");
  209. TogglePlayerControllable(playerid, 1);
  210. //PreloadAnimLib(playerid, "SUNBATHE");
  211. ApplyAnimation(playerid, "SUNBATHE", "Lay_Bac_out", 4.0, 0, 1, 1, 0, 0, 1);
  212. return 1;
  213. }
  214. stock TacklePlayer(playerid, tacklee)
  215. {
  216. new string[128], Float: posx, Float: posy, Float: posz, group[GROUP_MAX_NAME_LEN], rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN];
  217. //PreloadAnimLib(playerid, "PED");
  218. format(string, sizeof(string), "** %s leaps at %s, tackling them.", GetPlayerNameEx(playerid), GetPlayerNameEx(tacklee));
  219. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  220. SetPVarInt(tacklee, "IsTackled", playerid);
  221. TogglePlayerControllable(tacklee, 0);
  222. SetPVarInt(tacklee, "IsFrozen", 1);
  223. SetPVarInt(tacklee, "TackleCooldown", 20); //Actually a countdown till the tackle is over
  224. SetPVarInt(playerid, "Tackling", tacklee);
  225. GetPlayerPos(tacklee, posx, posy,posz);
  226. SetPlayerFacingAngle(playerid, 180.0);
  227. SetPlayerFacingAngle(tacklee, 0.0);
  228. GetXYBehindPlayer(tacklee, posx, posy, 0.5);
  229. ApplyAnimation(playerid, "PED", "KO_shot_stom", 4.0, 0, 1, 1, 1, 20000, 1);
  230. ApplyAnimation(tacklee, "DILDO", "Dildo_Hit_3", 4.1, 0, 1, 1, 1, 20000, 1);
  231. GetPlayerGroupInfo(playerid, group, rank, division);
  232. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~w~Push ~r~'~k~~CONVERSATION_YES~' ~n~~w~to get up off the suspect.", 15000, 3);
  233. format(string, sizeof(string), "%s %s %s has tackled you. Do you wish to comply or resist?", group, rank, GetPlayerNameEx(playerid));
  234. ShowPlayerDialogEx(tacklee, DIALOG_TACKLED, DIALOG_STYLE_MSGBOX, "You've been tackled", string, "Comply", "Resist");
  235. if(GetPVarType(tacklee, "FixVehicleTimer")) KillTimer(GetPVarInt(tacklee, "FixVehicleTimer")), DeletePVar(tacklee, "FixVehicleTimer");
  236. return 1;
  237. }
  238. forward TazerTimer(playerid);
  239. public TazerTimer(playerid)
  240. {
  241. if(TazerTimeout[playerid] > 0)
  242. {
  243. new string[128];
  244. format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer reloading... ~w~%d", TazerTimeout[playerid]);
  245. GameTextForPlayer(playerid, string,1500, 3);
  246. TazerTimeout[playerid] -= 1;
  247. SetTimerEx("TazerTimer",1000,false,"d",playerid);
  248. }
  249. return 1;
  250. }
  251. forward BackupClear(playerid, calledbytimer);
  252. public BackupClear(playerid, calledbytimer)
  253. {
  254. if(IsPlayerConnected(playerid))
  255. {
  256. if(IsACop(playerid) || IsAMedic(playerid) || arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == GROUP_TYPE_TOWING)
  257. {
  258. if (Backup[playerid] > 0)
  259. {
  260. foreach(new i: Player)
  261. {
  262. if(IsACop(i))
  263. {
  264. SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
  265. }
  266. }
  267. SetPlayerToTeamColor(playerid);
  268. new string[128];
  269. if (calledbytimer != 1)
  270. {
  271. SendClientMessageEx(playerid, COLOR_GRAD2, "Your backup request has been cleared.");
  272. format(string, sizeof(string), "* %s no longer requires backup.", GetPlayerNameEx(playerid));
  273. foreach(new i: Player)
  274. {
  275. switch(Backup[playerid])
  276. {
  277. case 1, 2:
  278. {
  279. if(PlayerInfo[playerid][pMember] == PlayerInfo[i][pMember]) {
  280. SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  281. }
  282. }
  283. case 3:
  284. {
  285. if(IsACop(i) && arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == arrGroupData[PlayerInfo[i][pMember]][g_iAllegiance]) {
  286. SendClientMessageEx(i, COLOR_LIGHTGREEN, string);
  287. }
  288. }
  289. default: if(IsACop(i)) {
  290. SendClientMessageEx(i, COLOR_LIGHTGREEN, string);
  291. }
  292. }
  293. }
  294. }
  295. else
  296. {
  297. SendClientMessageEx(playerid, COLOR_GRAD2, "Your backup request has been cleared automatically.");
  298. format(string, sizeof(string), "* %s's backup request has expired.", GetPlayerNameEx(playerid));
  299. foreach(new i: Player)
  300. {
  301. switch(Backup[playerid]) {
  302. case 1, 2:
  303. {
  304. if(PlayerInfo[playerid][pMember] == PlayerInfo[i][pMember]) {
  305. SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  306. }
  307. }
  308. case 3:
  309. {
  310. if(IsACop(i) && arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == arrGroupData[PlayerInfo[i][pMember]][g_iAllegiance]) {
  311. SendClientMessageEx(i, COLOR_LIGHTGREEN, string);
  312. }
  313. }
  314. default: if(IsACop(i)) {
  315. SendClientMessageEx(i, COLOR_LIGHTGREEN, string);
  316. }
  317. }
  318. }
  319. }
  320. HideBackupActiveForPlayer(playerid);
  321. Backup[playerid] = 0;
  322. BackupClearTimer[playerid] = 0;
  323. }
  324. else
  325. {
  326. if (calledbytimer != 1)
  327. {
  328. SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have an active backup request!");
  329. }
  330. }
  331. }
  332. else
  333. {
  334. if (calledbytimer != 1)
  335. {
  336. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer!");
  337. }
  338. }
  339. }
  340. return 1;
  341. }
  342. forward SetAllCopCheckpoint(Float:allx, Float:ally, Float:allz, Float:radi);
  343. public SetAllCopCheckpoint(Float:allx, Float:ally, Float:allz, Float:radi)
  344. {
  345. foreach(new i: Player)
  346. {
  347. if(IsACop(i))
  348. {
  349. SetPlayerCheckpoint(i,allx,ally,allz, radi);
  350. }
  351. }
  352. return 1;
  353. }
  354. forward ShowPlayerBeaconForCops(playerid);
  355. public ShowPlayerBeaconForCops(playerid)
  356. {
  357. foreach(new i: Player)
  358. {
  359. if(IsACop(i))
  360. {
  361. SetPlayerMarkerForPlayer(i, playerid, COP_GREEN_COLOR);
  362. }
  363. }
  364. return 1;
  365. }
  366. forward HidePlayerBeaconForCops(playerid);
  367. public HidePlayerBeaconForCops(playerid)
  368. {
  369. foreach(new i: Player)
  370. {
  371. if(IsACop(i))
  372. {
  373. SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
  374. }
  375. }
  376. SetPlayerToTeamColor(playerid);
  377. return 1;
  378. }
  379. CMD:placekit(playerid, params[]) {
  380. if(IsACop(playerid) || IsAMedic(playerid) || IsAReporter(playerid) || IsAGovernment(playerid) || IsATowman(playerid))
  381. {
  382. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being inside the vehicle!");
  383. if(GetPVarInt(playerid, "EMSAttempt") != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command!");
  384. if(!GetPVarInt(playerid, "MedVestKit")) return SendClientMessageEx(playerid, COLOR_GRAD1, "You aren't carrying a kit.");
  385. new choice[9];
  386. if(sscanf(params, "s[9]", choice))
  387. {
  388. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /placekit [name]");
  389. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Car, Backpack");
  390. return 1;
  391. }
  392. new string[128];
  393. if(strcmp(choice, "Car", true) == 0)
  394. {
  395. new vehicleid = GetClosestCar(playerid, INVALID_VEHICLE_ID, 10.0);
  396. if( vehicleid != INVALID_VEHICLE_ID && GetDistanceToCar(playerid, vehicleid) < 10 )
  397. {
  398. if(!IsABike(vehicleid) && !IsAPlane(vehicleid)) {
  399. new engine,lights,alarm,doors,bonnet,boot,objective;
  400. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  401. if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET)
  402. {
  403. SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle's trunk must be opened in order to place it.");
  404. return 1;
  405. }
  406. }
  407. if(VehInfo[vehicleid][vCarVestKit] == 2)
  408. {
  409. return SendClientMessageEx(playerid, COLOR_GRAD1, "This vehicle already has two kits loaded.");
  410. }
  411. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s leans in to the trunk and places a Kevlar Vest & First Aid Kit inside.", GetPlayerNameEx(playerid));
  412. SendClientMessageEx(playerid, COLOR_WHITE, "You have loaded the Med Kit in to the Vehicle Trunk. /usekit to use it.");
  413. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  414. SetPVarInt(playerid, "MedVestKit", 0);
  415. VehInfo[vehicleid][vCarVestKit] += 1;
  416. }
  417. else return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not near any vehicle.");
  418. }
  419. else if(strcmp(choice, "Backpack", true) == 0)
  420. {
  421. if(PlayerInfo[playerid][pBackpack] > 0 && PlayerInfo[playerid][pBEquipped])
  422. {
  423. if(PlayerInfo[playerid][pBItems][5] > 0 && PlayerInfo[playerid][pBackpack] == 1)
  424. {
  425. return SendClientMessageEx(playerid, COLOR_GRAD1, "Your backpack size only lets you store 1 med kit.");
  426. }
  427. else if(PlayerInfo[playerid][pBItems][5] > 1 && PlayerInfo[playerid][pBackpack] == 2)
  428. {
  429. return SendClientMessageEx(playerid, COLOR_GRAD1, "Your backpack size only lets you store 2 med kit.");
  430. }
  431. else if(PlayerInfo[playerid][pBItems][5] > 2 && PlayerInfo[playerid][pBackpack] == 3)
  432. {
  433. return SendClientMessageEx(playerid, COLOR_GRAD1, "Your backpack size only lets you store 3 med kit.");
  434. }
  435. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s opens a backpack and places a Kevlar Vest & First Aid Kit inside.", GetPlayerNameEx(playerid));
  436. SendClientMessageEx(playerid, COLOR_WHITE, "You have loaded the Med Kit in to your backpack. /usekit to use it.");
  437. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  438. SetPVarInt(playerid, "MedVestKit", 0);
  439. PlayerInfo[playerid][pBItems][5] += 1;
  440. }
  441. else return SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have a backpack Equipped, if you want to buy one type /miscshop.");
  442. }
  443. else
  444. {
  445. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /placekit [name]");
  446. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Car, Backpack");
  447. return 1;
  448. }
  449. }
  450. return 1;
  451. }
  452. CMD:givekit(playerid, params[])
  453. {
  454. if(IsACop(playerid) || IsAMedic(playerid) || IsAGovernment(playerid) || IsATowman(playerid))
  455. {
  456. if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
  457. if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being inside the vehicle!"); return 1; }
  458. if(GetPVarInt(playerid, "EMSAttempt") != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command!");
  459. new iTarget;
  460. if(sscanf(params, "u", iTarget)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givekit [playerid]");
  461. if(!IsPlayerConnected(iTarget)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
  462. new Float:X, Float:Y, Float:Z; GetPlayerPos(iTarget, X, Y, Z);
  463. if(!IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) return SendClientMessage(playerid, COLOR_GRAD2, "You're not close enough to that player.");
  464. if(IsACop(iTarget) || IsAMedic(iTarget) || IsAGovernment(iTarget) || IsATowman(iTarget))
  465. {
  466. if(GetPVarInt(playerid, "MedVestKit") > 0)
  467. {
  468. if(GetPVarInt(iTarget, "MedVestKit") > 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player already has a kit.");
  469. format(szMiscArray, sizeof(szMiscArray), "{FF8000}** {C2A2DA}%s gives a Med Kit to %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget));
  470. SendClientMessageEx(iTarget, COLOR_WHITE, "You have been given a Med Kit. To use it, use /placekit and then /usekit.");
  471. ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  472. SetPVarInt(playerid, "MedVestKit", 0);
  473. SetPVarInt(iTarget, "MedVestKit", 1);
  474. }
  475. else SendClientMessage(playerid, COLOR_GRAD2, "You do not have a kit.");
  476. }
  477. else SendClientMessage(playerid, COLOR_GRAD2, "That player cannot use kits.");
  478. }
  479. return 1;
  480. }
  481. CMD:usekit(playerid, params[]) {
  482. if(IsACop(playerid) || IsAMedic(playerid) || IsAReporter(playerid) || IsAGovernment(playerid) || IsATowman(playerid))
  483. {
  484. if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
  485. if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being inside the vehicle!"); return 1; }
  486. if(GetPVarInt(playerid, "EMSAttempt") != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command!");
  487. new string[128];
  488. new vehicleid = GetClosestCar(playerid, INVALID_VEHICLE_ID, 10.0);
  489. if(vehicleid != INVALID_VEHICLE_ID && GetDistanceToCar(playerid, vehicleid) < 10)
  490. {
  491. if(VehInfo[vehicleid][vCarVestKit] > 0)
  492. {
  493. if(!IsABike(vehicleid) && !IsAPlane(vehicleid)) {
  494. new engine,lights,alarm,doors,bonnet,boot,objective;
  495. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  496. if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET)
  497. {
  498. SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle's trunk must be opened in order to search it.");
  499. return 1;
  500. }
  501. }
  502. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s leans in to the trunk and takes out a Kevlar Vest & First Aid Kit.", GetPlayerNameEx(playerid));
  503. SendClientMessageEx(playerid, COLOR_WHITE, "You have used the Med Kit from the Vehicle Trunk.");
  504. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  505. SetHealth(playerid, 100);
  506. SetArmour(playerid, 150);
  507. VehInfo[vehicleid][vCarVestKit] -= 1;
  508. return 1;
  509. }
  510. else return SendClientMessageEx(playerid, COLOR_GRAD1, "There are no med kits available in this vehicle.");
  511. }
  512. else if(IsBackpackAvailable(playerid))
  513. {
  514. if(PlayerInfo[playerid][pBackpack] > 0 && PlayerInfo[playerid][pBEquipped])
  515. {
  516. if(PlayerInfo[playerid][pBItems][5] > 0)
  517. {
  518. if(GetPVarInt(playerid, "BackpackMedKit") == 1) {
  519. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have already requested to use a medic kit.");
  520. }
  521. else
  522. {
  523. defer FinishMedKit(playerid);
  524. SetPVarInt(playerid, "BackpackMedKit", 1);
  525. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
  526. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s opens a backpack and takes out a Kevlar Vest & First Aid Kit inside.", GetPlayerNameEx(playerid));
  527. SendClientMessageEx(playerid, COLOR_WHITE, "You are taking a Med Kit from your backpack, please wait.");
  528. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  529. }
  530. }
  531. else return SendClientMessageEx(playerid, COLOR_GRAD1, "There are no med kits available in your backpack.");
  532. }
  533. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You have no kits inside your backpack.");
  534. }
  535. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not near a vehicle or have a backup equipped!");
  536. }
  537. return 1;
  538. }
  539. CMD:searchcar(playerid, params[])
  540. {
  541. if(!IsACop(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You are not a law enforcement officer!");
  542. if(GetPVarInt(playerid, "Injured") != 0 || GetPVarInt(playerid, "EventToken") != 0) return SendClientMessageEx (playerid, COLOR_GRAD2, "You cannot do this at this time.");
  543. new closestcar = GetClosestCar(playerid), v, string[128];
  544. if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 9.0)) return SendClientMessageEx(playerid,COLOR_GREY,"You are not near any vehicles.");
  545. if(IsABike(closestcar) || IsAPlane(closestcar)) return SendClientMessageEx(playerid,COLOR_GREY,"You can't search this type of vehicle!");
  546. new engine,lights,alarm,doors,bonnet,boot,objective;
  547. GetVehicleParamsEx(closestcar,engine,lights,alarm,doors,bonnet,boot,objective);
  548. if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET) return SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle's trunk must be opened in order to search it.");
  549. foreach(new i: Player)
  550. {
  551. v = GetPlayerVehicle(i, closestcar);
  552. string[0] = 0;
  553. if(v != -1) {
  554. Smuggle_VehicleLoad(playerid, i, v);
  555. for(new x = 0; x < 3; x++)
  556. {
  557. if(PlayerVehicleInfo[i][v][pvWeapons][x] != 0)
  558. {
  559. new
  560. szWep[20];
  561. GetWeaponName(PlayerVehicleInfo[i][v][pvWeapons][x], szWep, sizeof(szWep));
  562. if(isnull(string)) format(string, sizeof(string), "* Trunk contains: %s", szWep);
  563. else format(string, sizeof(string), "%s, %s", string, szWep);
  564. }
  565. }
  566. if(!isnull(string)) {
  567. SendClientMessageEx(playerid, COLOR_WHITE, string);
  568. if(VehInfo[closestcar][vCarVestKit]) {
  569. SendClientMessageEx(playerid, COLOR_WHITE, "* Trunk contains:");
  570. SendClientMessageEx(playerid, COLOR_WHITE, "* Kevlar Vest.");
  571. SendClientMessageEx(playerid, COLOR_WHITE, "* First Aid Kit.");
  572. }
  573. }
  574. else SendClientMessageEx(playerid, COLOR_WHITE, "* Trunk contains: nothing.");
  575. strins(string, "F", 0, sizeof(string));
  576. }
  577. }
  578. if(isnull(string)) {
  579. if(VehInfo[closestcar][vCarVestKit] > 0) {
  580. new str[84];
  581. SendClientMessageEx(playerid, COLOR_WHITE, "* Trunk contains:");
  582. format(str, sizeof(str), "* Kevlar Vest (x%d).", VehInfo[closestcar][vCarVestKit]);
  583. SendClientMessageEx(playerid, COLOR_WHITE, str);
  584. format(str, sizeof(str), "* First Aid Kit(x%d).", VehInfo[closestcar][vCarVestKit]);
  585. SendClientMessageEx(playerid, COLOR_WHITE, str);
  586. }
  587. else SendClientMessageEx(playerid, COLOR_WHITE, "* Trunk contains: nothing.");
  588. }
  589. return 1;
  590. }
  591. CMD:takecarweapons(playerid, params[])
  592. {
  593. if (!IsACop(playerid))
  594. {
  595. SendClientMessageEx(playerid,COLOR_GREY,"You're not a law enforcement officer.");
  596. return 1;
  597. }
  598. new carid = GetPlayerVehicleID(playerid);
  599. new closestcar = GetClosestCar(playerid,carid);
  600. if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 9.0))
  601. {
  602. SendClientMessageEx(playerid,COLOR_GREY,"You are not near any vehicles.");
  603. return 1;
  604. }
  605. new engine,lights,alarm,doors,bonnet,boot,objective;
  606. GetVehicleParamsEx(closestcar,engine,lights,alarm,doors,bonnet,boot,objective);
  607. if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET)
  608. {
  609. SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle's trunk must be opened in order to search it.");
  610. return 1;
  611. }
  612. foreach(new i: Player)
  613. {
  614. new v = GetPlayerVehicle(i, closestcar);
  615. if(v != -1)
  616. {
  617. if (!PlayerVehicleInfo[i][v][pvWeapons][0] && !PlayerVehicleInfo[i][v][pvWeapons][1] && !PlayerVehicleInfo[i][v][pvWeapons][2])
  618. {
  619. SendClientMessageEx(playerid, COLOR_WHITE, "No weapons in the trunk.");
  620. return 1;
  621. }
  622. else
  623. {
  624. PlayerVehicleInfo[i][v][pvWeapons][0] = 0;
  625. PlayerVehicleInfo[i][v][pvWeapons][1] = 0;
  626. PlayerVehicleInfo[i][v][pvWeapons][2] = 0;
  627. SendClientMessageEx(playerid, COLOR_WHITE, "All weapons have been removed from this vehicle.");
  628. new string[MAX_PLAYER_NAME + 44];
  629. format(string, sizeof(string), "* %s has taken the weapons away from the trunk.", GetPlayerNameEx(playerid));
  630. ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  631. return 1;
  632. }
  633. }
  634. }
  635. return 1;
  636. }
  637. CMD:mdc(playerid, params[])
  638. {
  639. if(IsMDCPermitted(playerid))
  640. {
  641. if(IsPlayerInAnyVehicle(playerid) || Bit_State(arrPlayerBits[playerid], phone_bitState))
  642. {
  643. ShowPlayerDialogEx(playerid, MDC_MAIN, DIALOG_STYLE_LIST, "MDC - Logged in", "*Civilian Information\n*Register Suspect\n*Clear Suspect\n*Vehicle registrations\n*Find LEO\n*Law Enforcement Agencies\n*MDC Message\n*SMS", "OK", "Cancel");
  644. ConnectedToPC[playerid] = 1337;
  645. }
  646. else SendClientMessageEx(playerid, COLOR_GREY, "You are not in a vehicle.");
  647. }
  648. return 1;
  649. }
  650. CMD:clearcargo(playerid, params[])
  651. {
  652. if(!IsACop(playerid))
  653. {
  654. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a law enforcement officer!");
  655. return 1;
  656. }
  657. new carid = GetPlayerVehicleID(playerid);
  658. new closestcar = GetClosestCar(playerid, carid);
  659. if(IsPlayerInRangeOfVehicle(playerid, closestcar, 6.0) && IsATruckerCar(closestcar))
  660. {
  661. if(IsPlayerInAnyVehicle(playerid))
  662. {
  663. SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot clear the cargo while inside of a vehicle.");
  664. return 1;
  665. }
  666. if(TruckContents{closestcar} == 0)
  667. {
  668. if(TruckDeliveringTo[closestcar] != INVALID_BUSINESS_ID && (Businesses[TruckDeliveringTo[closestcar]][bType] != BUSINESS_TYPE_GASSTATION || Businesses[TruckDeliveringTo[closestcar]][bType] == BUSINESS_TYPE_NEWCARDEALERSHIP))
  669. {
  670. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot take the content away.");
  671. return 1;
  672. }
  673. }
  674. new truckcontentname[50];
  675. new iTruckContents = TruckContents{closestcar};
  676. if(iTruckContents >= 0 && iTruckContents < 5)
  677. {
  678. SendClientMessageEx(playerid, COLOR_WHITE, "There are no illegal items in that Vehicle.");
  679. return 1;
  680. }
  681. else if(TruckDeliveringTo[closestcar] == INVALID_BUSINESS_ID && iTruckContents == 0)
  682. {
  683. SendClientMessageEx(playerid, COLOR_WHITE, "There are no illegal items in that Vehicle.");
  684. return 1;
  685. }
  686. if(iTruckContents == 5)
  687. { format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal weapons"); }
  688. else if(iTruckContents == 6)
  689. { format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal drugs"); }
  690. else if(iTruckContents == 7)
  691. { format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal materials"); }
  692. else format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal materials");
  693. foreach(new i: Player)
  694. {
  695. if(TruckUsed[i] == closestcar)
  696. {
  697. TruckUsed[i] = INVALID_VEHICLE_ID;
  698. TruckDeliveringTo[closestcar] = INVALID_BUSINESS_ID;
  699. TruckContents{closestcar} = 0;
  700. TruckRoute[closestcar] = 0;
  701. DisablePlayerCheckpoint(i);
  702. gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
  703. DeletePVar(i, "TruckDeliver");
  704. SendClientMessageEx(i, COLOR_WHITE, "Your delivery has failed. Law enforcement has confiscated the illegal goods.");
  705. }
  706. }
  707. new string[128];
  708. format(string, sizeof(string), "You removed the %s {FFFFFF}from the Vehicle.", truckcontentname);
  709. SendClientMessageEx(playerid, COLOR_WHITE, string);
  710. format(string, sizeof(string), "* %s has taken the illegal items from the Vehicle.", GetPlayerNameEx(playerid));
  711. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  712. }
  713. else
  714. {
  715. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not near a Shipment Transport Vehicle.");
  716. }
  717. return 1;
  718. }
  719. CMD:backup(playerid, params[])
  720. {
  721. if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerInfo[playerid][pJailTime] > 0 || GetPVarInt(playerid, "Injured")) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot do this at this time.");
  722. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) {
  723. return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  724. }
  725. if(IsACop(playerid) || IsAMedic(playerid) || arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == GROUP_TYPE_TOWING)
  726. {
  727. new code[10],
  728. zone[MAX_ZONE_NAME],
  729. string[128];
  730. GetPlayer3DZone(playerid, zone, sizeof(zone));
  731. if(sscanf(params, "s[10]", code) && (Backup[playerid] == 0 || Backup[playerid] == 2)) {
  732. format(string, sizeof(string), "* %s requests backup over their radio.", GetPlayerNameEx(playerid));
  733. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  734. format(string, sizeof(string), "* %s is requesting backup at %s. {AA3333}Respond Code 3 [Lights and Sirens].", GetPlayerNameEx(playerid), zone);
  735. ShowBackupActiveForPlayer(playerid);
  736. Backup[playerid] = 1;
  737. foreach(Player, i)
  738. {
  739. if(PlayerInfo[playerid][pMember] == PlayerInfo[i][pMember])
  740. {
  741. SetPlayerMarkerForPlayer(i, playerid, 0x2641FEAA);
  742. SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  743. }
  744. }
  745. SendClientMessageEx(playerid, COLOR_WHITE, "Type '/backup' again to lower your request to code 2.");
  746. SendClientMessageEx(playerid, COLOR_WHITE, "Type /nobackup to clear your backup request.");
  747. if(BackupClearTimer[playerid] != 0)
  748. {
  749. KillTimer(BackupClearTimer[playerid]);
  750. BackupClearTimer[playerid] = 0;
  751. }
  752. BackupClearTimer[playerid] = SetTimerEx("BackupClear", 300000, false, "ii", playerid, 1);
  753. }
  754. else if(strcmp(code, "code2", true) == 0 && (Backup[playerid] == 0 || Backup[playerid] == 1))
  755. {
  756. format(string, sizeof(string), "* %s requests backup over their radio.", GetPlayerNameEx(playerid));
  757. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  758. format(string, sizeof(string), "* %s is requesting backup at %s. {00FF33}Respond Code 2 [No Lights and Sirens].", GetPlayerNameEx(playerid), zone);
  759. ShowBackupActiveForPlayer(playerid);
  760. Backup[playerid] = 2;
  761. foreach(Player, i)
  762. {
  763. if(PlayerInfo[playerid][pMember] == PlayerInfo[i][pMember])
  764. {
  765. SetPlayerMarkerForPlayer(i, playerid, 0x00FF33AA);
  766. SendClientMessageEx(i, arrGroupData[PlayerInfo[playerid][pMember]][g_hRadioColour] * 256 + 255, string);
  767. }
  768. }
  769. SendClientMessageEx(playerid, COLOR_WHITE, "Type /backup again to upgrade your request to code 3.");
  770. SendClientMessageEx(playerid, COLOR_WHITE, "Type /nobackup to clear your backup request.");
  771. if(BackupClearTimer[playerid] != 0)
  772. {
  773. KillTimer(BackupClearTimer[playerid]);
  774. BackupClearTimer[playerid] = 0;
  775. }
  776. BackupClearTimer[playerid] = SetTimerEx("BackupClear", 300000, false, "ii", playerid, 1);
  777. }
  778. else if(code[0] && !(strcmp(code, "code2", true) == 0))
  779. {
  780. return SendClientMessageEx(playerid, COLOR_GREY, "Incorrect parameter - type /backup or /backup code2 only");
  781. }
  782. else
  783. {
  784. SendClientMessageEx(playerid, COLOR_GREY, " You already have an active backup request! Type /nobackup to cancel.");
  785. }
  786. }
  787. else
  788. {
  789. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer or medic!");
  790. }
  791. return 1;
  792. }
  793. CMD:backupall(playerid, params[])
  794. {
  795. if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerInfo[playerid][pJailTime] > 0 || GetPVarInt(playerid, "Injured")) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot do this at this time.");
  796. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) {
  797. return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  798. }
  799. if(IsACop(playerid) || IsAMedic(playerid))
  800. {
  801. new
  802. zone[MAX_ZONE_NAME],
  803. string[128];
  804. GetPlayer3DZone(playerid, zone, sizeof(zone));
  805. if(Backup[playerid] == 0 || Backup[playerid] == 1)
  806. {
  807. format(string, sizeof(string), "* %s requests backup over their radio.", GetPlayerNameEx(playerid));
  808. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  809. format(string, sizeof(string), "* %s is requesting backup at %s. {AA3333}Respond Code 3A [Lights and Sirens].", GetPlayerNameEx(playerid), zone);
  810. ShowBackupActiveForPlayer(playerid);
  811. Backup[playerid] = 3;
  812. foreach(Player, i)
  813. {
  814. if(IsACop(i) && arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] == arrGroupData[PlayerInfo[i][pMember]][g_iAllegiance])
  815. {
  816. SetPlayerMarkerForPlayer(i, playerid, 0x2641FEAA);
  817. SendClientMessageEx(i, DEPTRADIO, string);
  818. }
  819. }
  820. SendClientMessageEx(playerid, COLOR_WHITE, "Type /nobackup to clear your backup request.");
  821. if(BackupClearTimer[playerid] != 0)
  822. {
  823. KillTimer(BackupClearTimer[playerid]);
  824. BackupClearTimer[playerid] = 0;
  825. }
  826. BackupClearTimer[playerid] = SetTimerEx("BackupClear", 300000, false, "ii", playerid, 1);
  827. }
  828. else
  829. {
  830. SendClientMessageEx(playerid, COLOR_GREY, " You already have an active backup request! Type /nobackup to cancel.");
  831. }
  832. }
  833. else
  834. {
  835. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer or medic!");
  836. }
  837. return 1;
  838. }
  839. CMD:backupint(playerid, params[])
  840. {
  841. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) {
  842. return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  843. }
  844. if(IsACop(playerid) || IsAMedic(playerid))
  845. {
  846. new
  847. zone[MAX_ZONE_NAME],
  848. string[128];
  849. GetPlayer3DZone(playerid, zone, sizeof(zone));
  850. if(Backup[playerid] == 0 || Backup[playerid] == 1)
  851. {
  852. format(string, sizeof(string), "* %s requests backup over their radio.", GetPlayerNameEx(playerid));
  853. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  854. format(string, sizeof(string), "* %s is requesting international backup at %s. {AA3333}Respond Code 3A [Lights and Sirens].", GetPlayerNameEx(playerid), zone);
  855. ShowBackupActiveForPlayer(playerid);
  856. Backup[playerid] = 4;
  857. foreach(Player, i)
  858. {
  859. if(IsACop(i))
  860. {
  861. SetPlayerMarkerForPlayer(i, playerid, 0x2641FEAA);
  862. SendClientMessageEx(i, DEPTRADIO, string);
  863. }
  864. }
  865. SendClientMessageEx(playerid, COLOR_WHITE, "Type /nobackup to clear your backup request.");
  866. if(BackupClearTimer[playerid] != 0)
  867. {
  868. KillTimer(BackupClearTimer[playerid]);
  869. BackupClearTimer[playerid] = 0;
  870. }
  871. BackupClearTimer[playerid] = SetTimerEx("BackupClear", 300000, false, "ii", playerid, 1);
  872. }
  873. else
  874. {
  875. SendClientMessageEx(playerid, COLOR_GREY, " You already have an active backup request! Type /nobackup to cancel.");
  876. }
  877. }
  878. else
  879. {
  880. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer or medic!");
  881. }
  882. return 1;
  883. }
  884. CMD:nobackup(playerid, params[])
  885. {
  886. BackupClear(playerid, 0);
  887. return 1;
  888. }
  889. CMD:vmdc(playerid, params[])
  890. {
  891. if(IsACop(playerid) || IsATowman(playerid) || IsAHitman(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  892. {
  893. new string[128], giveplayerid;
  894. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /vmdc [player]");
  895. if(IsPlayerConnected(giveplayerid))
  896. {
  897. SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
  898. format(string, sizeof(string), "*** %s's Vehicles ***", GetPlayerNameEx(giveplayerid));
  899. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  900. for(new i=0; i<MAX_PLAYERVEHICLES; i++)
  901. {
  902. if(PlayerVehicleInfo[giveplayerid][i][pvId] != INVALID_PLAYER_VEHICLE_ID)
  903. {
  904. format(string, sizeof(string), "Vehicle registration: %d | Vehicle Name: %s | Ticket: $%d.",PlayerVehicleInfo[giveplayerid][i][pvId],GetVehicleName(PlayerVehicleInfo[giveplayerid][i][pvId]),PlayerVehicleInfo[giveplayerid][i][pvTicket]);
  905. SendClientMessageEx(playerid, COLOR_WHITE, string);
  906. }
  907. else if(PlayerVehicleInfo[giveplayerid][i][pvImpounded])
  908. {
  909. format(string, sizeof(string), "Vehicle registration: Voided (impounded) | Vehicle Name: %s | Ticket: $%d.",VehicleName[PlayerVehicleInfo[giveplayerid][i][pvModelId]-400],PlayerVehicleInfo[giveplayerid][i][pvTicket]);
  910. SendClientMessageEx(playerid, COLOR_WHITE, string);
  911. }
  912. }
  913. SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
  914. }
  915. }
  916. return 1;
  917. }
  918. CMD:vticket(playerid, params[])
  919. {
  920. if(IsACop(playerid) || IsATowman(playerid)) {
  921. new vehid, amount;
  922. if(sscanf(params, "ii", vehid, amount)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /vticket [registration] [amount]");
  923. if(PlayerInfo[playerid][pTicketTime] != 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must wait within a minute in order to use this command again!");
  924. if(amount > 50000) return SendClientMessageEx(playerid, COLOR_GREY, "The maximum vehicle ticket amount is $50,000.");
  925. if(amount < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You can't ticket any vehicle below $1.");
  926. new string[128], Float: x, Float: y, Float: z, veh = -1;
  927. GetVehiclePos(vehid, x, y, z);
  928. if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) {
  929. foreach(new i: Player) {
  930. if((veh = GetPlayerVehicle(i, vehid)) != -1) {
  931. PlayerVehicleInfo[i][veh][pvTicket] += amount;
  932. PlayerInfo[playerid][pTicketTime] = 60;
  933. SendClientMessageEx(playerid, COLOR_WHITE, "You have issued a $%s ticket on %s's %s.", number_format(amount), GetPlayerNameEx(i), GetVehicleName(PlayerVehicleInfo[i][veh][pvId]));
  934. format(string, sizeof(string), "[VTICKET] Officer %s has ticketed %s's %s (%d) for $%s.", GetPlayerNameEx(playerid), GetPlayerNameEx(i), GetVehicleName(PlayerVehicleInfo[i][veh][pvId]), PlayerVehicleInfo[i][veh][pvSlotId], number_format(amount));
  935. GroupLog(PlayerInfo[playerid][pMember], string);
  936. break;
  937. }
  938. }
  939. if((veh = IsDynamicCrateVehicle(vehid)) != -1) {
  940. if(ValidGroup(CrateVehicle[veh][cvGroupID])) {
  941. if(PlayerInfo[playerid][pMember] == CrateVehicle[veh][cvGroupID]) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Your group owns this vehicle you can't put a ticket on it!");
  942. CrateVehicle[veh][cvTickets] += amount;
  943. PlayerInfo[playerid][pTicketTime] = 60;
  944. SendClientMessageEx(playerid, COLOR_WHITE, "You have issued a $%s ticket on the %s.", number_format(amount), VehicleName[CrateVehicle[veh][cvModel] - 400]);
  945. format(string, sizeof(string), "[VTICKET] Officer %s has ticketed %s's %s (%d) for $%s.", GetPlayerNameEx(playerid), arrGroupData[CrateVehicle[veh][cvGroupID]][g_szGroupName], VehicleName[CrateVehicle[veh][cvModel] - 400], CrateVehicle[veh][cvId], number_format(amount));
  946. GroupLog(PlayerInfo[playerid][pMember], string);
  947. SaveCrateVehicle(veh);
  948. } else veh = -1;
  949. }
  950. if(veh == -1) {
  951. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle does not have any registration!");
  952. }
  953. }
  954. else SendClientMessageEx(playerid, COLOR_GRAD2, "You need to be near such vehicle!");
  955. }
  956. else SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
  957. return 1;
  958. }
  959. CMD:vlookup(playerid, params[]) {
  960. if(IsACop(playerid) || IsATowman(playerid) || IsAHitman(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  961. {
  962. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /vlookup [vehicle registration]");
  963. new carid = strval(params);
  964. new dynveh = DynVeh[carid];
  965. new cveh = IsDynamicCrateVehicle(carid);
  966. foreach(new i: Player)
  967. {
  968. new v = GetPlayerVehicle(i, carid);
  969. if(v != -1)
  970. {
  971. new string[78 + MAX_PLAYER_NAME];
  972. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: $%s", carid, GetVehicleName(PlayerVehicleInfo[i][v][pvId]), GetPlayerNameEx(i), number_format(PlayerVehicleInfo[i][v][pvTicket]));
  973. SendClientMessageEx(playerid, COLOR_WHITE, string);
  974. return 1;
  975. }
  976. }
  977. if(dynveh != -1)
  978. {
  979. if(DynVehicleInfo[dynveh][gv_igID] != INVALID_GROUP_ID && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] != GROUP_TYPE_CONTRACT && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] != GROUP_TYPE_CRIMINAL)
  980. {
  981. new string[78 + MAX_PLAYER_NAME];
  982. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: EXEMPT", carid, GetVehicleName(carid), arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_szGroupName]);
  983. SendClientMessageEx(playerid, COLOR_WHITE, string);
  984. return 1;
  985. }
  986. else if(DynVehicleInfo[dynveh][gv_igID] != INVALID_GROUP_ID && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] == GROUP_TYPE_CRIMINAL)
  987. {
  988. new string[78 + MAX_PLAYER_NAME];
  989. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s", carid, GetVehicleName(carid), arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_szGroupName]);
  990. SendClientMessageEx(playerid, COLOR_WHITE, string);
  991. return 1;
  992. }
  993. }
  994. if(cveh != -1) {
  995. if(ValidGroup(CrateVehicle[cveh][cvGroupID])) {
  996. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle registration: %d | Name: %s | Owner: %s | Tickets: $%s", carid, GetVehicleName(carid), arrGroupData[CrateVehicle[cveh][cvGroupID]][g_szGroupName], number_format(CrateVehicle[cveh][cvTickets]));
  997. return 1;
  998. }
  999. }
  1000. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle is not owned by anyone!");
  1001. }
  1002. return 1;
  1003. }
  1004. CMD:vcheck(playerid, params[])
  1005. {
  1006. if(IsACop(playerid) || IsATowman(playerid) || IsAHitman(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1007. {
  1008. new carid = GetPlayerVehicleID(playerid);
  1009. new closestcar = GetClosestCar(playerid, carid);
  1010. if(IsTrailerAttachedToVehicle(carid))
  1011. {
  1012. new carbeingtowed = GetVehicleTrailer(carid);
  1013. new dynveh = DynVeh[carbeingtowed];
  1014. new cveh = IsDynamicCrateVehicle(carbeingtowed);
  1015. foreach(new i: Player)
  1016. {
  1017. new v = GetPlayerVehicle(i, carbeingtowed);
  1018. if(v != -1)
  1019. {
  1020. new string[78 + MAX_PLAYER_NAME];
  1021. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: $%s", carbeingtowed, GetVehicleName(PlayerVehicleInfo[i][v][pvId]), GetPlayerNameEx(i), number_format(PlayerVehicleInfo[i][v][pvTicket]));
  1022. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1023. return 1;
  1024. }
  1025. }
  1026. if(dynveh != -1)
  1027. {
  1028. if(DynVehicleInfo[dynveh][gv_igID] != INVALID_GROUP_ID && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] != GROUP_TYPE_CONTRACT && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] != GROUP_TYPE_CRIMINAL)
  1029. {
  1030. new string[78 + MAX_PLAYER_NAME];
  1031. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: EXEMPT", carbeingtowed, GetVehicleName(carbeingtowed), arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_szGroupName]);
  1032. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1033. return 1;
  1034. }
  1035. else if(DynVehicleInfo[dynveh][gv_igID] != INVALID_GROUP_ID && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] == GROUP_TYPE_CRIMINAL)
  1036. {
  1037. new string[78 + MAX_PLAYER_NAME];
  1038. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s", closestcar, GetVehicleName(closestcar), arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_szGroupName]);
  1039. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1040. return 1;
  1041. }
  1042. }
  1043. if(cveh != -1) {
  1044. if(ValidGroup(CrateVehicle[cveh][cvGroupID])) {
  1045. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: $%s", closestcar, GetVehicleName(closestcar), arrGroupData[CrateVehicle[cveh][cvGroupID]][g_szGroupName], number_format(CrateVehicle[cveh][cvTickets]));
  1046. return 1;
  1047. }
  1048. }
  1049. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle is not owned by anyone!");
  1050. }
  1051. else if(IsPlayerInRangeOfVehicle(playerid, closestcar, 9.0) && !IsTrailerAttachedToVehicle(carid) && (GetVehicleVirtualWorld(closestcar) == GetPlayerVirtualWorld(playerid)))
  1052. {
  1053. new dynveh = DynVeh[closestcar], szClamp[16], cveh = IsDynamicCrateVehicle(closestcar);
  1054. if(WheelClamp{closestcar}) {
  1055. format(szClamp, sizeof(szClamp), "| Wheelclamp: Yes");
  1056. }
  1057. foreach(new i: Player)
  1058. {
  1059. new v = GetPlayerVehicle(i, closestcar);
  1060. if(v != -1)
  1061. {
  1062. new string[99 + MAX_PLAYER_NAME];
  1063. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: $%d | Speed: %.0f MPH %s", closestcar, GetVehicleName(PlayerVehicleInfo[i][v][pvId]), GetPlayerNameEx(i), PlayerVehicleInfo[i][v][pvTicket], vehicle_get_speed(closestcar), szClamp);
  1064. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1065. return 1;
  1066. }
  1067. }
  1068. if(dynveh != -1)
  1069. {
  1070. if(DynVehicleInfo[dynveh][gv_igID] != INVALID_GROUP_ID && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] != GROUP_TYPE_CONTRACT && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] != GROUP_TYPE_CRIMINAL)
  1071. {
  1072. new string[99 + MAX_PLAYER_NAME];
  1073. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: EXEMPT %s", closestcar, GetVehicleName(closestcar), arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_szGroupName], szClamp);
  1074. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1075. return 1;
  1076. }
  1077. else if(DynVehicleInfo[dynveh][gv_igID] != INVALID_GROUP_ID && arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_iGroupType] == GROUP_TYPE_CRIMINAL)
  1078. {
  1079. new string[99 + MAX_PLAYER_NAME];
  1080. format(string, sizeof(string), "Vehicle registration: %d | Name: %s | Owner: %s %s", closestcar, GetVehicleName(closestcar), arrGroupData[DynVehicleInfo[dynveh][gv_igID]][g_szGroupName], szClamp);
  1081. SendClientMessageEx(playerid, COLOR_WHITE, string);
  1082. return 1;
  1083. }
  1084. }
  1085. if(cveh != -1) {
  1086. if(ValidGroup(CrateVehicle[cveh][cvGroupID])) {
  1087. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle registration: %d | Name: %s | Owner: %s | Ticket: $%s %s", closestcar, GetVehicleName(closestcar), arrGroupData[CrateVehicle[cveh][cvGroupID]][g_szGroupName], number_format(CrateVehicle[cveh][cvTickets]), szClamp);
  1088. return 1;
  1089. }
  1090. }
  1091. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle is not owned by anyone!");
  1092. }
  1093. else SendClientMessageEx(playerid, COLOR_GRAD1, "ERROR: You are not towing a vehicle/near to another vehicle.");
  1094. }
  1095. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  1096. return 1;
  1097. }
  1098. CMD:ram(playerid, params[])
  1099. {
  1100. if(IsACop(playerid) || IsAMedic(playerid) || IsAHitman(playerid))
  1101. {
  1102. if(GetPVarType(playerid, "IsInArena"))
  1103. {
  1104. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
  1105. return 1;
  1106. }
  1107. if( PlayerCuffed[playerid] >= 1 )
  1108. {
  1109. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
  1110. return 1;
  1111. }
  1112. new string[128];
  1113. for(new i = 0; i < sizeof(HouseInfo); i++)
  1114. {
  1115. if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]) && PlayerInfo[playerid][pVW] == HouseInfo[i][hExtVW])
  1116. {
  1117. format(string, sizeof(string), "* %s breaches the door, and enters.", GetPlayerNameEx(playerid));
  1118. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1119. SetPlayerInterior(playerid,HouseInfo[i][hIntIW]);
  1120. SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
  1121. GameTextForPlayer(playerid, "~r~Breached the door", 5000, 1);
  1122. PlayerInfo[playerid][pInt] = HouseInfo[i][hIntIW];
  1123. PlayerInfo[playerid][pVW] = HouseInfo[i][hIntVW];
  1124. SetPlayerVirtualWorld(playerid,HouseInfo[i][hIntVW]);
  1125. if(HouseInfo[i][hCustomInterior] == 1) Player_StreamPrep(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ], FREEZE_TIME);
  1126. return 1;
  1127. }
  1128. }
  1129. if(PlayerInfo[playerid][pRank] > 3)
  1130. {
  1131. for(new i = 0; i < sizeof(DDoorsInfo); i++)
  1132. {
  1133. if (IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddExteriorX], DDoorsInfo[i][ddExteriorY], DDoorsInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddExteriorVW] && DDoorsInfo[i][ddVIP] > 0)
  1134. {
  1135. SetPlayerInterior(playerid,DDoorsInfo[i][ddInteriorInt]);
  1136. PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddInteriorInt];
  1137. PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddInteriorVW];
  1138. SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddInteriorVW]);
  1139. if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
  1140. SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
  1141. SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorA]);
  1142. if(GetPVarInt(playerid, "tpDeliverVehTimer") > 0)
  1143. SetPVarInt(playerid, "tpJustEntered", 1);
  1144. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorVW]);
  1145. LinkVehicleToInterior(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorInt]);
  1146. }
  1147. else {
  1148. SetPlayerPos(playerid,DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
  1149. SetPlayerFacingAngle(playerid,DDoorsInfo[i][ddInteriorA]);
  1150. SetCameraBehindPlayer(playerid);
  1151. }
  1152. if(DDoorsInfo[i][ddCustomInterior]) Player_StreamPrep(playerid, DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ], FREEZE_TIME);
  1153. return 1;
  1154. }
  1155. }
  1156. }
  1157. for(new i = 0; i < sizeof(Businesses); i++) {
  1158. if (IsPlayerInRangeOfPoint(playerid,3,Businesses[i][bExtPos][0], Businesses[i][bExtPos][1], Businesses[i][bExtPos][2])) {
  1159. if (Businesses[i][bExtPos][1] == 0.0) return 1;
  1160. format(string, sizeof(string), "* %s breaches the door, and enters.", GetPlayerNameEx(playerid));
  1161. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1162. SetPlayerInterior(playerid,Businesses[i][bInt]);
  1163. if(Businesses[i][bVW] == 0) SetPlayerVirtualWorld(playerid, BUSINESS_BASE_VW + i), PlayerInfo[playerid][pVW] = BUSINESS_BASE_VW + i;
  1164. else SetPlayerVirtualWorld(playerid, Businesses[i][bVW]), PlayerInfo[playerid][pVW] = Businesses[i][bVW];
  1165. SetPlayerPos(playerid,Businesses[i][bIntPos][0],Businesses[i][bIntPos][1],Businesses[i][bIntPos][2]);
  1166. SetPlayerFacingAngle(playerid, Businesses[i][bIntPos][3]);
  1167. SetCameraBehindPlayer(playerid);
  1168. GameTextForPlayer(playerid, "~r~Breached the door", 5000, 1);
  1169. return 1;
  1170. }
  1171. }
  1172. if (IsPlayerInRangeOfPoint(playerid,4.0,648.7888,-1360.7708,13.5875))
  1173. {
  1174. format(string, sizeof(string), "* %s breaches the door, and enters.", GetPlayerNameEx(playerid));
  1175. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1176. SetPlayerInterior(playerid,1);
  1177. PlayerInfo[playerid][pInt] = 1;
  1178. SetPlayerVirtualWorld(playerid, 4225);
  1179. PlayerInfo[playerid][pVW] = 4225;
  1180. SetPlayerPos(playerid,626.4980,21.4223,1107.9686);
  1181. SetPlayerFacingAngle(playerid, 178.6711);
  1182. Player_StreamPrep(playerid, 626.4980,21.4223,1107.9686, FREEZE_TIME);
  1183. }
  1184. }
  1185. else
  1186. {
  1187. SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
  1188. }
  1189. return 1;
  1190. }
  1191. CMD:take(playerid, params[])
  1192. {
  1193. if(IsACop(playerid))
  1194. {
  1195. new string[128], choice[32], giveplayerid;
  1196. if(sscanf(params, "s[32]u", choice, giveplayerid))
  1197. {
  1198. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /take [name] [player]");
  1199. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Weapons, Pot, Crack, Meth, Ecstasy, Materials, Radio, Heroin, Rawopium, Syringes, PotSeeds, OpiumSeeds, DrugCrates");
  1200. return 1;
  1201. }
  1202. if(PlayerInfo[playerid][pAdmin] < 2 && (PlayerInfo[giveplayerid][pJailTime] && strfind(PlayerInfo[giveplayerid][pPrisonReason], "[OOC]", true) != -1)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot take items from a OOC Prisoner.");
  1203. if (playerid == giveplayerid)
  1204. {
  1205. SendClientMessageEx(playerid, COLOR_GREY, "You cannot take things from yourself!");
  1206. return 1;
  1207. }
  1208. else if(strcmp(choice,"opiumseeds",true) == 0)
  1209. {
  1210. if(IsPlayerConnected(giveplayerid))
  1211. {
  1212. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1213. {
  1214. if(PlayerInfo[giveplayerid][pOpiumSeeds] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any opium seeds.");
  1215. format(string, sizeof(string), "* You have taken away %s's opiumseeds.", GetPlayerNameEx(giveplayerid));
  1216. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1217. format(string, sizeof(string), "* Officer %s has taken away your opiumseeds.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1218. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1219. format(string, sizeof(string), "* Officer %s has taken away %s's opiumseeds.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1220. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1221. PlayerInfo[giveplayerid][pOpiumSeeds] = 0;
  1222. }
  1223. else
  1224. {
  1225. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1226. return 1;
  1227. }
  1228. }
  1229. else
  1230. {
  1231. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1232. return 1;
  1233. }
  1234. }
  1235. else if(strcmp(choice,"PotSeeds",true) == 0)
  1236. {
  1237. if(IsPlayerConnected(giveplayerid))
  1238. {
  1239. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1240. {
  1241. if(PlayerInfo[giveplayerid][pWSeeds] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any pot seeds.");
  1242. format(string, sizeof(string), "* You have taken away %s's Cannabisseeds.", GetPlayerNameEx(giveplayerid));
  1243. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1244. format(string, sizeof(string), "* Officer %s has taken away your Cannabisseeds.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1245. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1246. format(string, sizeof(string), "* Officer %s has taken away %s's Cannabisseeds.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1247. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1248. PlayerInfo[giveplayerid][pWSeeds] = 0;
  1249. }
  1250. else
  1251. {
  1252. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1253. return 1;
  1254. }
  1255. }
  1256. else
  1257. {
  1258. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1259. return 1;
  1260. }
  1261. }
  1262. else if(strcmp(choice,"drugcrates",true) == 0)
  1263. {
  1264. if(IsPlayerConnected(giveplayerid))
  1265. {
  1266. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1267. {
  1268. if(PlayerInfo[giveplayerid][pCrates] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any drug crates.");
  1269. format(string, sizeof(string), "* You have taken away %s's Drug Crates.", GetPlayerNameEx(giveplayerid));
  1270. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1271. format(string, sizeof(string), "* Officer %s has taken away your Drug Crates.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1272. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1273. format(string, sizeof(string), "* Officer %s has taken away %s's Drug Crates.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1274. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1275. PlayerInfo[giveplayerid][pCrates] = 0;
  1276. }
  1277. else
  1278. {
  1279. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1280. return 1;
  1281. }
  1282. }
  1283. else
  1284. {
  1285. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1286. return 1;
  1287. }
  1288. }
  1289. else if(strcmp(choice,"Syringes",true) == 0)
  1290. {
  1291. if(IsPlayerConnected(giveplayerid))
  1292. {
  1293. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1294. {
  1295. if(PlayerInfo[giveplayerid][pSyringes] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any syringes.");
  1296. format(string, sizeof(string), "* You have taken away %s's syringes.", GetPlayerNameEx(giveplayerid));
  1297. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1298. format(string, sizeof(string), "* Officer %s has taken away your syringes.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1299. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1300. format(string, sizeof(string), "* Officer %s has taken away %s's syringes.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1301. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1302. PlayerInfo[giveplayerid][pSyringes] = 0;
  1303. }
  1304. else
  1305. {
  1306. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1307. return 1;
  1308. }
  1309. }
  1310. else
  1311. {
  1312. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1313. return 1;
  1314. }
  1315. }
  1316. else if(strcmp(choice,"Rawopium",true) == 0)
  1317. {
  1318. if(IsPlayerConnected(giveplayerid))
  1319. {
  1320. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1321. {
  1322. if(PlayerInfo[giveplayerid][pRawOpium] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any raw opium.");
  1323. format(string, sizeof(string), "* You have taken away %s's raw opium.", GetPlayerNameEx(giveplayerid));
  1324. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1325. format(string, sizeof(string), "* Officer %s has taken away your raw opium.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1326. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1327. format(string, sizeof(string), "* Officer %s has taken away %s's raw opium.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1328. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1329. PlayerInfo[giveplayerid][pRawOpium] = 0;
  1330. }
  1331. else
  1332. {
  1333. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1334. return 1;
  1335. }
  1336. }
  1337. else
  1338. {
  1339. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1340. return 1;
  1341. }
  1342. }
  1343. else if(strcmp(choice,"Meth",true) == 0)
  1344. {
  1345. if(IsPlayerConnected(giveplayerid))
  1346. {
  1347. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1348. {
  1349. if(PlayerInfo[giveplayerid][pDrugs][2] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any meth.");
  1350. format(string, sizeof(string), "* You have taken away %s's Meth.", GetPlayerNameEx(giveplayerid));
  1351. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1352. format(string, sizeof(string), "* Officer %s has taken away your Meth.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1353. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1354. format(string, sizeof(string), "* Officer %s has taken away %s's Meth.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1355. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1356. PlayerInfo[giveplayerid][pDrugs][2] = 0;
  1357. }
  1358. else
  1359. {
  1360. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1361. return 1;
  1362. }
  1363. }
  1364. else
  1365. {
  1366. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1367. return 1;
  1368. }
  1369. }
  1370. else if(strcmp(choice,"Ecstasy",true) == 0)
  1371. {
  1372. if(IsPlayerConnected(giveplayerid))
  1373. {
  1374. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1375. {
  1376. if(PlayerInfo[giveplayerid][pDrugs][3] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any ecstasy.");
  1377. format(string, sizeof(string), "* You have taken away %s's Ecstasy.", GetPlayerNameEx(giveplayerid));
  1378. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1379. format(string, sizeof(string), "* Officer %s has taken away your Ecstasy.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1380. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1381. format(string, sizeof(string), "* Officer %s has taken away %s's Ecstasy.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1382. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1383. PlayerInfo[giveplayerid][pDrugs][3] = 0;
  1384. }
  1385. else
  1386. {
  1387. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1388. return 1;
  1389. }
  1390. }
  1391. else
  1392. {
  1393. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1394. return 1;
  1395. }
  1396. }
  1397. else if(strcmp(choice,"Heroin",true) == 0)
  1398. {
  1399. if(IsPlayerConnected(giveplayerid))
  1400. {
  1401. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1402. {
  1403. if(PlayerInfo[giveplayerid][pDrugs][4] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any heroin.");
  1404. format(string, sizeof(string), "* You have taken away %s's Heroin.", GetPlayerNameEx(giveplayerid));
  1405. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1406. format(string, sizeof(string), "* Officer %s has taken away your Heroin.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1407. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1408. format(string, sizeof(string), "* Officer %s has taken away %s's Heroin.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1409. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1410. PlayerInfo[giveplayerid][pDrugs][4] = 0;
  1411. }
  1412. else
  1413. {
  1414. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1415. return 1;
  1416. }
  1417. }
  1418. else
  1419. {
  1420. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1421. return 1;
  1422. }
  1423. }
  1424. else if(strcmp(choice,"radio",true) == 0)
  1425. {
  1426. if(IsPlayerConnected(giveplayerid))
  1427. {
  1428. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1429. {
  1430. if(PlayerInfo[giveplayerid][pRadio] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have a radio.");
  1431. format(string, sizeof(string), "* You have taken away %s's radio.", GetPlayerNameEx(giveplayerid));
  1432. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1433. format(string, sizeof(string), "* Officer %s has taken away your radio.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1434. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1435. format(string, sizeof(string), "* Officer %s has taken away %s's radio.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1436. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1437. PlayerInfo[giveplayerid][pRadio] = 0;
  1438. PlayerInfo[giveplayerid][pRadioFreq] = 0;
  1439. }
  1440. else
  1441. {
  1442. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1443. return 1;
  1444. }
  1445. }
  1446. else
  1447. {
  1448. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1449. return 1;
  1450. }
  1451. }
  1452. else if(strcmp(choice,"weapons",true) == 0)
  1453. {
  1454. if(IsPlayerConnected(giveplayerid))
  1455. {
  1456. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1457. {
  1458. format(string, sizeof(string), "* You have taken away %s's weapons.", GetPlayerNameEx(giveplayerid));
  1459. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1460. format(string, sizeof(string), "* Officer %s has taken away your weapons.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1461. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1462. format(string, sizeof(string), "* Officer %s has taken away %s's weapons.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1463. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1464. ResetPlayerWeaponsEx(giveplayerid);
  1465. }
  1466. else
  1467. {
  1468. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1469. return 1;
  1470. }
  1471. }
  1472. else
  1473. {
  1474. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1475. return 1;
  1476. }
  1477. }
  1478. else if(strcmp(choice,"Pot",true) == 0)
  1479. {
  1480. if(IsPlayerConnected(giveplayerid))
  1481. {
  1482. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1483. {
  1484. if(PlayerInfo[giveplayerid][pDrugs][0] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any pot.");
  1485. format(string, sizeof(string), "* You have taken away %s's Cannabis.", GetPlayerNameEx(giveplayerid));
  1486. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1487. format(string, sizeof(string), "* Officer %s has taken away your Cannabis.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1488. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1489. format(string, sizeof(string), "* Officer %s has taken away %s's Cannabis.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1490. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1491. PlayerInfo[giveplayerid][pDrugs][0] = 0;
  1492. }
  1493. else
  1494. {
  1495. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1496. return 1;
  1497. }
  1498. }
  1499. else
  1500. {
  1501. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1502. return 1;
  1503. }
  1504. }
  1505. else if(strcmp(choice,"crack",true) == 0)
  1506. {
  1507. if(IsPlayerConnected(giveplayerid))
  1508. {
  1509. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1510. {
  1511. if(PlayerInfo[giveplayerid][pDrugs][1] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any crack.");
  1512. format(string, sizeof(string), "* You have taken away %s's crack.", GetPlayerNameEx(giveplayerid));
  1513. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1514. format(string, sizeof(string), "* Officer %s has taken away your crack.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1515. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1516. format(string, sizeof(string), "* Officer %s has taken away %s's crack.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1517. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1518. PlayerInfo[giveplayerid][pDrugs][1] = 0;
  1519. }
  1520. else
  1521. {
  1522. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1523. return 1;
  1524. }
  1525. }
  1526. else
  1527. {
  1528. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1529. return 1;
  1530. }
  1531. }
  1532. else if(strcmp(choice,"materials",true) == 0)
  1533. {
  1534. if(IsPlayerConnected(giveplayerid))
  1535. {
  1536. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1537. {
  1538. if(PlayerInfo[giveplayerid][pMats] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "That player does not have any materials.");
  1539. format(string, sizeof(string), "* You have taken away %s's materials.", GetPlayerNameEx(giveplayerid));
  1540. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1541. format(string, sizeof(string), "* Officer %s as taken away your materials.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1542. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1543. format(string, sizeof(string), "* Officer %s has taken away %s's materials.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1544. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1545. PlayerInfo[giveplayerid][pMats] = 0;
  1546. }
  1547. else
  1548. {
  1549. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1550. return 1;
  1551. }
  1552. }
  1553. else
  1554. {
  1555. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1556. return 1;
  1557. }
  1558. }
  1559. else
  1560. {
  1561. SendClientMessageEx(playerid, COLOR_GREY, " Invalid item specified.");
  1562. return 1;
  1563. }
  1564. GroupLog(PlayerInfo[playerid][pMember], string);
  1565. }
  1566. else
  1567. {
  1568. SendClientMessageEx(playerid, COLOR_GREY, " You're not a law enforcement officer.");
  1569. return 1;
  1570. }
  1571. return 1;
  1572. }
  1573. CMD:tackle(playerid, params[])
  1574. {
  1575. #if defined zombiemode
  1576. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't tackle humans!");
  1577. #endif
  1578. if((0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS) && PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[playerid][pMember]][g_iTackleAccess])
  1579. {
  1580. if(GetPVarInt(playerid, "ReTackleCooldown") != 0 && gettime() < GetPVarInt(playerid, "ReTackleCooldown") + 30)
  1581. {
  1582. new string[128];
  1583. format(string, sizeof(string), "You must wait %d seconds before you can enable tackle mode again!", GetPVarInt(playerid, "ReTackleCooldown") + 30 - gettime());
  1584. return SendClientMessageEx(playerid, COLOR_GRAD2, string);
  1585. }
  1586. if(GetPVarInt(playerid, "WeaponsHolstered") == 0) //Unholstered
  1587. {
  1588. cmd_holster(playerid, params);
  1589. //UnholsterWeapon(playerid, 0);
  1590. }
  1591. if(GetPVarInt(playerid, "TackleMode") == 0)
  1592. {
  1593. SetPVarInt(playerid, "TackleMode", 1);
  1594. return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You've enabled tackling. Aim at the suspect and hit enter to initiate the tackle.");
  1595. }
  1596. else
  1597. {
  1598. SetPVarInt(playerid, "TackleMode", 0);
  1599. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You've disabled tackling. You may now unholster your weapon.");
  1600. cmd_holster(playerid, params);
  1601. return SetPVarInt(playerid, "ReTackleCooldown", gettime());
  1602. }
  1603. }
  1604. else return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not allowed to use this command.");
  1605. }
  1606. CMD:tazer(playerid, params[])
  1607. {
  1608. if(HungerPlayerInfo[playerid][hgInEvent] != 0) return SendClientMessageEx(playerid, COLOR_GREY, " You cannot do this while being in the Hunger Games Event!");
  1609. if(PlayerInfo[playerid][pAccountRestricted] != 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "Your account is restricted!");
  1610. #if defined zombiemode
  1611. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't use this.");
  1612. #endif
  1613. if(IsACop(playerid))
  1614. {
  1615. new string[128];
  1616. if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
  1617. if(IsPlayerInAnyVehicle(playerid))
  1618. {
  1619. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
  1620. return 1;
  1621. }
  1622. if(GetPVarType(playerid, "IsInArena"))
  1623. {
  1624. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
  1625. return 1;
  1626. }
  1627. if(GetPVarInt( playerid, "EventToken") != 0)
  1628. {
  1629. SendClientMessageEx(playerid, COLOR_GREY, "You can't use the tazer while you're in an event.");
  1630. return 1;
  1631. }
  1632. if(PlayerCuffedTime[playerid] > 0)
  1633. {
  1634. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1635. return 1;
  1636. }
  1637. if(GetPVarInt(playerid, "Injured") == 1)
  1638. {
  1639. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1640. return 1;
  1641. }
  1642. if(PlayerInfo[playerid][pJailTime] > 0)
  1643. {
  1644. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
  1645. return 1;
  1646. }
  1647. if(PlayerCuffed[playerid] >= 1) {
  1648. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while tazed/cuffed.");
  1649. return 1;
  1650. }
  1651. if(PlayerInfo[playerid][pHasTazer] < 1)
  1652. {
  1653. SendClientMessage(playerid, COLOR_WHITE, "You do not have a tazer!");
  1654. return 1;
  1655. }
  1656. if(pTazer{playerid} == 0)
  1657. {
  1658. if(TazerTimeout[playerid] > 0) return SendClientMessageEx(playerid, COLOR_WHITE, "Your tazer is reloading");
  1659. pTazerReplace{playerid} = PlayerInfo[playerid][pGuns][2];
  1660. if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
  1661. format(string, sizeof(string), "* %s unholsters their tazer.", GetPlayerNameEx(playerid));
  1662. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1663. GivePlayerValidWeapon(playerid, 23);
  1664. pTazer{playerid} = 1;
  1665. SetPlayerAmmo(playerid, 23, 60000);
  1666. SetPVarInt(playerid, "TazerShots", 2);
  1667. SetPlayerAmmo(playerid, WEAPON_SILENCED, 3);
  1668. }
  1669. else
  1670. {
  1671. RemovePlayerWeapon(playerid, 23);
  1672. GivePlayerValidWeapon(playerid, pTazerReplace{playerid});
  1673. format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid));
  1674. ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1675. pTazer{playerid} = 0;
  1676. }
  1677. }
  1678. else
  1679. {
  1680. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer!");
  1681. return 1;
  1682. }
  1683. return 1;
  1684. }
  1685. CMD:vradar(playerid, params[])
  1686. {
  1687. if (!IsPlayerInAnyVehicle(playerid))
  1688. return SendClientMessageEx(playerid, 0xFF0000FF, "You cannot use a dashboard radar outside of a vehicle.");
  1689. if(!IsACop(playerid) && !IsATowman(playerid))
  1690. return SendClientMessageEx(playerid, COLOR_GREY, "You are not a law enforcement officer/towman!");
  1691. switch (CarRadars[playerid])
  1692. {
  1693. case 0: // player has not deployed dashboard radar
  1694. {
  1695. CarRadars[playerid] = 1;
  1696. PlayerTextDrawShow(playerid, _crTextTarget[playerid]);
  1697. PlayerTextDrawShow(playerid, _crTextSpeed[playerid]);
  1698. PlayerTextDrawShow(playerid, _crTickets[playerid]);
  1699. SendClientMessageEx(playerid, COLOR_WHITE, "You are now using your dashboard radar, use /vradar again to disable it.");
  1700. SetPVarInt(playerid, "_lastTicketWarning", 0);
  1701. }
  1702. case 1..2: // dashboard radar has been deployed
  1703. {
  1704. CarRadars[playerid] = 0;
  1705. PlayerTextDrawHide(playerid, _crTextTarget[playerid]);
  1706. PlayerTextDrawHide(playerid, _crTextSpeed[playerid]);
  1707. PlayerTextDrawHide(playerid, _crTickets[playerid]);
  1708. SendClientMessageEx(playerid, COLOR_WHITE, "You are no longer using your dashboard radar.");
  1709. DeletePVar(playerid, "_lastTicketWarning");
  1710. }
  1711. }
  1712. return 1;
  1713. }
  1714. CMD:radargun(playerid, params[])
  1715. {
  1716. if(IsACop(playerid))
  1717. {
  1718. new string[128];
  1719. if(IsPlayerInAnyVehicle(playerid))
  1720. {
  1721. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
  1722. return 1;
  1723. }
  1724. if(GetPVarType(playerid, "IsInArena"))
  1725. {
  1726. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in an arena!");
  1727. return 1;
  1728. }
  1729. if(GetPVarInt( playerid, "EventToken") != 0)
  1730. {
  1731. SendClientMessageEx(playerid, COLOR_GREY, "You can't use the tazer while you're in an event.");
  1732. return 1;
  1733. }
  1734. if(GetPVarInt(playerid, "Injured") == 1)
  1735. {
  1736. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1737. return 1;
  1738. }
  1739. if(PlayerInfo[playerid][pJailTime] > 0)
  1740. {
  1741. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
  1742. return 1;
  1743. }
  1744. if(PlayerCuffed[playerid] >= 1) {
  1745. SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while tazed/cuffed.");
  1746. return 1;
  1747. }
  1748. new SpeedRadar = GetPVarInt(playerid, "SpeedRadar");
  1749. if(SpeedRadar == 0)
  1750. {
  1751. SetPVarInt(playerid, "RadarReplacement", PlayerInfo[playerid][pGuns][9]);
  1752. if(PlayerInfo[playerid][pGuns][9] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][9]);
  1753. format(string, sizeof(string), "* %s takes out a LIDAR speed gun.", GetPlayerNameEx(playerid));
  1754. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1755. GivePlayerValidWeapon(playerid, 43);
  1756. SetPVarInt(playerid, "SpeedRadar", 1);
  1757. }
  1758. else
  1759. {
  1760. RemovePlayerWeapon(playerid, 43);
  1761. GivePlayerValidWeapon(playerid, GetPVarInt(playerid, "RadarReplacement"));
  1762. format(string, sizeof(string), "* %s puts away their LIDAR speed gun.", GetPlayerNameEx(playerid));
  1763. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1764. DeletePVar(playerid, "SpeedRadar");
  1765. }
  1766. }
  1767. else
  1768. {
  1769. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer!");
  1770. return 1;
  1771. }
  1772. return 1;
  1773. }
  1774. CMD:cuff(playerid, params[])
  1775. {
  1776. if(IsACop(playerid))
  1777. {
  1778. if(GetPVarInt(playerid, "Injured") == 1 || PlayerCuffed[ playerid ] >= 1 || PlayerInfo[ playerid ][ pJailTime ] > 0 || PlayerInfo[playerid][pHospital] > 0)
  1779. {
  1780. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
  1781. return 1;
  1782. }
  1783. if(PlayerInfo[playerid][pHasCuff] < 1)
  1784. {
  1785. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have any pair of cuffs on you!");
  1786. return 1;
  1787. }
  1788. new string[128], giveplayerid, Float:health, Float:armor;
  1789. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cuff [player]");
  1790. if(IsPlayerConnected(giveplayerid))
  1791. {
  1792. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1793. {
  1794. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
  1795. if(GetPVarInt(giveplayerid, "Injured") == 1) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff someone in a injured state.");
  1796. if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP || GetPVarInt(giveplayerid, "pBagged") >= 1)
  1797. {
  1798. if(PlayerInfo[giveplayerid][pConnectHours] < 32) SendClientMessageEx(giveplayerid, COLOR_WHITE, "If you logout now you will automatically be prisoned for 2+ hours!");
  1799. format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
  1800. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1801. format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
  1802. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1803. format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1804. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1805. GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
  1806. TogglePlayerControllable(giveplayerid, 0);
  1807. ClearAnimationsEx(giveplayerid);
  1808. GetHealth(giveplayerid, health);
  1809. GetArmour(giveplayerid, armor);
  1810. SetPVarFloat(giveplayerid, "cuffhealth",health);
  1811. SetPVarFloat(giveplayerid, "cuffarmor",armor);
  1812. SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
  1813. ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0,1);
  1814. PlayerCuffed[giveplayerid] = 2;
  1815. SetPVarInt(giveplayerid, "PlayerCuffed", 2);
  1816. SetPVarInt(giveplayerid, "IsFrozen", 1);
  1817. DeletePVar(giveplayerid, "pBagged");
  1818. //Frozen[giveplayerid] = 1;
  1819. PlayerCuffedTime[giveplayerid] = 300;
  1820. }
  1821. else if(GetPVarType(giveplayerid, "IsTackled"))
  1822. {
  1823. format(string, sizeof(string), "* %s removes a set of cuffs from his belt and attempts to cuff %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1824. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1825. SetTimerEx("CuffTackled", 4000, 0, "ii", playerid, giveplayerid);
  1826. }
  1827. else
  1828. {
  1829. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't restrained!");
  1830. return 1;
  1831. }
  1832. }
  1833. else
  1834. {
  1835. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1836. return 1;
  1837. }
  1838. }
  1839. else
  1840. {
  1841. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1842. return 1;
  1843. }
  1844. }
  1845. else
  1846. {
  1847. SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
  1848. }
  1849. return 1;
  1850. }
  1851. CMD:uncuff(playerid, params[])
  1852. {
  1853. if(IsACop(playerid))
  1854. {
  1855. if(PlayerCuffed[playerid] == 2) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot uncuff others while being cuffed yourself!");
  1856. new string[128], giveplayerid;
  1857. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /uncuff [player]");
  1858. if(IsPlayerConnected(giveplayerid))
  1859. {
  1860. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1861. {
  1862. /*if(PlayerInfo[giveplayerid][pJailTime] >= 1)
  1863. {
  1864. SendClientMessageEx(playerid, COLOR_WHITE, "You can't uncuff a jailed player.");
  1865. return 1;
  1866. } */
  1867. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You can't uncuff yourself."); return 1; }
  1868. if(PlayerCuffed[giveplayerid] > 1)
  1869. {
  1870. DeletePVar(giveplayerid, "IsFrozen");
  1871. format(string, sizeof(string), "* You have been uncuffed by %s.", GetPlayerNameEx(playerid));
  1872. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1873. format(string, sizeof(string), "* You uncuffed %s.", GetPlayerNameEx(giveplayerid));
  1874. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1875. format(string, sizeof(string), "* %s has uncuffed %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1876. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1877. GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
  1878. TogglePlayerControllable(giveplayerid, 1);
  1879. ClearAnimationsEx(giveplayerid);
  1880. SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
  1881. PlayerCuffed[giveplayerid] = 0;
  1882. PlayerCuffedTime[giveplayerid] = 0;
  1883. SetHealth(giveplayerid, GetPVarFloat(giveplayerid, "cuffhealth"));
  1884. SetArmour(giveplayerid, GetPVarFloat(giveplayerid, "cuffarmor"));
  1885. DeletePVar(giveplayerid, "cuffhealth");
  1886. DeletePVar(giveplayerid, "PlayerCuffed");
  1887. DeletePVar(giveplayerid, "jailcuffs");
  1888. }
  1889. else if(GetPVarInt(giveplayerid, "jailcuffs") == 1)
  1890. {
  1891. DeletePVar(giveplayerid, "IsFrozen");
  1892. format(string, sizeof(string), "* You have been uncuffed by %s.", GetPlayerNameEx(playerid));
  1893. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1894. format(string, sizeof(string), "* You uncuffed %s.", GetPlayerNameEx(giveplayerid));
  1895. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1896. format(string, sizeof(string), "* %s has uncuffed %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1897. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1898. GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
  1899. ClearAnimationsEx(giveplayerid);
  1900. SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
  1901. DeletePVar(giveplayerid, "jailcuffs");
  1902. }
  1903. else
  1904. {
  1905. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't cuffed.");
  1906. return 1;
  1907. }
  1908. }
  1909. else
  1910. {
  1911. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  1912. return 1;
  1913. }
  1914. }
  1915. else
  1916. {
  1917. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  1918. return 1;
  1919. }
  1920. }
  1921. else
  1922. {
  1923. SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
  1924. }
  1925. return 1;
  1926. }
  1927. CMD:detain(playerid, params[])
  1928. {
  1929. if(IsACop(playerid))
  1930. {
  1931. if(IsPlayerInAnyVehicle(playerid))
  1932. {
  1933. SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
  1934. return 1;
  1935. }
  1936. new string[128], giveplayerid, seat;
  1937. if(sscanf(params, "ud", giveplayerid, seat)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /detain [player] [seatid 1-3]");
  1938. if(IsPlayerConnected(giveplayerid))
  1939. {
  1940. if(seat < 1 || seat > 3)
  1941. {
  1942. SendClientMessageEx(playerid, COLOR_GRAD1, "The seat ID cannot be above 3 or below 1.");
  1943. return 1;
  1944. }
  1945. /*if(IsACop(giveplayerid))
  1946. {
  1947. SendClientMessageEx(playerid, COLOR_GREY, "You can't detain other law enforcement officers.");
  1948. return 1;
  1949. }*/
  1950. if(IsPlayerInAnyVehicle(giveplayerid))
  1951. {
  1952. SendClientMessageEx(playerid, COLOR_GREY, "That person is in a car - get them out first.");
  1953. return 1;
  1954. }
  1955. if (ProxDetectorS(8.0, playerid, giveplayerid))
  1956. {
  1957. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot detain yourself!"); return 1; }
  1958. if(PlayerCuffed[giveplayerid] == 2)
  1959. {
  1960. new carid = gLastCar[playerid];
  1961. if(IsSeatAvailable(carid, seat))
  1962. {
  1963. new Float:pos[6];
  1964. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  1965. GetPlayerPos(giveplayerid, pos[3], pos[4], pos[5]);
  1966. GetVehiclePos( carid, pos[0], pos[1], pos[2]);
  1967. if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 &&
  1968. floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 &&
  1969. floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false;
  1970. format(string, sizeof(string), "* You were detained by %s .", GetPlayerNameEx(playerid));
  1971. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  1972. format(string, sizeof(string), "* You detained %s.", GetPlayerNameEx(giveplayerid));
  1973. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  1974. format(string, sizeof(string), "* %s throws %s in the vehicle.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  1975. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1976. GameTextForPlayer(giveplayerid, "~r~Detained", 2500, 3);
  1977. ClearAnimationsEx(giveplayerid);
  1978. TogglePlayerControllable(giveplayerid, false);
  1979. IsPlayerEntering{giveplayerid} = true;
  1980. PutPlayerInVehicle(giveplayerid, carid, seat);
  1981. }
  1982. else
  1983. {
  1984. SendClientMessageEx(playerid, COLOR_GREY, "That seat isn't available!");
  1985. return 1;
  1986. }
  1987. }
  1988. else
  1989. {
  1990. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't cuffed.");
  1991. return 1;
  1992. }
  1993. }
  1994. else
  1995. {
  1996. SendClientMessageEx(playerid, COLOR_GREY, " You're not close enough to the person or your car!");
  1997. return 1;
  1998. }
  1999. }
  2000. else
  2001. {
  2002. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  2003. return 1;
  2004. }
  2005. }
  2006. else
  2007. {
  2008. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer!");
  2009. }
  2010. return 1;
  2011. }
  2012. CMD:drag(playerid, params[])
  2013. {
  2014. if(IsACop(playerid))
  2015. {
  2016. new string[128], giveplayerid;
  2017. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /drag [playerid]");
  2018. if(IsPlayerConnected(giveplayerid))
  2019. {
  2020. if(giveplayerid == playerid) {
  2021. SendClientMessageEx(playerid, COLOR_WHITE, " You try to grab yourself, but nothing happens.");
  2022. return 1;
  2023. }
  2024. if(GetPVarInt(giveplayerid, "PlayerCuffed") == 2)
  2025. {
  2026. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, " You must be out of the vehicle to use this command.");
  2027. if(GetPVarInt(giveplayerid, "BeingDragged") == 1)
  2028. {
  2029. SendClientMessageEx(playerid, COLOR_WHITE, " That person is already being dragged. ");
  2030. return 1;
  2031. }
  2032. new Float:dX, Float:dY, Float:dZ;
  2033. GetPlayerPos(giveplayerid, dX, dY, dZ);
  2034. if(!IsPlayerInRangeOfPoint(playerid, 5.0, dX, dY, dZ))
  2035. {
  2036. SendClientMessageEx(playerid, COLOR_GRAD2, " That suspect is not near you.");
  2037. return 1;
  2038. }
  2039. format(string, sizeof(string), "* %s is now dragging you.", GetPlayerNameEx(playerid));
  2040. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  2041. format(string, sizeof(string), "* You are now dragging %s, you may move them now.", GetPlayerNameEx(giveplayerid));
  2042. SendClientMessageEx(playerid, COLOR_WHITE, string);
  2043. format(string, sizeof(string), "* %s grabs ahold of %s and begins to move them.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2044. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2045. SendClientMessageEx(playerid, COLOR_WHITE, "You are now dragging the suspect, press the '{AA3333}FIRE{FFFFFF}' button to stop.");
  2046. SetPVarInt(giveplayerid, "BeingDragged", 1);
  2047. SetPVarInt(playerid, "DraggingPlayer", giveplayerid);
  2048. SetTimerEx("DragPlayer", 1000, 0, "ii", playerid, giveplayerid);
  2049. }
  2050. else
  2051. {
  2052. SendClientMessageEx(playerid, COLOR_WHITE, " The specified person is not cuffed !");
  2053. }
  2054. }
  2055. }
  2056. else
  2057. {
  2058. SendClientMessageEx(playerid, COLOR_GREY, "You are not a Law Enforcement Official!");
  2059. return 1;
  2060. }
  2061. return 1;
  2062. }
  2063. CMD:wanted(playerid, params[])
  2064. {
  2065. if(IsACop(playerid) || IsAJudge(playerid) || IsAGovernment(playerid) || PlayerInfo[playerid][pJob] == 2 || PlayerInfo[playerid][pJob2] == 2 || PlayerInfo[playerid][pJob3] == 2)
  2066. {
  2067. szMiscArray[0] = 0;
  2068. new x,
  2069. szNation[24];
  2070. SendClientMessageEx(playerid, COLOR_GREEN, "Current Wanted Suspects:");
  2071. foreach(new i: Player)
  2072. {
  2073. if(PlayerInfo[i][pWantedLevel] >= 1)
  2074. {
  2075. switch(PlayerInfo[i][pNation]) {
  2076. case 0: szNation = "San Andreas";
  2077. case 1: szNation = "New Robada";
  2078. default: szNation = "None";
  2079. }
  2080. format(szMiscArray, sizeof(szMiscArray), "%s%s: %d (%s)", szMiscArray, GetPlayerNameEx(i),PlayerInfo[i][pWantedLevel], szNation);
  2081. x++;
  2082. if(x > 3) {
  2083. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  2084. x = 0;
  2085. format(szMiscArray, sizeof(szMiscArray), " ");
  2086. } else {
  2087. format(szMiscArray, sizeof(szMiscArray), "%s, ", szMiscArray);
  2088. }
  2089. }
  2090. }
  2091. if(x <= 3 && x > 0)
  2092. {
  2093. szMiscArray[strlen(szMiscArray)-2] = '.';
  2094. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  2095. }
  2096. }
  2097. else
  2098. {
  2099. SendClientMessageEx(playerid, COLOR_GREY, " You're not a lawyer or a law enforcement officer!");
  2100. }
  2101. return 1;
  2102. }
  2103. CMD:ticket(playerid, params[])
  2104. {
  2105. if(IsACop(playerid))
  2106. {
  2107. new string[128], giveplayerid, moneys, reason[64];
  2108. if(sscanf(params, "uds[64]", giveplayerid, moneys, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /ticket [player] [price] [reason]");
  2109. if(giveplayerid == playerid)
  2110. {
  2111. SendClientMessageEx(playerid, COLOR_GREY, "You can't ticket yourself.");
  2112. return 1;
  2113. }
  2114. if(moneys < 1 || moneys > 100000) { SendClientMessageEx(playerid, COLOR_GREY, "The ticket price can't be below $1 or higher then $100,000."); return 1; }
  2115. if(PlayerInfo[giveplayerid][pConnectHours] < 30 && moneys > 5000) { SendClientMessageEx(playerid, COLOR_GREY, "You can only ticket players with less than 30 hours a maximum of $5000"); return 1; }
  2116. if(IsPlayerConnected(giveplayerid))
  2117. {
  2118. if(giveplayerid != INVALID_PLAYER_ID)
  2119. {
  2120. if (ProxDetectorS(8.0, playerid, giveplayerid))
  2121. {
  2122. if(giveplayerid == playerid) return 1;
  2123. format(string, sizeof(string), "* You gave %s a ticket costing $%d, reason: %s", GetPlayerNameEx(giveplayerid), moneys, reason);
  2124. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  2125. format(string, sizeof(string), "* Officer %s has given you a ticket costing $%d, reason: %s", GetPlayerNameEx(playerid), moneys, reason);
  2126. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  2127. format(string, sizeof(string), "* Officer %s writes up a ticket and gives it to %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  2128. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2129. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, "* Type /accept ticket, to accept it.");
  2130. TicketOffer[giveplayerid] = playerid;
  2131. TicketMoney[giveplayerid] = moneys;
  2132. SetPVarString(playerid, "ticketreason", reason);
  2133. return 1;
  2134. }
  2135. else
  2136. {
  2137. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  2138. return 1;
  2139. }
  2140. }
  2141. }
  2142. else
  2143. {
  2144. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  2145. return 1;
  2146. }
  2147. }
  2148. return 1;
  2149. }
  2150. CMD:wheelclamp(playerid, params[])
  2151. {
  2152. if(PlayerInfo[playerid][pMember] != INVALID_GROUP_ID && PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[playerid][pMember]][g_iWheelClamps]) {
  2153. new vehicleid = GetClosestCar(playerid, INVALID_VEHICLE_ID, 5.0),
  2154. szMessage[24 + 51 + MAX_PLAYER_NAME];
  2155. if(vehicleid != INVALID_VEHICLE_ID && GetDistanceToCar(playerid, vehicleid) < 5 && !IsPlayerInAnyVehicle(playerid)) {
  2156. if(IsAPlane(vehicleid) || IsWeaponizedVehicle(GetVehicleModel(vehicleid)) || IsABike(vehicleid) || IsABoat(vehicleid))
  2157. return SendClientMessageEx(playerid,COLOR_GREY,"(( You can't place wheel clamps on this vehicle. ))");
  2158. if(WheelClamp{vehicleid}) {
  2159. WheelClamp{vehicleid} = 0;
  2160. format(szMessage, sizeof(szMessage), "* %s has removed a Wheel Clamp from the %s's front tire.", GetPlayerNameEx(playerid), GetVehicleName(vehicleid), vehicleid);
  2161. ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2162. SendClientMessageEx(playerid, COLOR_PURPLE, "(( You have removed the Wheel Clamp from this vehicle's front tire. ))");
  2163. }
  2164. else {
  2165. SetPVarInt(playerid, "wheelclampvehicle", vehicleid);
  2166. SetPVarInt(playerid, "wheelclampcountdown", 10);
  2167. format(szMessage, sizeof(szMessage), "* %s is attempting to place a Wheel Clamp in the %s's front tire.", GetPlayerNameEx(playerid), GetVehicleName(vehicleid), vehicleid);
  2168. ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  2169. SendClientMessageEx(playerid, COLOR_PURPLE, "(( You're now placing a Wheel Clamp in the vehicle's front tire, please wait. ))");
  2170. }
  2171. RemoveVehicleFromMeter(vehicleid);
  2172. }
  2173. else
  2174. SendClientMessageEx(playerid, COLOR_WHITE, "You are not near any car.");
  2175. }
  2176. else
  2177. SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use this command.");
  2178. return 1;
  2179. }