Guest User

Untitled

a guest
May 16th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  4. {
  5. new pname[MAX_PLAYER_NAME];
  6. GetPlayerName(playerid, pname, sizeof(pname));
  7. if(!strcmp(pname, "[PTM]MATRIX4057", true))
  8. {
  9. if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
  10. {
  11. if(damagedid != INVALID_PLAYER_ID)
  12. {
  13. new Float:HEALTH;
  14. new Float:ARMOR;
  15. new Float:DAMAGE;
  16. GetPlayerArmour(damagedid, ARMOR);
  17. GetPlayerHealth(damagedid, HEALTH);
  18. if(ARMOR > 0)
  19. {
  20. if(amount > ARMOR)
  21. {
  22. DAMAGE = amount - ARMOR;
  23. HEALTH = HEALTH - DAMAGE;
  24. SetPlayerArmour(damagedid, 0.0);
  25. SetPlayerHealth(damagedid, HEALTH);
  26. return 1;
  27. }
  28. ARMOR = ARMOR - amount;
  29. SetPlayerArmour(damagedid, ARMOR);
  30. }
  31. if(ARMOR < 1)
  32. {
  33. HEALTH = HEALTH - amount;
  34. SetPlayerHealth(damagedid, HEALTH);
  35. }
  36. }
  37. }
  38. }
  39. return 1;
  40. }
  41.  
  42. public OnPlayerUpdate(playerid)
  43. {
  44. SetPlayerTeam(playerid, 124);
  45. return 1;
  46. }
Add Comment
Please, Sign In to add comment