judicial.pwn 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$f
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Judicial 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 JudgeOnlineCheck()
  34. {
  35. foreach(new i: Player)
  36. {
  37. if(IsAJudge(i)) return 1;
  38. }
  39. return 0;
  40. }
  41. /*
  42. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  43. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  44. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  45. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  46. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  47. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  48. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  49. |__/ \__/ \______/ |__/ |__/|__/
  50. Offline Warranting
  51. Next Generation Gaming, LLC
  52. (created by Next Generation Gaming Development Team)
  53. * Copyright (c) 2016, Next Generation Gaming, LLC
  54. */
  55. // Created by Bohemoth
  56. #include <YSI\y_hooks>
  57. forward OfflineWarranting(index);
  58. public OfflineWarranting(index)
  59. {
  60. new string[128], name[24], reason[64];
  61. GetPVarString(index, "OfflineWarrant", name, 24);
  62. GetPVarString(index, "WarrantRes", reason, 64);
  63. if(cache_affected_rows()) {
  64. format(string, sizeof(string), "You have successfully warranted %s's account.", name);
  65. SendClientMessageEx(index, COLOR_WHITE, string);
  66. format(string, sizeof(string), "You are hereby commanded to apprehend and present to the court %s to answer the charges of:", name);
  67. SendGroupMessage(1, DEPTRADIO, string);
  68. format(string, sizeof(string), "%s", reason);
  69. SendGroupMessage(1, DEPTRADIO, string);
  70. //format(string, sizeof(string), "%s offline warranted %s for %s", GetPlayerNameEx(index), name, reason);
  71. //Log("logs/warrant.log", string);
  72. }
  73. else {
  74. format(string, sizeof(string), "There was an issue with warranting %s's account.", name);
  75. SendClientMessageEx(index, COLOR_WHITE, string);
  76. }
  77. DeletePVar(index, "OfflineWarrant");
  78. DeletePVar(index, "WarrantRes");
  79. return 1;
  80. }
  81. forward OfflineWarrantWD(index);
  82. public OfflineWarrantWD(index)
  83. {
  84. new string[128], name[24];
  85. GetPVarString(index, "OfflineWarrant", name, 24);
  86. if(cache_affected_rows()) {
  87. format(string, sizeof(string), "You have successfully recalled the warrant on %s's account.", name);
  88. SendClientMessageEx(index, COLOR_WHITE, string);
  89. //format(string, sizeof(string), "%s recalled the warrant on %s's account", GetPlayerNameEx(index), name);
  90. //Log("logs/warrant.log", string);
  91. }
  92. else {
  93. format(string, sizeof(string), "There was an issue with recalling the warrant on %s's account.", name);
  94. SendClientMessageEx(index, COLOR_WHITE, string);
  95. }
  96. DeletePVar(index, "OfflineWarrant");
  97. return 1;
  98. }
  99. CMD:owarrant(playerid, params[]) {
  100. if(!IsAJudge(playerid)) {
  101. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  102. return 1;
  103. }
  104. if(PlayerInfo[playerid][pRank] < 3) {
  105. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  106. return 1;
  107. }
  108. new string[128], name[MAX_PLAYER_NAME], reason[64];
  109. if(sscanf(params, "s[24]s[64]", name, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /owarrant [player name] [crime]");
  110. if(!IsPlayerConnected(ReturnUser(name))) {
  111. new query[512];
  112. SetPVarString(playerid, "OfflineWarrant", name);
  113. SetPVarString(playerid, "WarrantRes", reason);
  114. format(string, sizeof(string), "Attempting to warrant %s's account for %s...", name, reason);
  115. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  116. mysql_format(MainPipeline, query,sizeof(query),"UPDATE `accounts` SET `Warrants` = '%e' WHERE `Warrants` = '' AND `Username` = '%e'", reason, name);
  117. mysql_tquery(MainPipeline, query, "OfflineWarranting", "i", playerid);
  118. }
  119. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot offline warrant online players!");
  120. return 1;
  121. }
  122. CMD:owarrantwd(playerid, params[])
  123. {
  124. if(!IsAJudge(playerid))
  125. {
  126. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  127. return 1;
  128. }
  129. if(PlayerInfo[playerid][pMember] < 3)
  130. {
  131. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  132. return 1;
  133. }
  134. new string[128], name[MAX_PLAYER_NAME];
  135. if(sscanf(params, "s[24]s[64]", name)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /owarrantwd [player name]");
  136. if(!IsPlayerConnected(ReturnUser(name))) {
  137. new query[512];
  138. SetPVarString(playerid, "OfflineWarrant", name);
  139. format(string, sizeof(string), "Attempting to recall the warrant on %s's account...", name);
  140. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  141. mysql_format(MainPipeline, query, sizeof(query), "UPDATE `accounts` SET `Warrants` = '' WHERE `Warrants` != '' AND `Username` = '%e'", name);
  142. mysql_tquery(MainPipeline, query, "OfflineWarrantWD", "i", playerid);
  143. }
  144. else return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot offline warrant online players!");
  145. return 1;
  146. }
  147. CMD:present(playerid, params[])
  148. {
  149. if(IsAJudge(playerid))
  150. {
  151. new giveplayerid;
  152. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /present [player]");
  153. if(IsPlayerConnected(giveplayerid))
  154. {
  155. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  156. if(PlayerInfo[giveplayerid][pBeingSentenced] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "That person isn't pending a sentence!");
  157. if(courtjail[giveplayerid] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "That person isn't in the courthouse jail!");
  158. if(courtjail[giveplayerid] > 0)
  159. {
  160. SetPlayerPos(giveplayerid, 1494.8669, -1552.0634, 1127.0251);
  161. SetPlayerFacingAngle(giveplayerid, 176.9777);
  162. SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  163. SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  164. }
  165. courtjail[giveplayerid] = 0;
  166. SetCameraBehindPlayer(giveplayerid);
  167. }
  168. }
  169. else
  170. {
  171. return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not a part of the Judicial System!");
  172. }
  173. return 1;
  174. }
  175. CMD:checkjudgements(playerid, params[])
  176. {
  177. if(IsACop(playerid) || IsAJudge(playerid))
  178. {
  179. if(JudgeOnlineCheck() == 0) return SendClientMessageEx(playerid, COLOR_GRAD4, "There must be at least one judge online to use this command!");
  180. SendClientMessageEx(playerid, COLOR_YELLOW, "Pending Judgements List:");
  181. new
  182. string[128],
  183. fCounter;
  184. foreach(new i: Player)
  185. {
  186. if(PlayerInfo[i][pJudgeJailType] == 1)
  187. {
  188. if(PlayerInfo[i][pJailTime] > 1)
  189. {
  190. format(string, sizeof(string), "Sentenced: %s - jail (transport completed) - time: %d.",GetPlayerNameEx(i),PlayerInfo[i][pJudgeJailTime]);
  191. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  192. ++fCounter;
  193. }
  194. else
  195. {
  196. format(string, sizeof(string), "Sentenced: %s - jail (being transported) - time: %d.",GetPlayerNameEx(i),PlayerInfo[i][pJudgeJailTime]);
  197. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  198. ++fCounter;
  199. }
  200. }
  201. else if(PlayerInfo[i][pJudgeJailType] == 2)
  202. {
  203. if(PlayerInfo[i][pJailTime] > 1)
  204. {
  205. format(string, sizeof(string), "Sentenced: %s - prison (transport completed) - time: %d.",GetPlayerNameEx(i),PlayerInfo[i][pJudgeJailTime]);
  206. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  207. ++fCounter;
  208. }
  209. else
  210. {
  211. format(string, sizeof(string), "Sentenced: %s - prison (being transported) - time: %d.",GetPlayerNameEx(i),PlayerInfo[i][pJudgeJailTime]);
  212. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  213. ++fCounter;
  214. }
  215. }
  216. }
  217. if(fCounter == 0)
  218. {
  219. SendClientMessageEx(playerid, COLOR_GRAD1, "Nobody is pending judgement.");
  220. }
  221. }
  222. return 1;
  223. }
  224. CMD:freezeassets(playerid, params[])
  225. {
  226. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You are not part of the Judicial System!");
  227. if(PlayerInfo[playerid][pRank] < 4) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 4+ can do this.");
  228. new giveplayerid, houseorcar[8];
  229. if(sscanf(params, "us[8]", giveplayerid, houseorcar)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /freezeassets [player] [house/car/bank]");
  230. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  231. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  232. new string[128],
  233. rank[GROUP_MAX_RANK_LEN],
  234. division[GROUP_MAX_DIV_LEN],
  235. employer[GROUP_MAX_NAME_LEN];
  236. szMiscArray[0] = 0;
  237. if(strcmp(houseorcar, "house", true) == 0)
  238. {
  239. if(PlayerInfo[giveplayerid][pFreezeHouse] == 0)
  240. {
  241. PlayerInfo[giveplayerid][pFreezeHouse] = 1;
  242. GetPlayerGroupInfo(playerid, rank, division, employer);
  243. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s has frozen %s house assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  244. ABroadCast(COLOR_YELLOW,string, 2);
  245. format(string, sizeof(string), "You have frozen %s's house assets.", GetPlayerNameEx(giveplayerid));
  246. SendClientMessageEx(playerid, COLOR_WHITE, string);
  247. format(string, sizeof(string), "Your house assets have been frozen by %s", GetPlayerNameEx(playerid));
  248. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  249. format(szMiscArray, sizeof(szMiscArray), "%s %s has frozen %s house assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  250. }
  251. else
  252. {
  253. PlayerInfo[giveplayerid][pFreezeHouse] = 0;
  254. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s has unfrozen %s house assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  255. ABroadCast(COLOR_YELLOW,string, 2);
  256. format(string, sizeof(string), "You have unfrozen %s's house assets.", GetPlayerNameEx(giveplayerid));
  257. SendClientMessageEx(playerid, COLOR_WHITE, string);
  258. format(string, sizeof(string), "Your house assets have been unfrozen by %s", GetPlayerNameEx(playerid));
  259. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  260. format(szMiscArray, sizeof(szMiscArray), "%s %s has unfrozen %s house assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  261. }
  262. }
  263. else if(strcmp(houseorcar, "car", true) == 0)
  264. {
  265. if(PlayerInfo[giveplayerid][pFreezeCar] == 0)
  266. {
  267. PlayerInfo[giveplayerid][pFreezeCar] = 1;
  268. GetPlayerGroupInfo(playerid, rank, division, employer);
  269. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s has frozen %s vehicle assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  270. ABroadCast(COLOR_YELLOW,string, 2);
  271. format(string, sizeof(string), "You have frozen %s's vehicle assets.", GetPlayerNameEx(giveplayerid));
  272. SendClientMessageEx(playerid, COLOR_WHITE, string);
  273. format(string, sizeof(string), "Your vehicle assets have been frozen by %s", GetPlayerNameEx(playerid));
  274. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  275. format(szMiscArray, sizeof(szMiscArray), "%s %s has frozen %s vehicle assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  276. }
  277. else
  278. {
  279. PlayerInfo[giveplayerid][pFreezeCar] = 0;
  280. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s has unfrozen %s vehicle assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  281. ABroadCast(COLOR_YELLOW,string, 2);
  282. format(string, sizeof(string), "You have unfrozen %s's vehicle assets.", GetPlayerNameEx(giveplayerid));
  283. SendClientMessageEx(playerid, COLOR_WHITE, string);
  284. format(string, sizeof(string), "Your vehicle assets have been unfrozen by %s", GetPlayerNameEx(playerid));
  285. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  286. format(szMiscArray, sizeof(szMiscArray), "%s %s has unfrozen %s vehicle assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  287. }
  288. }
  289. else if(strcmp(houseorcar, "bank", true) == 0)
  290. {
  291. if(PlayerInfo[giveplayerid][pFreezeBank] == 0)
  292. {
  293. PlayerInfo[giveplayerid][pFreezeBank] = 1;
  294. GetPlayerGroupInfo(playerid, rank, division, employer);
  295. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s has froze %s bank account.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  296. ABroadCast(COLOR_YELLOW,string, 2);
  297. format(string, sizeof(string), "You have frozen %s's bank account.", GetPlayerNameEx(giveplayerid));
  298. SendClientMessageEx(playerid, COLOR_WHITE, string);
  299. format(string, sizeof(string), "Your bank account has been frozen by %s", GetPlayerNameEx(playerid));
  300. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  301. format(szMiscArray, sizeof(szMiscArray), "%s %s has frozen %s bank assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  302. }
  303. else
  304. {
  305. PlayerInfo[giveplayerid][pFreezeBank] = 0;
  306. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s has unfrozen %s bank account.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  307. ABroadCast(COLOR_YELLOW,string, 2);
  308. format(string, sizeof(string), "You have unfrozen %s's bank account.", GetPlayerNameEx(giveplayerid));
  309. SendClientMessageEx(playerid, COLOR_WHITE, string);
  310. format(string, sizeof(string), "Your bank account has been unfrozen by %s", GetPlayerNameEx(playerid));
  311. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  312. format(szMiscArray, sizeof(szMiscArray), "%s %s has unfrozen %s bank assets.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  313. }
  314. }
  315. else
  316. {
  317. return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /freezeassets [player] [house/car/bank]");
  318. }
  319. GroupLogEx(PlayerInfo[playerid][pMember], szMiscArray, 1);
  320. return 1;
  321. }
  322. CMD:reward(playerid, params[])
  323. {
  324. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  325. if(PlayerInfo[playerid][pRank] < 4) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 4+ can do this.");
  326. new
  327. giveplayerid,
  328. money;
  329. if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /reward [player] [money(max of $50,000)]");
  330. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  331. if(IsPlayerConnected(giveplayerid))
  332. {
  333. new
  334. string[64 + (MAX_PLAYER_NAME * 2)];
  335. if(money < 1 || money > 50000) return SendClientMessageEx(playerid, COLOR_GRAD5, "Reward amount cannot be lower than $1 or higher than $50,000!");
  336. new rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN], employer[GROUP_MAX_NAME_LEN];
  337. GetPlayerGroupInfo(playerid, rank, division, employer);
  338. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s %s(%d) has just rewarded %s(%d) $%d.", rank, GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), money);
  339. ABroadCast(COLOR_YELLOW,string, 2);
  340. format(string, sizeof(string), "AdmCmd: %s %s has just rewarded %s $%d", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), money);
  341. Log("logs/rpspecial.log", string);
  342. Tax -= money;
  343. GivePlayerCash(giveplayerid, money);
  344. format(string, sizeof(string), "You have given a reward of $%d to %s.", money, GetPlayerNameEx(giveplayerid));
  345. SendClientMessageEx(playerid, COLOR_WHITE, string);
  346. format(string, sizeof(string), "You have recieved a reward of $%d from %s %s.", money, rank, GetPlayerNameEx(playerid));
  347. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  348. }
  349. return 1;
  350. }
  351. CMD:reversejudgement(playerid, params[])
  352. {
  353. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  354. if(PlayerInfo[playerid][pRank] < 4) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 4+ can do this.");
  355. new
  356. giveplayerid; // For future reference - sscanf plugin is 3 times as fast as ReturnUser, even when used on only one argument
  357. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /reversejudgement [player]");
  358. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  359. if(IsPlayerConnected(giveplayerid))
  360. {
  361. if(PlayerInfo[giveplayerid][pJudgeJailTime] != 0)
  362. {
  363. new rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN], employer[GROUP_MAX_NAME_LEN], string[52 + (MAX_PLAYER_NAME * 2)];
  364. GetPlayerGroupInfo(playerid, rank, division, employer);
  365. if(PlayerInfo[giveplayerid][pJailTime] != 0) PlayerInfo[giveplayerid][pJailTime] = 0;
  366. PlayerInfo[giveplayerid][pJudgeJailTime] = 0;
  367. switch(PlayerInfo[playerid][pSex])
  368. {
  369. case 1: format(string, sizeof(string), "%s %s has reversed %s's judgement, he is free to go.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  370. case 2: format(string, sizeof(string), "%s %s has reversed %s's judgement, she is free to go.", rank, GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  371. }
  372. SendGroupMessage(GROUP_TYPE_LEA, DEPTRADIO, string);
  373. }
  374. else
  375. {
  376. SendClientMessageEx(playerid, COLOR_GRAD1, "That person doesn't have a jail/prison sentence.");
  377. }
  378. }
  379. return 1;
  380. }
  381. CMD:commute(playerid, params[])
  382. {
  383. cmd_pardon(playerid, "");
  384. SendClientMessageEx(playerid, COLOR_GRAD1, "You can also use /pardon.");
  385. return 1;
  386. }
  387. CMD:pardon(playerid, params[])
  388. {
  389. if(IsAGovernment(playerid) && PlayerInfo[playerid][pRank] >= Group_GetMaxRank(PlayerInfo[playerid][pMember]))
  390. {
  391. new
  392. giveplayerid;
  393. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /pardon [player]");
  394. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  395. if(IsPlayerConnected(giveplayerid))
  396. {
  397. if(PlayerInfo[giveplayerid][pJudgeJailTime] != 0)
  398. {
  399. new string[58 + (MAX_PLAYER_NAME * 2)];
  400. if(PlayerInfo[giveplayerid][pJailTime] != 0) PlayerInfo[giveplayerid][pJailTime] = 2;
  401. PlayerInfo[giveplayerid][pJudgeJailTime] = 2;
  402. switch(PlayerInfo[playerid][pSex])
  403. {
  404. case 1: format(string, sizeof(string), "President %s has forgiven %s of his crimes, he's now free.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  405. case 2: format(string, sizeof(string), "President %s has forgiven %s of his crimes, she's now free.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  406. }
  407. SendGroupMessage(GROUP_TYPE_LEA, DEPTRADIO, string);
  408. }
  409. else
  410. {
  411. SendClientMessageEx(playerid, COLOR_GRAD1, "That person doesn't have a jail/prison sentence.");
  412. }
  413. }
  414. }
  415. else
  416. {
  417. SendClientMessageEx(playerid, COLOR_GRAD1, "Only the President can use this command.");
  418. }
  419. return 1;
  420. }
  421. CMD:wants(playerid, params[])
  422. {
  423. if(IsACop(playerid) || IsAJudge(playerid))
  424. {
  425. if(JudgeOnlineCheck() == 0) return SendClientMessageEx(playerid, COLOR_GRAD4, "There must be at least one judge online to use this command!");
  426. SendClientMessageEx(playerid, COLOR_YELLOW, "Outstanding Warrants List:");
  427. new
  428. fCounter,
  429. string[128];
  430. foreach(new i: Player)
  431. {
  432. if(!isnull(PlayerInfo[i][pWarrant]) || PlayerInfo[i][pWarrant] != 0)
  433. {
  434. format(string, sizeof(string), "%s (%d) - reason: %s.",GetPlayerNameEx(i), i, PlayerInfo[i][pWarrant]);
  435. SendClientMessageEx(playerid, COLOR_GRAD1, string);
  436. ++fCounter;
  437. }
  438. }
  439. if(fCounter <= 0)
  440. {
  441. SendClientMessageEx(playerid, COLOR_GRAD1, "Nobody has any pending warrants.");
  442. }
  443. }
  444. return 1;
  445. }
  446. CMD:mywarrants(playerid, params[])
  447. {
  448. if(IsPlayerInRangeOfPoint(playerid, 3.0, 361.8299,173.7117,1008.3828))
  449. {
  450. if(!isnull(PlayerInfo[playerid][pWarrant]))
  451. {
  452. SendClientMessageEx(playerid, COLOR_WHITE, "You do have active warrants for your arrest. Please considering calling 911 to turn yourself in.");
  453. }
  454. else
  455. {
  456. SendClientMessageEx(playerid, COLOR_WHITE, "You do not have active warrants.");
  457. }
  458. }
  459. else
  460. {
  461. SendClientMessageEx(playerid, COLOR_GRAD1, "You need to be at the point in City Hall to check if you have active warrants.");
  462. }
  463. return 1;
  464. }
  465. CMD:jarrest(playerid, params[])
  466. {
  467. if(IsAJudge(playerid))
  468. {
  469. if(!IsAtArrestPoint(playerid, 4))
  470. {
  471. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the arrest point.");
  472. return 1;
  473. }
  474. new suspect = GetClosestPlayer(playerid), string[256];
  475. if(IsPlayerConnected(suspect))
  476. {
  477. if(ProxDetectorS(5.0, playerid,suspect))
  478. {
  479. if(PlayerInfo[suspect][pJudgeJailType] != 1) { return SendClientMessageEx(playerid, COLOR_GREY, "That person doesn't need to complete a sentence in jail."); }
  480. format(string, sizeof(string), "* You arrested %s!", GetPlayerNameEx(suspect));
  481. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  482. ResetPlayerWeaponsEx(suspect);
  483. for(new x; x < MAX_PLAYERVEHICLES; x++) if(PlayerVehicleInfo[suspect][x][pvTicket] >= 1) {
  484. PlayerVehicleInfo[suspect][x][pvTicket] = 0;
  485. }
  486. SetPlayerInterior(suspect, 5);
  487. SetPlayerPos(suspect,318.5971,312.9619,999.1484);
  488. PlayerInfo[suspect][pJailTime] = PlayerInfo[suspect][pJudgeJailTime];
  489. DeletePVar(suspect, "IsFrozen");
  490. PhoneOnline[suspect] = 1;
  491. PlayerInfo[suspect][pArrested] += 1;
  492. SetPlayerFree(suspect,playerid, "was arrested");
  493. PlayerInfo[suspect][pWantedLevel] = 0;
  494. SetPlayerToTeamColor(suspect);
  495. SetPlayerWantedLevel(suspect, 0);
  496. WantLawyer[suspect] = 1;
  497. TogglePlayerControllable(suspect, 1);
  498. ClearAnimationsEx(suspect);
  499. if(PlayerCuffed[suspect] == 2)
  500. {
  501. SetHealth(suspect, GetPVarFloat(suspect, "cuffhealth"));
  502. SetArmour(suspect, GetPVarFloat(suspect, "cuffarmor"));
  503. DeletePVar(suspect, "cuffhealth");
  504. DeletePVar(suspect, "PlayerCuffed");
  505. }
  506. PlayerCuffed[suspect] = 0;
  507. DeletePVar(suspect, "PlayerCuffed");
  508. PlayerCuffedTime[suspect] = 0;
  509. PlayerInfo[suspect][pVW] = 0;
  510. SetPlayerVirtualWorld(suspect, 0);
  511. }
  512. }
  513. }
  514. return 1;
  515. }
  516. CMD:deliver(playerid, params[])
  517. {
  518. if(!IsPlayerInRangeOfPoint(playerid, 8.0, 1991.7953,-2321.2532,13.5469))
  519. {
  520. SendClientMessageEx(playerid, COLOR_GREY, "You're not at the Los Santos International Airport.");
  521. return 1;
  522. }
  523. new giveplayerid;
  524. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /deliver [player]");
  525. if(PlayerInfo[playerid][pRank] < 1)
  526. {
  527. SendClientMessageEx(playerid, COLOR_WHITE, "You must be at least rank 1.");
  528. return 1;
  529. }
  530. if(IsPlayerConnected(giveplayerid))
  531. {
  532. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, " Can't throw yourself into prison!"); return 1; }
  533. if(PlayerInfo[giveplayerid][pJudgeJailTime] == 0 && PlayerInfo[giveplayerid][pJudgeJailType] != 2) { SendClientMessageEx(playerid, COLOR_GREY, "That person doesn't need to be in prison!"); return 1; }
  534. if(ProxDetectorS(8.0, playerid, giveplayerid))
  535. {
  536. new string[37 + MAX_PLAYER_NAME];
  537. DeletePVar(giveplayerid, "IsFrozen");
  538. format(string, sizeof(string), "* You've brought %s to the Department of Corrections.", GetPlayerNameEx(giveplayerid));
  539. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  540. format(string, sizeof(string), "* %s brought you to the Department of Corrections.", GetPlayerNameEx(playerid));
  541. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  542. GameTextForPlayer(giveplayerid, "~w~Welcome to ~n~~r~the Department of Corrections", 5000, 3);
  543. ClearAnimationsEx(giveplayerid);
  544. PlayerCuffed[giveplayerid] = 0;
  545. DeletePVar(giveplayerid, "PlayerCuffed");
  546. format(PlayerInfo[giveplayerid][pPrisonedBy], 24, "%s", GetPlayerNameEx(playerid));
  547. format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[IC] Judge Sentence");
  548. PlayerInfo[giveplayerid][pWantedLevel] = 0;
  549. SetPlayerToTeamColor(giveplayerid);
  550. SetPlayerWantedLevel(giveplayerid, 0);
  551. Prison_SetPlayerSkin(giveplayerid);
  552. PhoneOnline[giveplayerid] = 1;
  553. PlayerInfo[giveplayerid][pJailTime] = PlayerInfo[giveplayerid][pJudgeJailTime];
  554. SetPlayerInterior(giveplayerid, 10);
  555. PlayerInfo[giveplayerid][pInt] = 10;
  556. SetPlayerVirtualWorld(giveplayerid, 0);
  557. PlayerInfo[giveplayerid][pVW] = 0;
  558. SetPlayerColor(giveplayerid, TEAM_ORANGE_COLOR);
  559. new rand = random(sizeof(DocPrison));
  560. SetPlayerFacingAngle(giveplayerid, 0);
  561. SetPlayerPos(giveplayerid, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2]);
  562. ResetPlayerWeaponsEx(giveplayerid);
  563. Player_StreamPrep(giveplayerid, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2], FREEZE_TIME);
  564. }
  565. else
  566. {
  567. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  568. return 1;
  569. }
  570. }
  571. else
  572. {
  573. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  574. return 1;
  575. }
  576. return 1;
  577. }
  578. CMD:warrant(playerid, params[])
  579. {
  580. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  581. if(PlayerInfo[playerid][pRank] < 3)
  582. {
  583. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  584. return 1;
  585. }
  586. new string[128], crime[64], giveplayerid;
  587. if(sscanf(params, "us[64]", giveplayerid, crime)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /warrant [player] [crime]");
  588. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't place warrants on yourself!");
  589. if(IsPlayerConnected(giveplayerid))
  590. {
  591. if(!isnull(PlayerInfo[giveplayerid][pWarrant])) return SendClientMessageEx(playerid, COLOR_GRAD5, "That person has active warrants already.");
  592. format(PlayerInfo[giveplayerid][pWarrant], 64, crime);
  593. format(string, sizeof(string), "You are hereby commanded to apprehend and present to the court %s to answer the charges of:", GetPlayerNameEx(giveplayerid));
  594. SendGroupMessage(GROUP_TYPE_LEA, DEPTRADIO, string);
  595. format(string, sizeof(string), "%s", crime);
  596. SendGroupMessage(GROUP_TYPE_JUDICIAL, DEPTRADIO, string);
  597. format(string, sizeof(string), "%s has warranted %s to answer for his charges against the Sovereign Republic.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  598. SendGroupMessage(GROUP_TYPE_JUDICIAL, DEPTRADIO, string);
  599. GroupLogEx(PlayerInfo[playerid][pMember], string, 0);
  600. return 1;
  601. }
  602. return 1;
  603. }
  604. CMD:warrantwd(playerid, params[])
  605. {
  606. if(!IsAJudge(playerid))
  607. {
  608. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  609. return 1;
  610. }
  611. if(PlayerInfo[playerid][pMember] < 3)
  612. {
  613. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  614. return 1;
  615. }
  616. new string[128], giveplayerid;
  617. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /warrantwd [player]");
  618. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't remove warrants on yourself!");
  619. if(IsPlayerConnected(giveplayerid))
  620. {
  621. if(strlen(PlayerInfo[giveplayerid][pWarrant]) == 0) return SendClientMessageEx(playerid, COLOR_GRAD5, "That person doesn't have any active warrants.");
  622. format(PlayerInfo[giveplayerid][pWarrant], 128, "");
  623. format(string, sizeof(string), "You have successfully recalled %s's warrant.", GetPlayerNameEx(giveplayerid));
  624. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  625. format(string, sizeof(string), "%s has withdrawn the warrant on %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  626. SendGroupMessage(GROUP_TYPE_JUDICIAL, DEPTRADIO, string);
  627. GroupLogEx(PlayerInfo[playerid][pMember], string, 0);
  628. return 1;
  629. }
  630. return 1;
  631. }
  632. CMD:warrantarrest(playerid, params[])
  633. {
  634. new string[256];
  635. if(IsACop(playerid))
  636. {
  637. if(JudgeOnlineCheck() == 0) return SendClientMessageEx(playerid, COLOR_GRAD4, "There must be at least one judge online to do this!");
  638. if(!IsAtArrestPoint(playerid, 3))
  639. {
  640. SendClientMessageEx(playerid, COLOR_GREY, "You aren't at a warrant arrest point.");
  641. return 1;
  642. }
  643. new suspect = GetClosestPlayer(playerid);
  644. if(IsPlayerConnected(suspect))
  645. {
  646. if(ProxDetectorS(5.0, playerid,suspect))
  647. {
  648. if(strlen(PlayerInfo[suspect][pWarrant]) < 1)
  649. {
  650. SendClientMessageEx(playerid, COLOR_GREY, "The person must have active warrants.");
  651. return 1;
  652. }
  653. format(string, sizeof(string), "* You warrant arrested %s!", GetPlayerNameEx(suspect));
  654. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  655. ResetPlayerWeaponsEx(suspect);
  656. format(string, sizeof(string), "<< Defendant %s has been delivered to the courtroom pending trial by %s >>", GetPlayerNameEx(suspect), GetPlayerNameEx(playerid));
  657. SendGroupMessage(GROUP_TYPE_JUDICIAL, DEPTRADIO, string);
  658. SetPlayerInterior(suspect, 5);
  659. PlayerInfo[suspect][pInt] = 1;
  660. SetPlayerVirtualWorld(suspect, 0);
  661. PlayerInfo[suspect][pVW] = 0;
  662. new rand = random(sizeof(WarrantJail));
  663. SetPlayerFacingAngle(suspect, 180);
  664. SetPlayerPos(suspect, WarrantJail[rand][0], WarrantJail[rand][1], WarrantJail[rand][2]);
  665. if(rand != 0) courtjail[suspect] = 2;
  666. else courtjail[suspect] = 1;
  667. SetCameraBehindPlayer(suspect);
  668. DeletePVar(suspect, "IsFrozen");
  669. PlayerCuffed[suspect] = 0;
  670. DeletePVar(suspect, "PlayerCuffed");
  671. PlayerCuffedTime[suspect] = 0;
  672. PhoneOnline[suspect] = 1;
  673. PlayerInfo[suspect][pArrested] += 1;
  674. SetPlayerFree(suspect,playerid, "was warrant arrested");
  675. PlayerInfo[suspect][pWantedLevel] = 0;
  676. SetPlayerToTeamColor(suspect);
  677. SetPlayerWantedLevel(suspect, 0);
  678. WantLawyer[suspect] = 1;
  679. ClearAnimationsEx(suspect);
  680. PlayerInfo[suspect][pBeingSentenced] = 60;
  681. SetPlayerColor(suspect, SHITTY_JUDICIALSHITHOTCH);
  682. SendClientMessageEx(suspect, COLOR_LIGHTBLUE, "You have been arrested for a pending warrant on you, you'll be attended by a judge soon.");
  683. Player_StreamPrep(suspect, WarrantJail[rand][0], WarrantJail[rand][1], WarrantJail[rand][2], FREEZE_TIME);
  684. }
  685. }
  686. else
  687. {
  688. SendClientMessageEx(playerid, COLOR_GREY, " No-one close enough to arrest.");
  689. return 1;
  690. }
  691. }
  692. else
  693. {
  694. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a law enforcement officer!");
  695. return 1;
  696. }
  697. return 1;
  698. }
  699. CMD:adjourn(playerid, params[])
  700. {
  701. new string[128], giveplayerid;
  702. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  703. if(PlayerInfo[playerid][pRank] < 3) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  704. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /adjourn [player]");
  705. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  706. if(IsPlayerConnected(giveplayerid))
  707. {
  708. if(PlayerInfo[giveplayerid][pBeingSentenced])
  709. {
  710. PlayerInfo[giveplayerid][pBeingSentenced] = 0;
  711. TogglePlayerControllable(giveplayerid, 1);
  712. DeletePVar(giveplayerid, "IsFrozen");
  713. PhoneOnline[giveplayerid] = 0;
  714. format(PlayerInfo[giveplayerid][pWarrant], 128, "");
  715. format(string, sizeof(string), "You have released %s from the courtroom.", GetPlayerNameEx(giveplayerid));
  716. SendClientMessageEx(playerid, COLOR_WHITE, string);
  717. format(string, sizeof(string), "%s has released you from the courtroom, you can now leave.", GetPlayerNameEx(playerid));
  718. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  719. }
  720. else SendClientMessageEx(playerid, COLOR_GRAD2, "The person needs to be on the courtroom being sentenced");
  721. }
  722. return 1;
  723. }
  724. CMD:sentence(playerid, params[]) {
  725. new giveplayerid;
  726. if(!IsAJudge(playerid)) {
  727. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  728. }
  729. else if(PlayerInfo[playerid][pRank] < 3) {
  730. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  731. }
  732. else if(sscanf(params, "u", giveplayerid)) {
  733. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sentence [player]");
  734. }
  735. else if(IsPlayerConnected(giveplayerid)) {
  736. if(giveplayerid == playerid) {
  737. SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  738. }
  739. else if(PlayerInfo[giveplayerid][pBeingSentenced]) {
  740. PlayerInfo[giveplayerid][pBeingSentenced] = 0;
  741. TogglePlayerControllable(giveplayerid, 0);
  742. SetPVarInt(giveplayerid, "IsFrozen", 1);
  743. PhoneOnline[giveplayerid] = 1;
  744. PlayerInfo[giveplayerid][pWarrant][0] = 0;
  745. SetPlayerPos(giveplayerid, 1384.0507,-1688.8254,13.5341);
  746. SetPlayerInterior(giveplayerid, 0);
  747. PlayerInfo[giveplayerid][pInt] = 0;
  748. SetPlayerVirtualWorld(giveplayerid, 0);
  749. PlayerInfo[giveplayerid][pVW] = 0;
  750. new string[58 + MAX_PLAYER_NAME];
  751. format(string, sizeof(string), "You have released %s from the courtroom.", GetPlayerNameEx(giveplayerid));
  752. SendClientMessageEx(playerid, COLOR_WHITE, string);
  753. format(string, sizeof(string), "%s has released you from the courtroom, you can now leave.", GetPlayerNameEx(playerid));
  754. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  755. }
  756. else SendClientMessageEx(playerid, COLOR_GRAD2, "The person needs to be in the courtroom being sentenced.");
  757. }
  758. else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  759. return 1;
  760. }
  761. CMD:trial(playerid, params[])
  762. {
  763. new string[128], giveplayerid;
  764. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  765. if(PlayerInfo[playerid][pRank] < 3) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  766. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /trial [player]");
  767. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  768. if(IsPlayerConnected(giveplayerid))
  769. {
  770. if(PlayerInfo[giveplayerid][pBeingSentenced])
  771. {
  772. PlayerInfo[giveplayerid][pBeingSentenced] += 10;
  773. format(string, sizeof(string), "You have extended %s's courtroom time by 10 minutes, courtroom time: %d", GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pBeingSentenced]);
  774. SendClientMessageEx(playerid, COLOR_WHITE, string);
  775. format(string, sizeof(string), "%s has extended your courtroom time by 10 minutes, courtroom time: %d", GetPlayerNameEx(playerid), PlayerInfo[giveplayerid][pBeingSentenced]);
  776. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  777. }
  778. else SendClientMessageEx(playerid, COLOR_GRAD2, "The person needs to be in the courtroom being sentenced");
  779. }
  780. return 1;
  781. }
  782. CMD:subpoena(playerid, params[])
  783. {
  784. new string[128], dates[32], message[64], giveplayerid;
  785. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  786. if(PlayerInfo[playerid][pRank] < 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 1+ can do this.");
  787. if(sscanf(params, "us[32]s[64]", giveplayerid, dates, message)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /subpoena [player] [date] [message]");
  788. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  789. if(IsPlayerConnected(giveplayerid))
  790. {
  791. SendClientMessageEx(giveplayerid, COLOR_WHITE, "|___________ Important Message from the Courts ___________|");
  792. format(string, sizeof(string), "You have been summoned for a Court Appearance on the day of %s for the following reason(s): %s", dates, message);
  793. SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
  794. SendClientMessageEx(giveplayerid, COLOR_WHITE, "|_________________________________________________________|");
  795. format(string, sizeof(string), "You have summoned %s for a Court Appearance", GetPlayerNameEx(giveplayerid));
  796. SendClientMessageEx(playerid, COLOR_WHITE, string);
  797. }
  798. return 1;
  799. }
  800. CMD:judgejail(playerid, params[])
  801. {
  802. if(!IsAJudge(playerid))
  803. {
  804. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  805. return 1;
  806. }
  807. if(PlayerInfo[playerid][pRank] < 3)
  808. {
  809. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  810. return 1;
  811. }
  812. new string[128], giveplayerid, jailtime, reason[64];
  813. if(sscanf(params, "uds[64]", giveplayerid, jailtime, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /judgejail [player] [time (minutes)] [reason]");
  814. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  815. if(IsPlayerConnected(giveplayerid))
  816. {
  817. if(!PlayerInfo[giveplayerid][pBeingSentenced]) return SendClientMessageEx(playerid, COLOR_GRAD5, "That person isn't being sentenced!");
  818. if(jailtime < 5)
  819. {
  820. return SendClientMessageEx(playerid, COLOR_GRAD5, "Sentence must be at least 5 minute!");
  821. }
  822. if(jailtime > 120)
  823. {
  824. return SendClientMessageEx(playerid, COLOR_GRAD5, "Maximum sentence is 2 Hours / 120 Minutes");
  825. }
  826. PlayerInfo[giveplayerid][pJudgeJailType] = 1;
  827. PlayerInfo[giveplayerid][pJudgeJailTime] = jailtime*60;
  828. format(string, sizeof(string), "You have sentenced %s to fulfill %d minutes in jail, reason: %s", GetPlayerNameEx(giveplayerid), jailtime, reason);
  829. SendClientMessageEx(playerid, COLOR_WHITE, string);
  830. format(string, sizeof(string), "You have been sentenced to fulfill %d minutes in jail by %s, reason: %s", jailtime, GetPlayerNameEx(playerid), reason);
  831. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  832. if(IsACop(giveplayerid))
  833. {
  834. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE,"* You have been auto-removed from your faction by being sentenced to jail, you are now a civilian again.");
  835. PlayerInfo[giveplayerid][pMember] = INVALID_GROUP_ID;
  836. PlayerInfo[giveplayerid][pLeader] = INVALID_GROUP_ID;
  837. PlayerInfo[giveplayerid][pRank] = INVALID_RANK;
  838. PlayerInfo[giveplayerid][pDuty] = 0;
  839. if(!IsValidSkin(GetPlayerSkin(giveplayerid)))
  840. {
  841. new rand = random(sizeof(CIV));
  842. SetPlayerSkin(giveplayerid,CIV[rand]);
  843. PlayerInfo[giveplayerid][pModel] = CIV[rand];
  844. }
  845. player_remove_vip_toys(giveplayerid);
  846. SetPlayerToTeamColor(giveplayerid);
  847. pTazer{giveplayerid} = 0;
  848. }
  849. }
  850. return 1;
  851. }
  852. CMD:judgeprison(playerid, params[])
  853. {
  854. if(!IsAJudge(playerid))
  855. {
  856. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  857. return 1;
  858. }
  859. if(PlayerInfo[playerid][pRank] < 3)
  860. {
  861. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  862. return 1;
  863. }
  864. new string[128], giveplayerid, jailtime, reason[64];
  865. if(sscanf(params, "uds[64]", giveplayerid, jailtime, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /judgeprison [player] [time (mins)] [reason]");
  866. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  867. if(IsPlayerConnected(giveplayerid))
  868. {
  869. if(!PlayerInfo[giveplayerid][pBeingSentenced]) return SendClientMessageEx(playerid, COLOR_GRAD5, "That person isn't being sentenced!");
  870. if(jailtime < 5)
  871. {
  872. return SendClientMessageEx(playerid, COLOR_GRAD5, "Sentence must be at least 5 minute!");
  873. }
  874. if(jailtime > 120)
  875. {
  876. return SendClientMessageEx(playerid, COLOR_GRAD5, "Maximum sentence is 2 Hours / 120 Minutes");
  877. }
  878. PlayerInfo[giveplayerid][pJudgeJailType] = 2;
  879. PlayerInfo[giveplayerid][pJudgeJailTime] = jailtime*60;
  880. format(string, sizeof(string), "You have sentenced %s to fulfill %d minutes in prison, reason: %s", GetPlayerNameEx(giveplayerid), jailtime, reason);
  881. SendClientMessageEx(playerid, COLOR_WHITE, string);
  882. format(string, sizeof(string), "You have been sentenced to fulfill %d minutes in prison by %s, reason: %s", jailtime, GetPlayerNameEx(playerid), reason);
  883. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  884. if(IsACop(giveplayerid))
  885. {
  886. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE,"* You have been auto-removed from your faction by being sentenced to jail, you are now a civilian again.");
  887. PlayerInfo[giveplayerid][pMember] = INVALID_GROUP_ID;
  888. PlayerInfo[giveplayerid][pLeader] = INVALID_GROUP_ID;
  889. PlayerInfo[giveplayerid][pRank] = INVALID_RANK;
  890. PlayerInfo[giveplayerid][pDuty] = 0;
  891. if(!IsValidSkin(GetPlayerSkin(giveplayerid)))
  892. {
  893. new rand = random(sizeof(CIV));
  894. SetPlayerSkin(giveplayerid,CIV[rand]);
  895. PlayerInfo[giveplayerid][pModel] = CIV[rand];
  896. }
  897. player_remove_vip_toys(giveplayerid);
  898. SetPlayerToTeamColor(giveplayerid);
  899. pTazer{giveplayerid} = 0;
  900. }
  901. }
  902. return 1;
  903. }
  904. CMD:judgefine(playerid, params[])
  905. {
  906. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  907. if(PlayerInfo[playerid][pRank] < 3) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  908. new giveplayerid, judgefine, reason[64], totalwealth;
  909. if(sscanf(params, "uds[64]", giveplayerid, judgefine, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /judgefine [player] [amount] [reason]");
  910. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
  911. totalwealth = PlayerInfo[giveplayerid][pCash] + PlayerInfo[giveplayerid][pAccount];
  912. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  913. if(!(1 <= judgefine <= 500000)) return SendClientMessageEx(playerid, COLOR_GREY, "Fine amount cannot be lower than $1 or higher than $500,000!");
  914. if(totalwealth < 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "That person is already in debt - contact an administrator.");
  915. if(!PlayerInfo[giveplayerid][pBeingSentenced]) return SendClientMessageEx(playerid, COLOR_GRAD5, "That person isn't being sentenced!");
  916. SetPVarInt(playerid, "judgefine", judgefine);
  917. SetPVarInt(playerid, "jfined", giveplayerid);
  918. SetPVarString(playerid, "jreason", reason);
  919. Group_ListGroups(playerid, DIALOG_JFINECONFIRM);
  920. return 1;
  921. }
  922. CMD:probation(playerid, params[])
  923. {
  924. if(!IsAJudge(playerid))
  925. {
  926. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  927. return 1;
  928. }
  929. if(PlayerInfo[playerid][pRank] < 3)
  930. {
  931. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  932. return 1;
  933. }
  934. new string[128], giveplayerid, probtime, reason[64];
  935. if(sscanf(params, "uds[64]", giveplayerid, probtime, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /probation [player] [time 1-360 Minutes] [reason and terms]");
  936. if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GRAD1, "You can't use this command on yourself!");
  937. if(IsPlayerConnected(giveplayerid))
  938. {
  939. if(!PlayerInfo[giveplayerid][pBeingSentenced]) return SendClientMessageEx(playerid, COLOR_GRAD5, "That person isn't being sentenced!");
  940. if(probtime < 1 && probtime > 360) return SendClientMessageEx(playerid, COLOR_GRAD5, "Time cannot be lower 1 minute or higher than 360 minutes!");
  941. PlayerInfo[giveplayerid][pProbationTime] = probtime;
  942. format(string, sizeof(string), "You have set %s in probation for %d minutes, reason and terms: %s", GetPlayerNameEx(giveplayerid), probtime, reason);
  943. SendClientMessageEx(playerid, COLOR_WHITE, string);
  944. format(string, sizeof(string), "You have been set in probation for %d minutes by %s, reason and terms: %s", probtime, GetPlayerNameEx(playerid), reason);
  945. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  946. }
  947. return 1;
  948. }
  949. CMD:viewassets(playerid, params[])
  950. {
  951. if(!IsAJudge(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You are not part of the Judicial System!");
  952. if(PlayerInfo[playerid][pRank] < 5) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 5+ can do this.");
  953. new giveplayerid;
  954. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /viewassets [player]");
  955. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  956. format(szMiscArray, sizeof(szMiscArray), "%s's assets | Vehicle Status: %d - House Status: %d - Bank Account Status: %d", GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pFreezeCar], PlayerInfo[giveplayerid][pFreezeHouse], PlayerInfo[giveplayerid][pFreezeBank]);
  957. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  958. format(szMiscArray, sizeof(szMiscArray), "%s's assets | Cash: $%s - Bank: $%s", GetPlayerNameEx(giveplayerid), number_format(PlayerInfo[giveplayerid][pCash]), number_format(PlayerInfo[giveplayerid][pAccount]));
  959. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  960. return true;
  961. }
  962. CMD:alimony(playerid, params[]) {
  963. if(!IsAJudge(playerid))
  964. return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not part of the Judicial System!");
  965. if(PlayerInfo[playerid][pRank] < 3)
  966. return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only rank 3+ can do this.");
  967. new charged, recieved, amount;
  968. if(sscanf(params, "iii", charged, amount, recieved)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /alimony [charging id] [percentage] [reciever id]");
  969. if(charged == playerid || recieved == playerid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this command on yourself!");
  970. new totalwealth = PlayerInfo[charged][pAccount] + GetPlayerCash(charged),
  971. fine = amount * totalwealth / 100;
  972. if(totalwealth < 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "That person is in debt - contact an administrator.");
  973. if(IsPlayerConnected(charged) || IsPlayerConnected(recieved))
  974. {
  975. if(amount < 5)
  976. return SendClientMessageEx(playerid, COLOR_GRAD2, "Minimum percentage must be atleast 5");
  977. if(amount > 25)
  978. return SendClientMessageEx(playerid, COLOR_GRAD2, "Maximum percentage must not exceed 25");
  979. if(fine < 300000) {
  980. format(szMiscArray, sizeof(szMiscArray), "The charge was $%d however as it falls below the minimum amount, %s was only charged $300,000", fine, GetPlayerNameEx(charged));
  981. SendClientMessageEx(playerid, COLOR_GRAD2, szMiscArray);
  982. fine = 300000;
  983. }
  984. if(fine > 2500000) {
  985. format(szMiscArray, sizeof(szMiscArray), "The charge was $%d however as it exceeds the maximum amount, %s was only charged $2,500,000", fine, GetPlayerNameEx(charged));
  986. SendClientMessageEx(playerid, COLOR_GRAD2, szMiscArray);
  987. fine = 2500000;
  988. }
  989. GivePlayerCashEx(charged, TYPE_ONHAND, -fine);
  990. format(szMiscArray, sizeof(szMiscArray), "You have been charged $%d for alimony to %s by Judge %s.", fine, GetPlayerNameEx(recieved), GetPlayerNameEx(playerid));
  991. SendClientMessageEx(charged, COLOR_WHITE, szMiscArray);
  992. GivePlayerCashEx(recieved, TYPE_ONHAND, fine);
  993. format(szMiscArray, sizeof(szMiscArray), "You have been given $%d from %s as alimony.", fine, GetPlayerNameEx(recieved));
  994. SendClientMessageEx(recieved, COLOR_WHITE, szMiscArray);
  995. foreach(new i: Player) {
  996. if(PlayerInfo[i][pAdmin] >= 3) {
  997. format(szMiscArray, sizeof(szMiscArray), "Judicial: %s has charged %s $%d for alimony to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(charged), fine, GetPlayerNameEx(recieved));
  998. SendClientMessage(i, COLOR_LIGHTRED, szMiscArray);
  999. }
  1000. }
  1001. }
  1002. else return SendClientMessageEx(playerid, COLOR_GREY, "That player is not online!");
  1003. return 1;
  1004. }