Advertisement
Guest User

Untitled

a guest
Feb 13th, 2013
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. //LEANS TAZER SYSTEM
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <ssacanf2>
  5.  
  6. new Taser[MAX_PLAYERS];
  7.  
  8. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  9. {
  10.  
  11. ///////////////////////////////////////////////////////////////////////////
  12. //LEANS TASER SYSTEM//////////////////////////////////////////////////////
  13. //////////////////////////////////////////////////////////////////////////
  14. if(Taser[issuerid] == 1) //Here, issueId is the shooter, NOT THE TARGET.IF TASER IS ISSUED
  15. if(weaponid == 23) //This checks if weapon silenced is being used!
  16. {
  17. new sendername[MAX_PLAYER_NAME], issuername[MAX_PLAYER_NAME], string[128];
  18. GetPlayerName(playerid, sendername, sizeof(sendername));
  19. sendername[strfind(sendername,"_")] = ' ';
  20. issuername[strfind(issuername,"_")] = ' ';
  21. GetPlayerName(issuerid, issuername, sizeof(issuername));
  22. format(string, 128, "SERVER: You was hit by %s with a taser!", issuername);
  23. SendClientMessage(playerid, COLOR_YELLOW, string);
  24. format(string, 128, "SERVER: You hit %s with your taser!", sendername);
  25. SendClientMessage(issuerid, COLOR_YELLOW, string);
  26. LoopingAnim(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0); // Sets the player in a flipped animation if hit by a taser
  27. format(string, sizeof(string), "* %s was hit by a taser and falls on the ground.", sendername); //Send message that target was hit by a tazer.
  28. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  29. return 1;
  30. }
  31. ///////////////////////////////////////////////////////////////////////////
  32. //LEANS TASER SYSTEM//////////////////////////////////////////////////////
  33. //////////////////////////////////////////////////////////////////////////
  34.  
  35. //NOT INCLUDING THE REST SEEING AS ITS A PRIVATE DAMAGE SYSTEM. Ty ty krisk
  36.  
  37.  
  38. //////////////////////////////////////////////////
  39. //TAZER SYSTEM BY LEAN//
  40. //////////////////////////////////////////////////
  41. CMD:taser(playerid, params[])
  42. {
  43. if(Taser[playerid] == 0) //IF TASER IS NOT ISSUED
  44. {
  45. new sendername[MAX_PLAYER_NAME], string[128];
  46. GetPlayerName(playerid, sendername, sizeof(sendername));
  47. sendername[strfind(sendername,"_")] = ' '; //removes the _ in the name
  48. Taser[playerid] = 1; //SETS THE TASER ISSUED
  49. GivePlayerWeapon(playerid, 23, 20); //GIVES A SILENCER TO PLAYERID!
  50. format(string, sizeof(string), "* %s unholsters his taser", sendername); //sends a message
  51. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //sends message to a radius of 30.
  52. }
  53. else //IF TASER IS ISSUED WE NOW WANT TO NOT ISSUE IT INSTEAD DISABLE IT.
  54. {
  55. new sendername[MAX_PLAYER_NAME], string[128];
  56. GetPlayerName(playerid, sendername, sizeof(sendername));
  57. sendername[strfind(sendername,"_")] = ' ';
  58. Taser[playerid] = 0; //this makes the taser not issued, next time when writing /taser it is issued.
  59. GivePlayerWeapon(playerid, 24, 1500); //Gives the target back his Desert Eagle
  60. format(string, sizeof(string), "* %s holsters his taser", sendername); //Sends a message informing that playerid issued his taser.
  61. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //sends the message above to a radious of 30.
  62. }
  63. return 1;
  64. }
  65.  
  66. //////////////////////////////////////////////////
  67. //TAZER SYSTEM BY LEAN//
  68. //////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement