Guest User

Untitled

a guest
Oct 16th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. CMD:docarrest(playerid, params[])
  2. {
  3. if(!IsACop(playerid)) {
  4. SendClientMessageEx(playerid, COLOR_GREY, "You are not part of the faction. ");
  5. }
  6. else if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2079.7764, -111.6902, 982.4116) && !IsPlayerInRangeOfPoint(playerid, 10.0, -2090.0583,-135.3540,40.1016) && !IsPlayerInRangeOfPoint(playerid, 10.0, -2053.8149,-198.9500,15.0703)) {
  7. SendClientMessageEx(playerid, COLOR_GREY, "You are not at the DoC Prison arrest point." );
  8. }
  9.  
  10. else {
  11.  
  12.  
  13. new
  14. moneys,
  15. time,
  16. string[128];
  17.  
  18. new suspect = GetClosestPlayer(playerid);
  19. if(sscanf(params, "dddd", moneys, time)) {
  20. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docarrest [fine] [minutes]");
  21. }
  22. else if(!(1 <= moneys <= 200000)) {
  23. SendClientMessageEx(playerid, COLOR_GREY, "The jail fine can't be below $1 or above $200,000.");
  24. }
  25. else if(!(1 <= time <= 120)) {
  26. SendClientMessageEx(playerid, COLOR_GREY, "Jail time can't be below 1 or above 120 minutes - take the person to prison for more time.");
  27. }
  28. else if(!IsPlayerConnected(suspect)) {
  29. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  30. }
  31. else if(!ProxDetectorS(5.0, playerid, suspect)) {
  32. SendClientMessageEx(playerid, COLOR_GREY, "You are close enough to the suspect.");
  33. }
  34. else if(PlayerInfo[suspect][pWantedLevel] < 1 && PlayerInfo[playerid][pMember] != 12) {
  35. SendClientMessageEx(playerid, COLOR_GREY, "The player must have a wanted level of at least one star.");
  36. }
  37. else {
  38.  
  39. format(string, sizeof(string), "* You arrested %s!", GetPlayerNameEx(suspect));
  40. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  41. GivePlayerCash(suspect, -moneys);
  42. Tax += moneys;
  43. ResetPlayerWeaponsEx(suspect);
  44. for(new x; x < MAX_PLAYERVEHICLES; x++) if(PlayerVehicleInfo[suspect][x][pvTicket] >= 1) {
  45. PlayerVehicleInfo[suspect][x][pvTicket] = 0;
  46. }
  47. SetPlayerInterior(suspect, 10);
  48. new rand = random(sizeof(DocPrison));
  49. SetPlayerFacingAngle(suspect, 0);
  50. SetPlayerPosEx(suspect, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2]);
  51. if(PlayerInfo[suspect][pDonateRank] >= 2)
  52. {
  53. PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
  54. }
  55. else
  56. {
  57. PlayerInfo[suspect][pJailTime] = time * 60;
  58. }
  59. DeletePVar(suspect, "IsFrozen");
  60. PhoneOnline[suspect] = 1;
  61. PlayerInfo[suspect][pArrested] += 1;
  62. SetPlayerFree(suspect,playerid, "was arrested");
  63. PlayerInfo[suspect][pWantedLevel] = 0;
  64. SetPlayerToTeamColor(suspect);
  65. SetPlayerWantedLevel(suspect, 0);
  66. WantLawyer[suspect] = 1;
  67. TogglePlayerControllable(suspect, 1);
  68. ClearAnimations(suspect);
  69. PlayerCuffed[suspect] = 0;
  70. DeletePVar(suspect, "PlayerCuffed");
  71. PlayerCuffedTime[suspect] = 0;
  72. PlayerInfo[suspect][pVW] = 0;
  73. SetPlayerVirtualWorld(suspect, 0);
  74. strcpy(PlayerInfo[suspect][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
  75. strcpy(PlayerInfo[suspect][pPrisonReason], "[IC] EBCF Arrest", 128);
  76. SetPlayerToTeamColor(suspect);
  77. Player_StreamPrep(suspect, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2], FREEZE_TIME);
  78. }
  79. }
  80. return 1;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment