serveroffences.pwn 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Server Offences System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #include <YSI\y_hooks>
  34. CMD:prison(playerid, params[])
  35. {
  36. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2)
  37. {
  38. new giveplayerid, minutes, reason[64];
  39. if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /prison [player] [minutes] [reason]");
  40. if(giveplayerid != INVALID_PLAYER_ID)
  41. {
  42. if((PlayerInfo[giveplayerid][pAdmin] && PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) || (PlayerInfo[playerid][pAdmin] == 1 && PlayerInfo[giveplayerid][pWatchdog] >= 2)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  43. if(PrisonPlayer(playerid, giveplayerid, reason, minutes, .custom=1) == 0) return 1;
  44. }
  45. }
  46. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  47. return 1;
  48. }
  49. CMD:reverse(playerid, params[])
  50. {
  51. new string[128], reason[24], giveplayerid;
  52. if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2) {
  53. if(!sscanf(params, "us[24]", giveplayerid, reason)) {
  54. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player.");
  55. if(GetPlayerSQLId(playerid) != PlayerInfo[giveplayerid][pJailedInfo][0] && PlayerInfo[playerid][pAdmin] < 3 && PlayerInfo[playerid][pASM] < 1)
  56. return SendClientMessageEx(playerid, COLOR_WHITE, "You have not acted against this person, therefor you can not reverse any actions for them.");
  57. if(PlayerInfo[giveplayerid][pJailTime] == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot do this to someone not currently prisoned.");
  58. if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pHelper] >= 2 || (PlayerInfo[playerid][pWatchdog] >= 2 && PlayerInfo[playerid][pAdmin] < 3)) {
  59. SetPVarInt(playerid, "ReverseReport", 1);
  60. SetPVarInt(playerid, "ReverseID", giveplayerid);
  61. SetPVarString(playerid, "ReverseReason", reason);
  62. SendReportToQue(playerid, "Reverse Report", 2, 4);
  63. SendClientMessageEx(playerid, COLOR_WHITE, "Please wait for an administrator to review your request.");
  64. return 1;
  65. }
  66. if(PlayerInfo[giveplayerid][pJailedInfo][1] > 0) GivePlayerCash(giveplayerid, PlayerInfo[giveplayerid][pJailedInfo][1]);
  67. if(PlayerInfo[giveplayerid][pJailedInfo][3] == 1) PlayerInfo[giveplayerid][pWarns]--;
  68. if(PlayerInfo[giveplayerid][pJailedInfo][4] > 0) PlayerInfo[giveplayerid][pWRestricted] = 0;
  69. format(string, 128, "AdmCmd: %s(%d) has been released from prison (/reverse) by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), reason);
  70. Log("logs/admin.log", string);
  71. format(string, 128, "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  72. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  73. PhoneOnline[giveplayerid] = 0;
  74. //PlayerInfo[giveplayerid][pWantedLevel] = 0;
  75. PlayerInfo[giveplayerid][pBeingSentenced] = 0;
  76. SetPlayerToTeamColor(giveplayerid);
  77. SetHealth(giveplayerid, 100);
  78. //SetPlayerWantedLevel(giveplayerid, 0);
  79. PlayerInfo[giveplayerid][pJailTime] = 0;
  80. SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
  81. SetPlayerInterior(giveplayerid,0);
  82. PlayerInfo[giveplayerid][pInt] = 0;
  83. SetPlayerVirtualWorld(giveplayerid, 0);
  84. PlayerInfo[giveplayerid][pVW] = 0;
  85. strcpy(PlayerInfo[giveplayerid][pPrisonReason], "None", 128);
  86. SetPlayerToTeamColor(giveplayerid);
  87. for(new x = 0; x < 12; x++) GivePlayerValidWeapon(giveplayerid, PlayerInfo[giveplayerid][pJailedWeapons][x]);
  88. for(new y = 0; y < 5; y++) PlayerInfo[giveplayerid][pJailedInfo][y] = 0;
  89. for(new z = 0; z < 12; z++) PlayerInfo[giveplayerid][pJailedWeapons][z] = 0;
  90. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, "Your punishment has been reversed by the administrator who jailed you.");
  91. }
  92. else SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /reverse [playerid] [reason]");
  93. }
  94. else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command.");
  95. return 1;
  96. }
  97. CMD:dprison(playerid, params[])
  98. {
  99. if((PlayerInfo[playerid][pAdmin] >= 2 && (PlayerInfo[playerid][pFactionModerator] > 0 || PlayerInfo[playerid][pGangModerator] > 0 ||
  100. PlayerInfo[playerid][pBM] > 0)) || PlayerInfo[playerid][pAdmin] >= 1337) {
  101. new giveplayerid, mintues;
  102. if(!sscanf(params, "ud", giveplayerid, mintues)) {
  103. if(PlayerInfo[giveplayerid][pAdmin] >= 2 || PlayerInfo[giveplayerid][pWatchdog] >= 2) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this on admins or watchdogs!");
  104. if(mintues > 120) return SendClientMessageEx(playerid, COLOR_WHITE, "Time cannot be above 120 minutes.");
  105. if(PrisonPlayer(playerid, giveplayerid, "Violation of DGA Policies", .time=mintues, .custom=1) == 0) return 1;
  106. }
  107. else SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /dprison [playerid] [time]");
  108. }
  109. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command!");
  110. return 1;
  111. }
  112. PrisonPlayer(playerid, giveplayerid, reason[], time=0, silent=0, custom=0)
  113. {
  114. new string[128], shortreason[5], jailtime, twarn, warn, fine, nonrp;
  115. new rand = random(sizeof(OOCPrisonSpawns));
  116. // Reset.
  117. PlayerInfo[giveplayerid][pJailedInfo][0] = PlayerInfo[playerid][pId];
  118. PlayerInfo[giveplayerid][pJailedInfo][1] = 0;
  119. PlayerInfo[giveplayerid][pJailedInfo][2] = 0;
  120. PlayerInfo[giveplayerid][pJailedInfo][3] = 0;
  121. PlayerInfo[giveplayerid][pJailedInfo][4] = 0;
  122. for(new i = 0; i < 12; i++) PlayerInfo[giveplayerid][pJailedWeapons][i] = 0;
  123. if(time > 0) jailtime = time;
  124. if(!strcmp(reason, "Deathmatching", true) && !custom) {
  125. strcpy(shortreason, "DM", 5);
  126. if(!time) {
  127. new hours = PlayerInfo[giveplayerid][pConnectHours];
  128. if(hours > 2 && hours <= 24) {
  129. PlayerInfo[giveplayerid][pWRestricted] = 4;
  130. jailtime = 30;
  131. twarn = 1;
  132. }
  133. else if(hours > 24 && hours <= 72) {
  134. PlayerInfo[giveplayerid][pWRestricted] = 8;
  135. PlayerInfo[giveplayerid][pWarns] += 1;
  136. jailtime = 60;
  137. warn = 1;
  138. fine = 15;
  139. }
  140. else if(hours > 72 && hours <= 140) {
  141. PlayerInfo[giveplayerid][pWRestricted] = 12;
  142. PlayerInfo[giveplayerid][pWarns] += 1;
  143. warn = 1;
  144. jailtime = 90;
  145. fine = 15;
  146. }
  147. else if(hours > 140) {
  148. PlayerInfo[giveplayerid][pWRestricted] = 16;
  149. PlayerInfo[giveplayerid][pWarns] += 1;
  150. warn = 1;
  151. jailtime = 120;
  152. fine = 15;
  153. }
  154. }
  155. }
  156. else if(!strcmp(reason, "Revenge Killing", true) && !custom) {
  157. strcpy(shortreason, "RK", 5);
  158. if(!time) {
  159. new hours = PlayerInfo[giveplayerid][pConnectHours];
  160. if(hours > 2 && hours <= 24) {
  161. PlayerInfo[giveplayerid][pWRestricted] = 2;
  162. jailtime = 30;
  163. twarn = 1;
  164. }
  165. else if(hours > 24 && hours <= 72) {
  166. PlayerInfo[giveplayerid][pWRestricted] = 4;
  167. PlayerInfo[giveplayerid][pWarns] += 1;
  168. jailtime = 60;
  169. warn = 1;
  170. fine = 10;
  171. }
  172. else if(hours > 72 && hours <= 140) {
  173. PlayerInfo[giveplayerid][pWRestricted] = 6;
  174. PlayerInfo[giveplayerid][pWarns] += 1;
  175. warn = 1;
  176. jailtime = 90;
  177. fine = 10;
  178. }
  179. else if(hours > 140) {
  180. PlayerInfo[giveplayerid][pWRestricted] = 8;
  181. PlayerInfo[giveplayerid][pWarns] += 1;
  182. warn = 1;
  183. jailtime = 120;
  184. fine = 10;
  185. }
  186. }
  187. }
  188. else if(!strcmp(reason, "Non-Roleplay Behaviour", true) && !custom) {
  189. strcpy(shortreason, "NONRP", 5);
  190. if(!time) {
  191. new hours = PlayerInfo[giveplayerid][pConnectHours];
  192. if(hours > 2 && hours <= 24) {
  193. twarn = 1;
  194. jailtime = 30;
  195. }
  196. else if(hours > 24 && hours <= 72) {
  197. twarn = 1;
  198. jailtime = 60;
  199. fine = 10;
  200. }
  201. else if(hours > 72 && hours <= 140) {
  202. twarn = 1;
  203. jailtime = 90;
  204. fine = 10;
  205. }
  206. else if(hours > 140) {
  207. jailtime = 120;
  208. fine = 10;
  209. }
  210. }
  211. }
  212. else if(!strcmp(reason, "Metagaming", true) && !custom) {
  213. strcpy(shortreason, "MG", 5);
  214. if(!time) {
  215. new hours = PlayerInfo[giveplayerid][pConnectHours];
  216. if(hours > 2 && hours <= 24) {
  217. jailtime = 15;
  218. twarn = 1;
  219. }
  220. else if(hours > 24 && hours <= 72) {
  221. jailtime = 30;
  222. twarn = 1;
  223. }
  224. else if(hours > 72 && hours <= 140) {
  225. jailtime = 45;
  226. }
  227. else if(hours > 140) {
  228. jailtime = 60;
  229. }
  230. }
  231. }
  232. else if(!strcmp(reason, "Powergaming", true) && !custom) {
  233. strcpy(shortreason, "PG", 5);
  234. if(!time) {
  235. new hours = PlayerInfo[giveplayerid][pConnectHours];
  236. if(hours > 2 && hours <= 24) {
  237. jailtime = 15;
  238. twarn = 1;
  239. }
  240. else if(hours > 24 && hours <= 72) {
  241. jailtime = 30;
  242. twarn = 1;
  243. fine = 10;
  244. }
  245. else if(hours > 72 && hours <= 140) {
  246. jailtime = 45;
  247. fine = 10;
  248. }
  249. else if(hours > 140) {
  250. jailtime = 60;
  251. fine = 10;
  252. }
  253. }
  254. }
  255. else if(!strcmp(reason, "Killing On Sight", true) && !custom) {
  256. strcpy(shortreason, "KOS", 5);
  257. if(!time) {
  258. new hours = PlayerInfo[giveplayerid][pConnectHours];
  259. if(hours > 2 && hours <= 24) {
  260. PlayerInfo[giveplayerid][pWRestricted] = 2;
  261. jailtime = 30;
  262. twarn = 1;
  263. }
  264. else if(hours > 24 && hours <= 72) {
  265. PlayerInfo[giveplayerid][pWRestricted] = 4;
  266. PlayerInfo[giveplayerid][pWarns] += 1;
  267. jailtime = 60;
  268. warn = 1;
  269. fine = 10;
  270. }
  271. else if(hours > 72 && hours <= 140) {
  272. PlayerInfo[giveplayerid][pWRestricted] = 8;
  273. PlayerInfo[giveplayerid][pWarns] += 1;
  274. warn = 1;
  275. jailtime = 90;
  276. fine = 10;
  277. }
  278. else if(hours > 140) {
  279. PlayerInfo[giveplayerid][pWRestricted] = 12;
  280. PlayerInfo[giveplayerid][pWarns] += 1;
  281. warn = 1;
  282. jailtime = 120;
  283. fine = 10;
  284. }
  285. }
  286. }
  287. PlayerInfo[giveplayerid][pJailedInfo][2] = jailtime;
  288. if(!custom) {
  289. PlayerInfo[giveplayerid][pJailedInfo][4] = PlayerInfo[giveplayerid][pWRestricted];
  290. PlayerInfo[giveplayerid][pJailedInfo][3] = warn;
  291. }
  292. for(new x = 0; x < 12; x++) PlayerInfo[giveplayerid][pJailedWeapons][x] = PlayerInfo[giveplayerid][pGuns][x];
  293. ResetPlayerWeaponsEx(giveplayerid);
  294. if(fine > 0) {
  295. new totalwealth = PlayerInfo[giveplayerid][pAccount] + GetPlayerCash(giveplayerid);
  296. if(PlayerInfo[giveplayerid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[giveplayerid][pPhousekey]][hOwnerID] == GetPlayerSQLId(giveplayerid)) totalwealth += HouseInfo[PlayerInfo[giveplayerid][pPhousekey]][hSafeMoney];
  297. if(PlayerInfo[giveplayerid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[giveplayerid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(giveplayerid)) totalwealth += HouseInfo[PlayerInfo[giveplayerid][pPhousekey2]][hSafeMoney];
  298. if(PlayerInfo[giveplayerid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[giveplayerid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(giveplayerid)) totalwealth += HouseInfo[PlayerInfo[giveplayerid][pPhousekey3]][hSafeMoney];
  299. if(totalwealth > 0) fine = fine*totalwealth/100;
  300. if(fine > 0) {
  301. GivePlayerCash(giveplayerid, -fine);
  302. PlayerInfo[giveplayerid][pJailedInfo][1] = fine;
  303. }
  304. }
  305. if(PlayerInfo[giveplayerid][pAccountRestricted] == 1) {
  306. CreateBan(playerid, PlayerInfo[giveplayerid][pId], giveplayerid, PlayerInfo[giveplayerid][pIP], "Punished Whilst Restricted", 14);
  307. return 0;
  308. }
  309. if(PlayerInfo[giveplayerid][pWarns] >= 3) {
  310. PlayerInfo[playerid][pWarns] = 0;
  311. CreateBan(playerid, PlayerInfo[giveplayerid][pId], giveplayerid, PlayerInfo[giveplayerid][pIP], "3 Warnings", 14);
  312. return 0;
  313. }
  314. if(GetPVarInt(giveplayerid, "Injured") == 1) {
  315. KillEMSQueue(giveplayerid);
  316. ClearAnimationsEx(giveplayerid);
  317. }
  318. if(GetPVarType(giveplayerid, "IsInArena")) LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
  319. if(silent) format(string, 128, "AdmCmd: %s has been prisoned by an admin, reason: %s", GetPlayerNameEx(giveplayerid), reason);
  320. else format(string, 128, "AdmCmd: %s has been prisoned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
  321. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  322. StaffAccountCheck(giveplayerid, GetPlayerIpEx(giveplayerid));
  323. //PlayerInfo[giveplayerid][pWantedLevel] = 0;
  324. //SetPlayerWantedLevel(giveplayerid, 0);
  325. PlayerInfo[giveplayerid][pJailTime] = jailtime*60;
  326. SetPVarInt(giveplayerid, "_rAppeal", gettime()+60);
  327. if(!custom) format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[OOC][PRISON][%s]", shortreason);
  328. else format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[OOC][PRISON][ADM] %s", reason);
  329. strcpy(PlayerInfo[giveplayerid][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  330. PhoneOnline[giveplayerid] = 1;
  331. SetPlayerInterior(giveplayerid, 1);
  332. SetHealth(giveplayerid, 0x7FB00000);
  333. PlayerInfo[giveplayerid][pInt] = 1;
  334. Streamer_UpdateEx(giveplayerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  335. SetPlayerPos(giveplayerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
  336. SetPlayerSkin(giveplayerid, 50);
  337. SetPlayerColor(giveplayerid, TEAM_APRISON_COLOR);
  338. Player_StreamPrep(giveplayerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2], FREEZE_TIME);
  339. if(silent) format(string, 128, "You have been prisoned by an admin for %d minutes, reason: %s.", jailtime, reason);
  340. else format(string, 128, "You have been prisoned by %s for %d minutes, reason: %s.", GetPlayerNameEx(playerid), jailtime, reason);
  341. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  342. if(fine > 0) {
  343. format(string, 128, "You have been fined a total of $%s for this action", number_format(fine));
  344. SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
  345. }
  346. if(twarn) {
  347. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, "WARNING: As your hours, not level, progress, the punishments increase. Please mind the rules.");
  348. }
  349. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s(%d) has been prisoned by %s, reason: %s (F:%s|W:%d|WR:%d|NonRP:%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), reason, number_format(fine), warn, PlayerInfo[giveplayerid][pWRestricted], nonrp);
  350. Log("logs/admin.log", szMiscArray);
  351. DeletePVar(playerid, "PendingAction");
  352. DeletePVar(playerid, "PendingAction2");
  353. if(AlertTime[GetPVarInt(playerid, "PendingAction3")] != 0) AlertTime[GetPVarInt(playerid, "PendingAction3")] = 0;
  354. DeletePVar(playerid, "PendingAction3");
  355. return 1;
  356. }
  357. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  358. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  359. new string[128];
  360. if(dialogid == DIALOG_REVERSE) {
  361. new rPlayerID = GetPVarInt(playerid, "ReverseFromID");
  362. new releasedID = GetPVarInt(rPlayerID, "ReverseID");
  363. if(response) {
  364. if(PlayerInfo[releasedID][pJailedInfo][1] > 0) GivePlayerCash(releasedID, PlayerInfo[releasedID][pJailedInfo][1]);
  365. if(PlayerInfo[releasedID][pJailedInfo][3] == 1) PlayerInfo[releasedID][pWarns]--;
  366. format(string, 128, "AdmCmd: %s(%d) has been released from prison (/reverse) by %s, reason: Reversed (%s)", GetPlayerNameEx(releasedID), GetPlayerSQLId(releasedID), GetPlayerNameEx(playerid), GetPlayerNameEx(rPlayerID));
  367. Log("logs/admin.log", string);
  368. format(string, 128, "AdmCmd: %s has been released from prison by %s, reason: Reversed (%s)", GetPlayerNameEx(releasedID), GetPlayerNameEx(playerid), GetPlayerNameEx(rPlayerID));
  369. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  370. //PlayerInfo[releasedID][pWantedLevel] = 0;
  371. PlayerInfo[releasedID][pBeingSentenced] = 0;
  372. SetPlayerToTeamColor(releasedID);
  373. SetHealth(releasedID, 100);
  374. //SetPlayerWantedLevel(releasedID, 0);
  375. PlayerInfo[releasedID][pJailTime] = 0;
  376. SetPlayerPos(releasedID, 1529.6,-1691.2,13.3);
  377. SetPlayerInterior(releasedID,0);
  378. PlayerInfo[releasedID][pInt] = 0;
  379. SetPlayerVirtualWorld(releasedID, 0);
  380. PlayerInfo[releasedID][pVW] = 0;
  381. strcpy(PlayerInfo[releasedID][pPrisonReason], "None", 128);
  382. SetPlayerToTeamColor(releasedID);
  383. for(new x = 0; x < 12; x++) GivePlayerValidWeapon(releasedID, PlayerInfo[releasedID][pJailedWeapons][x]);
  384. for(new y = 0; y < 5; y++) PlayerInfo[releasedID][pJailedInfo][y] = 0;
  385. for(new z = 0; z < 12; z++) PlayerInfo[releasedID][pJailedWeapons][z] = 0;
  386. SendClientMessageEx(releasedID, COLOR_LIGHTBLUE, "Your punishment has been reversed by the administrator who jailed you.");
  387. }
  388. else {
  389. format(string, 128, "Administrator %s has denied your request to reverse your action.", GetPlayerNameEx(playerid));
  390. SendClientMessageEx(rPlayerID, COLOR_RED, string);
  391. }
  392. DeletePVar(playerid, "ReverseFromID");
  393. DeletePVar(rPlayerID, "ReverseReason");
  394. DeletePVar(rPlayerID, "ReverseID");
  395. }
  396. return 0;
  397. }