Guest User

Untitled

a guest
Apr 2nd, 2011
250
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #define function%0(%1) forward%0(%1); public%0(%1)
  3. #define CHECK_WEAPON 1 // вкл/выкл (1/0) выпадение оружия при попадании
  4. #define CHECK_STRIKE 1 // вкл/выкл (1/0) падение при ударе тяжелым предметом
  5. public OnFilterScriptInit()
  6. {
  7. SetTimer("CheckAnimIndexWeapon",100,true);
  8. SetTimer("CheckAnimIndexStrike",100,true);
  9. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  10. {
  11. if(IsPlayerConnected(playerid))
  12. {
  13. GivePlayerWeapon(playerid,4,1);
  14. }
  15. }
  16. return 1;
  17. }
  18. #if CHECK_WEAPON == 1
  19. function CheckAnimIndexWeapon()
  20. {
  21. new index;
  22. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  23. {
  24. if(IsPlayerConnected(playerid))
  25. {
  26. index = GetPlayerAnimationIndex(playerid);
  27. if(index == 1242 || index == 1243)
  28. {
  29. new Float:x,Float:y,Float:z;
  30. GetPlayerPos(playerid,x,y,z);
  31. new model;
  32. switch(GetPlayerWeapon(playerid))
  33. {
  34. case 1: model=331;
  35. case 2: model=333;
  36. case 3: model=334;
  37. case 4: model=335;
  38. case 5: model=336;
  39. case 6: model=337;
  40. case 7: model=338;
  41. case 8: model=339;
  42. case 9: model=341;
  43. case 10: model=321;
  44. case 11: model=322;
  45. case 12: model=323;
  46. case 13: model=324;
  47. case 14: model=325;
  48. case 15: model=326;
  49. case 16: model=342;
  50. case 17: model=343;
  51. case 18: model=344;
  52. case 22: model=346;
  53. case 23: model=347;
  54. case 24: model=348;
  55. case 25: model=349;
  56. case 26: model=350;
  57. case 27: model=351;
  58. case 28: model=352;
  59. case 29: model=353;
  60. case 30: model=355;
  61. case 31: model=356;
  62. case 32: model=372;
  63. case 33: model=357;
  64. case 34: model=358;
  65. case 35: model=359;
  66. case 36: model=360;
  67. case 37: model=361;
  68. case 38: model=362;
  69. case 39: model=363;
  70. case 41: model=365;
  71. case 42: model=366;
  72. case 46: model=371;
  73. }
  74. new pickupid = CreatePickup(model,2,x+2,y,z,-1);
  75. GivePlayerWeapon(playerid,model,-1);
  76. SetTimerEx("DeletePickup", 10000, false, "d", pickupid);
  77. }
  78. }
  79. }
  80. return 1;
  81. }
  82. function DeletePickup(pickupid)
  83. {
  84. DestroyPickup(pickupid);
  85. return 1;
  86. }
  87. #endif
  88.  
  89. #if CHECK_STRIKE == 1
  90. function CheckAnimIndexStrike()
  91. {
  92. new index;
  93. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  94. {
  95. if(IsPlayerConnected(playerid))
  96. {
  97. index = GetPlayerAnimationIndex(playerid);
  98. if(index == 22 || index == 1175 || index == 23 || index == 24)
  99. {
  100. if(GetPlayerWeapon(playerid) == 2 || GetPlayerWeapon(playerid) == 5 || GetPlayerWeapon(playerid) == 6 || GetPlayerWeapon(playerid) == 15 || GetPlayerWeapon(playerid) == 3)
  101. {
  102. ApplyAnimation(playerid,"CRACK","crckdeth4",4.1,0,1,1,1,1);
  103. ApplyAnimation(playerid,"CRACK","crckdeth4",4.1,0,1,1,1,1);
  104. SetTimerEx("ClearAnimation", 5000, false, "d", playerid);
  105. }
  106. }
  107. }
  108. }
  109. return 1;
  110. }
  111. #endif
  112.  
  113. function ClearAnimation(playerid)
  114. {
  115. ClearAnimations(playerid);
  116. ClearAnimations(playerid);
  117. ClearAnimations(playerid);
  118. ClearAnimations(playerid);
  119. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×