Guest User

Untitled

a guest
Aug 25th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. forward DamagePlayer(playerid, Float:amount, weaponid, Float:hp, Float:armour);
  2. public DamagePlayer(playerid, Float:amount, weaponid, Float:hp, Float:armour)
  3. {
  4. if(!GetPVarInt(playerid,"aduty") && !GetPVarInt(playerid,"Spawned"))
  5. {
  6. if(weaponid != 54 && weaponid != 53)
  7. {
  8. if(armour > 0.0)
  9. {
  10. new Float:tmp = armour;
  11. tmp -= amount;
  12. if(tmp < 0.0)
  13. {
  14. amount -= armour;
  15. armour = 0.0;
  16. }
  17. else
  18. {
  19. armour = tmp;
  20. amount = 0;
  21. }
  22.  
  23. SetPlayerArmourEx(playerid, armour);
  24. }
  25.  
  26. hp = (hp - amount);
  27. SetPlayerHealthEx(playerid, hp);
  28. }
  29. else
  30. {
  31. hp = (hp - amount);
  32. SetPlayerHealthEx(playerid, hp);
  33. }
  34. }
  35. else
  36. {
  37. SetPlayerHealthEx(playerid, hp);
  38. SetPlayerArmourEx(playerid, hp);
  39. }
  40. return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment