Advertisement
Guest User

Realdamage on SA-MP

a guest
Jan 15th, 2011
1,245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. // realistischer Waffenschaden
  2. // Da ich keins Fand habe ich mir selbst eins Gescriptet
  3. // und habe dabei das include OnPlayerShootPlayer genutzt.
  4. #define FILTERSCRIPT
  5. #define COLT45_DAMAGE 15.0
  6. #define PISTOL_DAMAGE 35.0
  7. #define DESERT_EAGLE_DAMAGE 100.0
  8. #define SHOTGUN_DAMAGE 60.0
  9. #define SNIPER_DAMAGE 100.0
  10. #define MICRO_SMG_DAMAGE 25.0
  11. #define AK47_DAMAGE 30.0
  12. forward tot();
  13. #include <a_samp>
  14. #include <OPSP> //man braucht das addon OnPlayerShootPlayer
  15. #if defined FILTERSCRIPT
  16.  
  17. public OnFilterScriptInit()
  18. {
  19. print("\n--------------------------------------");
  20. print(" Realistischer Waffen Schaden by .LaaRs.");
  21. print("--------------------------------------\n");
  22. SetTimer("tot", 1000, 1);
  23. return 1;
  24. }
  25.  
  26. public OnFilterScriptExit()
  27. {
  28. return 1;
  29. }
  30.  
  31. #else
  32.  
  33. main()
  34. {
  35.  
  36. }
  37.  
  38. #endif
  39.  
  40. public OnPlayerShootPlayer(shooter,target,Float:damage)
  41. {
  42. if(GetPlayerWeapon(shooter) == 24){ //deagle
  43. new Float:armour;
  44. GetPlayerArmour(target,armour);
  45. new Float:health;
  46. GetPlayerHealth(target,health);
  47. if(armour == 0){
  48. SetPlayerHealth(target,health+damage-DESERT_EAGLE_DAMAGE); //schaden den Deagle abzieht
  49. }
  50. else{
  51. SetPlayerArmour(target,health+damage-DESERT_EAGLE_DAMAGE); //schaden den Deagle abzieht
  52. }
  53. }
  54.  
  55.  
  56. if(GetPlayerWeapon(shooter) == 29 || 31 || 30){ //ak,m4.smg
  57. new Float:armour;
  58. GetPlayerArmour(target,armour);
  59. new Float:health;
  60. GetPlayerHealth(target,health);
  61. if(armour == 0){
  62. SetPlayerHealth(target,health+damage-AK47_DAMAGE); //schaden den M4/Ak-47 abzieht
  63. }
  64. else{
  65. SetPlayerArmour(target,armour+damage-AK47_DAMAGE); //schaden den M4/Ak-47 abzieht
  66. }
  67. }
  68.  
  69. if(GetPlayerWeapon(shooter) == 28 || 32 ){ //micro_smg,tec9
  70. new Float:armour;
  71. GetPlayerArmour(target,armour);
  72. new Float:health;
  73. GetPlayerHealth(target,health);
  74. if(armour == 0){
  75. SetPlayerHealth(target,health+damage-MICRO_SMG_DAMAGE); //schaden den tec9,micro smg abzieht
  76. }
  77. else{
  78. SetPlayerArmour(target,armour+damage-MICRO_SMG_DAMAGE); //schaden den tec9,micro smg abzieht
  79. }
  80. }
  81.  
  82. if(GetPlayerWeapon(shooter) == 33 || 34 ){ //sniper , rifle
  83. new Float:armour;
  84. GetPlayerArmour(target,armour);
  85. new Float:health;
  86. GetPlayerHealth(target,health);
  87. if(armour == 0){
  88. SetPlayerHealth(target,health+damage-SNIPER_DAMAGE); //schaden den sniper, rifle abzieht
  89. }
  90. else{
  91. SetPlayerArmour(target,armour+damage-SNIPER_DAMAGE); //schaden den sniper, rifle abzieht
  92. }
  93. }
  94.  
  95. if(GetPlayerWeapon(shooter) == 25 || 27 || 26){ //shotgun
  96. new Float:armour;
  97. GetPlayerArmour(target,armour);
  98. new Float:health;
  99. GetPlayerHealth(target,health);
  100. if(armour == 0){
  101. SetPlayerHealth(target,health+damage-SHOTGUN_DAMAGE); //schaden den shotguns abziehen
  102. }
  103. else{
  104. SetPlayerArmour(target,armour+damage-SHOTGUN_DAMAGE); //schaden den shotguns abziehen
  105. }
  106. }
  107.  
  108. if(GetPlayerWeapon(shooter) == 22 ){ //pistol [9mm]
  109. new Float:armour;
  110. GetPlayerArmour(target,armour);
  111. new Float:health;
  112. GetPlayerHealth(target,health);
  113. if(armour == 0){
  114. SetPlayerHealth(target,health+damage-COLT45_DAMAGE); //schaden den 9mm abzieht
  115. }
  116. else{
  117. SetPlayerArmour(target,armour+damage-COLT45_DAMAGE); //schaden den 9mm abzieht
  118. }
  119. }
  120.  
  121. if(GetPlayerWeapon(shooter) == 23 ){ //silenced
  122. new Float:armour;
  123. GetPlayerArmour(target,armour);
  124. new Float:health;
  125. GetPlayerHealth(target,health);
  126. if(armour == 0){
  127. SetPlayerHealth(target,health+damage-PISTOL_DAMAGE); //schaden den silenced abzieht
  128. }
  129. else{
  130. SetPlayerArmour(target,armour+damage-PISTOL_DAMAGE); //schaden den silenced abzieht
  131. }
  132. }
  133.  
  134. else{
  135.  
  136. }
  137. }
  138.  
  139. public OnPlayerUpdate(playerid)
  140. {
  141. return 1;
  142. }
  143. public tot(){
  144. for(new playerid=0; playerid<MAX_PLAYERS; playerid++) {
  145. if(IsPlayerConnected(playerid)) {
  146. new Float:health;
  147. GetPlayerHealth(playerid,health);
  148. if(health <20)
  149. {
  150. if (GetPlayerState(playerid)== 1)
  151. {
  152. ApplyAnimation(playerid,"CRACK", "crckdeth2", 1.800001, 1, 0, 0, 1, 600);
  153. }
  154. }
  155. }
  156. }
  157. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement