Advertisement
Guest User

Untitled

a guest
May 26th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. if(strcmp(cmdtext, "/ar", true) == 0)
  2. {
  3. if(gTeam[playerid] != TEAM_COPS && gTeam[playerid] != TEAM_SWAT)
  4. {
  5. SendClientMessage(playerid,COLOR_RED,"You are not a Law Enforcement officer ");
  6. return 1;
  7. }
  8. tmp = strtok(cmdtext, idx);
  9. giveplayerid = strval(tmp);
  10. if(!IsNumeric(tmp))
  11. {
  12. SendClientMessage(playerid, COLOR_RED, "USAGE: /ar (id) ID Must be a number");
  13. return 1;
  14. }
  15. if(!IsPlayerConnected(giveplayerid))
  16. {
  17. format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
  18. SendClientMessage(playerid, COLOR_RED, string);
  19. return 1;
  20. }
  21. new oname[24];
  22. new cname[24];
  23. GetPlayerName(playerid,oname, 24);
  24. GetPlayerName(giveplayerid, cname, 24);
  25. if(GetPlayerWantedLevel(giveplayerid) <= 3)
  26. {
  27. format(string, sizeof(string), "%s(%d) does not have a warrant. You cannot arrest a player without a warrant",cname,giveplayerid);
  28. SendClientMessage(playerid,COLOR_RED,string);
  29. return 1;
  30. }
  31. if(IsPlayerInAnyVehicle(playerid))
  32. {
  33. SendClientMessage(playerid,COLOR_RED,"You cannot arrest a suspect if you are in a car");
  34. return 1;
  35. }
  36. if(IsPlayerInAnyVehicle(giveplayerid))
  37. {
  38. format(string, sizeof(string), "%s(%d) Is in a vehicle. Get the suspect out before making the arrest",cname,giveplayerid);
  39. SendClientMessage(playerid,COLOR_RED,string);
  40. return 1;
  41. }
  42. if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 4)
  43. {
  44. format(string, sizeof(string), "%s(%d) Is too far away. You cannot arrest that player",cname,giveplayerid);
  45. SendClientMessage(playerid,COLOR_RED,string);
  46. return 1;
  47. }
  48. if(giveplayerid == playerid)
  49. {
  50. SendClientMessage(playerid,COLOR_RED,"You cannot arrest yourself");
  51. return 1;
  52. }
  53. if(GetPlayerWantedLevel(giveplayerid) >=4)
  54. {
  55. SetPlayerInterior(giveplayerid,3);
  56. new rnd;
  57. rnd = random(sizeof (ArrestedSpawn));
  58. SetPlayerPos(giveplayerid, ArrestedSpawn[rnd][0], ArrestedSpawn[rnd][1], ArrestedSpawn[rnd][2]);
  59. SetPlayerFacingAngle(giveplayerid, ArrestedSpawn[rnd][3]);
  60. format(string, sizeof(string), "Officer %s(%d) has arrested %s(%d) and has sent the suspect to Jail",oname,playerid,cname,giveplayerid);
  61. SendClientMessageToAll(0x00C7FFAA, string);
  62. SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Busted_|");
  63. format(string, sizeof(string), "You have been sent to jail by Officer %s(%d)",oname,playerid);
  64. SendClientMessage(giveplayerid,0x00C7FFAA, string);
  65. SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from jail once you have served your sentence");
  66. SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
  67. format(string, sizeof(string), "You have sent %s(%d) to jail - you receive a $5000 arrest bonus",cname,giveplayerid);
  68. SendClientMessage(playerid,0x00C7FFAA, string);
  69. GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
  70. format(string, sizeof(string), "%s(%d) has been arrested and sent to jail by Officer %s(%d)",cname,giveplayerid,oname,playerid);
  71. printf("%s", string);
  72. GivePlayerMoney(playerid,5000);
  73. Jailed[giveplayerid] =1;
  74. ResetPlayerWeapons(giveplayerid);
  75. JailTime[giveplayerid] =320;
  76. JailTimeServed[giveplayerid] =0;
  77. SetPlayerWantedLevel(giveplayerid,0);
  78. new oscore;
  79. oscore = GetPlayerScore(playerid);
  80. SetPlayerScore(playerid, oscore +1);
  81. return 1;
  82. }
  83. return 1;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement