Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. Добавил в public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
  2.  
  3. if(weaponid >= 22 && weaponid <= 34 && amount > 5.0)
  4. {
  5. /*if(pTemp[damagedid][pAFK] >= 6) return true;
  6. if(GetPVarInt(damagedid,#death)) return true;
  7. new Float:Health,Float:Armour;
  8. GetPlayerArmour(damagedid,Armour);
  9. GetPlayerHealth(damagedid,Health);
  10. if(Armour > 0) SetTimerEx("GetTakeAP",TimerUpdateDamage,0,"ddffd",playerid,damagedid,Armour,amount,weaponid);
  11. else SetTimerEx("GetTakeHP",TimerUpdateDamage,0,"ddffd",playerid,damagedid,Health,amount,weaponid);
  12. PlayerPlaySound(playerid,34604,0,0,0);
  13. PlayerPlaySound(damagedid,34604,0,0,0);*/
  14. switch(weaponid)
  15. {
  16. case 22: amount = 8.6;
  17. case 23: amount = 9.7;
  18. case 24: amount = 47.8;
  19. case 25: amount = 15.3;
  20. case 26: amount = 30.3;
  21. case 27: amount = 22.4;
  22. case 28: amount = 8;
  23. case 29: amount = 9;
  24. case 30: amount = 8;
  25. case 31: amount = 8;
  26. case 32: amount = 7;
  27. case 33: amount = 24;
  28. case 34: amount = 47.8;
  29. default:
  30. {
  31. amount = 0.0;
  32. print("Урон не зафиксирован");
  33. }
  34. }
  35. }
  36.  
  37.  
  38. /////
  39. в конец паблика добавил:
  40.  
  41. if(pTemp[damagedid][pAFK] > 6) return true;
  42. new Float:Health, Float:Armour;
  43. GetPlayerHealth(damagedid,Health);
  44. GetPlayerArmour(damagedid,Armour);
  45. new string[30];
  46. format(string, sizeof(string), "{FF0000}- {D3D3D3}%.0f",amount);
  47. SetPlayerChatBubble(damagedid, string, COLOR_BLUE, 20.0, 10000);
  48. PlayerPlaySound(damagedid,1150,0.0,0.0,0.0);
  49. if(amount < 0) return true;
  50. if((Armour - amount) <= 0)
  51. {
  52. SetPlayerArmourAC(damagedid,0);
  53. return SetPlayerHealthAC(damagedid, Health + (Armour - amount));
  54. }
  55. else if((Armour - amount) > 0)
  56. {
  57. return SetPlayerArmourAC(damagedid,Armour - amount);
  58. }
  59.  
  60. ////
  61. Создал публичный массив в начале мода:
  62. new pLastAnimIndex[MAX_PLAYERS];
  63.  
  64. //
  65.  
  66. добавил в onplayerupdate после строки об проверки игрока на коннект:
  67. pLastAnimIndex[playerid] = GetPlayerAnimationIndex(playerid);
  68.  
  69. //
  70.  
  71. Добавил в начало паблика onplayerdeath:
  72.  
  73. new animlib[32], animname[32];
  74. GetAnimationName(pLastAnimIndex[playerid],animlib,32,animname,32);
  75. if(strcmp(animlib, "PED", true) != 0) ClearAnimations(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement