Advertisement
Graf_Spee

Untitled

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