Advertisement
Graf_Spee

Untitled

Sep 13th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  2. {
  3. if(weaponid == 54)
  4. {
  5. pVida[playerid] = pVida[playerid] - amount;
  6. return 0;
  7. }
  8. if(playerid == INVALID_PLAYER_ID)
  9. {
  10. new Float:HP, Float:Colete, Float:Dano;
  11. GetPlayerArmour(playerid, Colete);
  12. GetPlayerHealth(playerid, HP);
  13. if(Colete > 0)
  14. {
  15. if(amount > Colete)
  16. {
  17. Dano = amount - Colete;
  18. HP = HP - Dano;
  19. pVida[playerid] = HP;
  20. pColete[playerid] = 0;
  21. return 1;
  22. }
  23. pColete[playerid] = Colete - amount;
  24. }
  25. if(Colete < 1)
  26. {
  27. HP = HP - amount;
  28. if(HP <= 0)
  29. {
  30. }
  31. else
  32. {
  33. pVida[playerid] = HP;
  34. }
  35. }
  36. }
  37. return 0;
  38. }
  39.  
  40. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
  41. {
  42. if(playerid != INVALID_PLAYER_ID)
  43. {
  44. switch(weaponid)
  45. {
  46. /*case 24: amount = 32;*/
  47. case 34: amount = 75;
  48. case 38: amount = 0;
  49. }
  50. PlayerPlaySound(damagedid, 6401, 0, 0, 0);
  51. new Float:HP, Float:Colete, Float:Dano;
  52. GetPlayerArmour(damagedid, Colete);
  53. GetPlayerHealth(damagedid, HP);
  54. if(Colete > 0)
  55. {
  56. if(amount > Colete)
  57. {
  58. Dano = amount - Colete;
  59. HP = HP - Dano;
  60. SetPlayerArmour(damagedid, 0.0);
  61. SetPlayerHealth(damagedid, HP);
  62. pVida[damagedid] = HP;
  63. pColete[damagedid] = 0;
  64. return 1;
  65. }
  66. pColete[damagedid] = Colete - amount;
  67. Colete = Colete - amount;
  68. SetPlayerArmour(damagedid, Colete);
  69. }
  70. if(Colete < 1)
  71. {
  72. HP = HP - amount;
  73. if(HP <= 0)
  74. {
  75. MatarPlayer(damagedid, playerid, weaponid);
  76. }
  77. else
  78. {
  79. SetPlayerHealth(damagedid, HP);
  80. pVida[damagedid] = HP;
  81. }
  82. }
  83. }
  84. return 1;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement