Advertisement
Guest User

Tazer System.

a guest
Oct 16th, 2013
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. if(strcmp(cmd, "/tazer", true) ==0)
  2. {
  3. new Float:health;
  4.  
  5. if(IsPlayerConnected(playerid))
  6. {
  7. if(PlayerInfo[playerid][pPolice] >= 1 || PlayerInfo[playerid][pAci] == 1)
  8. {
  9. if(IsPlayerInAnyVehicle(playerid))
  10. {
  11. SendClientMessage(playerid, COLOR_GREY, "* You cannot use this while being in the Car.");
  12. return 1;
  13. }
  14. new suspect = GetClosestPlayer(playerid);
  15. if(IsPlayerConnected(suspect))
  16. {
  17. if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
  18. {
  19. if(IsPlayerInAnyVehicle(suspect))
  20. {
  21. SendClientMessage(playerid, COLOR_GREY, "* Suspect is in a vehicle, get him out before you can taze him.");
  22. return 1;
  23. }
  24. if(OnDuty[playerid]==1)
  25. {
  26. GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
  27. GetPlayerName(playerid, sendername, sizeof(sendername));
  28. format(string, sizeof(string), "* You were tazed by %s, you are numb for now.", sendername);
  29. SendClientMessage(suspect, COLOR_WHITE, string);
  30. format(string, sizeof(string), "* You tazed %s, he's numb now.", giveplayer);
  31. SendClientMessage(playerid, COLOR_WHITE, string);
  32. format(string, sizeof(string), "* %s shoots with his tazer at %s.", sendername ,giveplayer);
  33. ProxDetector(30.0, playerid, string, COLOR_SYSTEM,COLOR_SYSTEM,COLOR_SYSTEM,COLOR_SYSTEM,COLOR_SYSTEM);
  34. GameTextForPlayer(suspect, "~r~Shoked", 2500, 3);
  35. GetPlayerHealth(suspect,health);
  36. SetPlayerHealth(suspect, health - 8);
  37. ApplyAnimation(suspect, "CRACK", "crckdeth2", 4.299999, 1, 1, 1, 0, 15000);
  38. PlayerCuffed[suspect]=true;
  39. }
  40. else { SendClientMessage(playerid, COLOR_WHITE, "You must be on duty."); }
  41. }
  42. else
  43. {
  44. SendClientMessage(playerid, COLOR_GREY, "* No-one is near you.");
  45. return 1;
  46. }
  47. }
  48. }
  49. else
  50. {
  51. SendClientMessage(playerid, COLOR_GREY, "* You are not a Cop / ACI.");
  52. }
  53. }
  54. return 1;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement