Guest User

Untitled

a guest
Sep 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.23 KB | None | 0 0
  1. if(strcmp(cmd, "/tazer", true) ==0 || strcmp(cmd, "/ta", true) ==0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(gTeam[playerid] == 2 || IsACop(playerid))
  6. {
  7. if(IsPlayerInAnyVehicle(playerid))
  8. {
  9. SendClientMessage(playerid, COLOR_GREY, " Nemozete koristiti tazer dok ste u autu!");
  10. return 1;
  11. }
  12. if(KnockedDown[playerid] == 1)
  13. {
  14. SendClientMessage(playerid, COLOR_GREY, "Ne mozete zamahnuti kada ste vec oboreni.");
  15. return 1;
  16. }
  17. if(PlayerTied[playerid] == 1)
  18. {
  19. SendClientMessage(playerid, COLOR_GREY, " Vezani ste!");
  20. return 1;
  21. }
  22. if(ReduceTime[playerid] == 1)
  23. {
  24. SendClientMessage(playerid, COLOR_GREY, " Morate sacekati 5 sekundi pre ponovnog koriscenja ove komande !");
  25. return 1;
  26. }
  27. new suspect = GetClosestPlayer(playerid);
  28. if(IsPlayerConnected(suspect))
  29. {
  30. if(PlayerCuffed[suspect] > 0)
  31. {
  32. SendClientMessage(playerid, COLOR_GREY, " Igrac je vec tazovan/uhapsen!");
  33. return 1;
  34. }
  35. if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
  36. {
  37. if(gTeam[suspect] == 2)
  38. {
  39. SendClientMessage(playerid, COLOR_GREY, " Ne mozete taznuti PD / FBI!");
  40. return 1;
  41. }
  42. if(IsPlayerInAnyVehicle(suspect))
  43. {
  44. SendClientMessage(playerid, COLOR_GREY, " Osumnjiceni je u autu, prvo ga izbacite!");
  45. return 1;
  46. }
  47. GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
  48. GetPlayerName(playerid, sendername, sizeof(sendername));
  49. new randt = random(4)+1;
  50. if(randt == 1)
  51. {
  52. format(string, sizeof(string), "* %s puca sa svojim tazerom na %s-a, ali promasuje.", sendername ,giveplayer);
  53. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  54. }
  55. else
  56. {
  57. format(string, sizeof(string), "* Tazovao vas je %s na 10 sekundi.", sendername);
  58. SendClientMessage(suspect, COLOR_WHITE, string);
  59. format(string, sizeof(string), "* Tazovali ste %s-a na 10 sekundi.", giveplayer);
  60. SendClientMessage(playerid, COLOR_WHITE, string);
  61. format(string, sizeof(string), "* %s puca tazerom na %s-a i pogadja ga.", sendername ,giveplayer);
  62. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  63. GameTextForPlayer(suspect, "~r~Sokiran", 2500, 3);
  64. TogglePlayerControllable(suspect, 0);
  65. PlayerCuffed[suspect] = 0;
  66. PlayerCuffedTime[suspect] = 15;
  67. ReduceTime[playerid] = 1;
  68. SetTimerEx("ReduceTimer", 5000, false, "i", playerid);
  69. }
  70. }
  71. else
  72. {
  73. SendClientMessage(playerid, COLOR_GREY, " Nema nikoga u vasoj blizini!");
  74. return 1;
  75. }
  76. }
  77. }
  78. else
  79. {
  80. SendClientMessage(playerid, COLOR_GREY, " Niste Policajac / FBI!");
  81. }
  82. }//not connected
  83. return 1;
  84. }
  85.  
  86.  
  87.  
  88.  
  89. /// cu
  90.  
  91. if(strcmp(cmd, "/cuff", true) == 0 || strcmp(cmd, "/cu", true) == 0)
  92. {
  93. if(IsPlayerConnected(playerid))
  94. {
  95. if(gTeam[playerid] == 2 || (OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 21 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 21))
  96. {
  97. tmp = strtok(cmdtext, idx);
  98. if(!strlen(tmp)) {
  99. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
  100. return 1;
  101. }
  102. giveplayerid = ReturnUser(tmp);
  103. if(IsPlayerConnected(giveplayerid))
  104. {
  105. if(giveplayerid != INVALID_PLAYER_ID)
  106. {
  107. if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
  108. {
  109. SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Cops !");
  110. return 1;
  111. }
  112. if(PlayerCuffed[giveplayerid] > 0)
  113. {
  114. SendClientMessage(playerid, COLOR_GREY, " Player already Cuffed !");
  115. return 1;
  116. }
  117. if(WantedLevel[giveplayerid] < 1)
  118. {
  119. SendClientMessage(playerid, COLOR_GREY, " Igrac mora imati najmanje wanted level 1!");
  120. return 1;
  121. }
  122. if (PlayerCuffedTime[giveplayerid] < 1)
  123. {
  124. SendClientMessage(playerid, COLOR_GREY, " Igrac mora biti prvo tazovan!");
  125. return 1;
  126. }
  127. if (ProxDetectorS(8.0, playerid, giveplayerid))
  128. {
  129. if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Cuff yourself!"); return 1; }
  130. {
  131. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  132. GetPlayerName(playerid, sendername, sizeof(sendername));
  133. format(string, sizeof(string), "* %s Vam je stavio lisice.", sendername);
  134. SendClientMessage(giveplayerid, COLOR_WHITE, string);
  135. format(string, sizeof(string), "* Stavili ste lisice igracu %s.", giveplayer);
  136. SendClientMessage(playerid, COLOR_WHITE, string);
  137. format(string, sizeof(string), "* %s je stavio lisice igracu %s, tako da ne moze da pobegne.", sendername ,giveplayer);
  138. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  139. GameTextForPlayer(giveplayerid, "~r~Uhapseni ste", 2500, 3);
  140. TogglePlayerControllable(giveplayerid, 0);
  141. PlayerCuffed[giveplayerid] = 2;
  142. PlayerCuffedTime[giveplayerid] = 99999999999999;
  143. }
  144. }
  145. else
  146. {
  147. SendClientMessage(playerid, COLOR_GREY, " Igrac nije u Vasoj blizini !");
  148. return 1;
  149. }
  150. }
  151. }
  152. else
  153. {
  154. SendClientMessage(playerid, COLOR_GREY, " Igrac je offline !");
  155. return 1;
  156. }
  157. }
  158. else
  159. {
  160. SendClientMessage(playerid, COLOR_GREY, " Niste policajac / SAJ / Nacionalna garda !");
  161. }
  162. }
  163. return 1;
  164. }
Add Comment
Please, Sign In to add comment