Advertisement
Guest User

Tazer System by SuTroX

a guest
Dec 16th, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. // © by SuTroX
  2.  
  3. #include <a_samp>
  4.  
  5. new tazetimer[MAX_PLAYERS];
  6.  
  7. public OnFilterScriptInit()
  8. {
  9. print("\n|====| Filterscript |====|");
  10. print("| Tazer System by SuTroX |");
  11. print("|========================|\n");
  12. print(" ");
  13. return 1;
  14. }
  15.  
  16. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  17. {
  18. if(GetPlayerWeapon(playerid) == 23)
  19. {
  20. if(IsPlayerConnected(playerid))
  21. {
  22. new string[128];
  23. new sendername[MAX_PLAYER_NAME];
  24. new giveplayer[MAX_PLAYER_NAME];
  25. GetPlayerName(playerid, sendername, sizeof(sendername));
  26. GetPlayerName(damagedid, giveplayer, sizeof(giveplayer));
  27. TogglePlayerControllable(damagedid,0);
  28. ApplyAnimation(damagedid,"CRACK","crckdeth2",4.1,1,1,1,1,1);
  29. tazetimer[damagedid] = SetTimerEx("Tazed", 15000, 0, "d",damagedid);
  30. format(string, sizeof(string), "* %s hat %s mit einem Stromschocker getroffen.", sendername ,giveplayer);
  31. ProxDetector(30.0, playerid, string, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
  32. GameTextForPlayer(damagedid, "~r~Geschockt", 5000, 3);
  33. }
  34. }
  35. return 1;
  36. }
  37.  
  38. forward Tazed(playerid);
  39. public Tazed(playerid)
  40. {
  41. TogglePlayerControllable(playerid,1);
  42. ClearAnimations(playerid);
  43. return 1;
  44. }
  45. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  46. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  47. {
  48. if(IsPlayerConnected(playerid))
  49. {
  50. new Float:posx, Float:posy, Float:posz;
  51. new Float:oldposx, Float:oldposy, Float:oldposz;
  52. new Float:tempposx, Float:tempposy, Float:tempposz;
  53. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  54. //radi = 2.0; //Trigger Radius
  55. for(new i = 0; i < MAX_PLAYERS; i++)
  56. {
  57. if(IsPlayerConnected(i))
  58. {
  59. if(IsPlayerConnected(i))
  60. {
  61. GetPlayerPos(i, posx, posy, posz);
  62. tempposx = (oldposx -posx);
  63. tempposy = (oldposy -posy);
  64. tempposz = (oldposz -posz);
  65. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  66. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  67. {
  68. SendClientMessage(i, col1, string);
  69. }
  70. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  71. {
  72. SendClientMessage(i, col2, string);
  73. }
  74. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  75. {
  76. SendClientMessage(i, col3, string);
  77. }
  78. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  79. {
  80. SendClientMessage(i, col4, string);
  81. }
  82. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  83. {
  84. SendClientMessage(i, col5, string);
  85. }
  86. }
  87. }
  88. }
  89. }//not connected
  90. return 1;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement