Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
- {
- if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
- {
- if(damagedid != INVALID_PLAYER_ID)
- {
- new Float:HEALTH;
- new Float:ARMOR;
- new Float:DAMAGE;
- GetPlayerArmour(damagedid, ARMOR);
- GetPlayerHealth(damagedid, HEALTH);
- if(ARMOR > 0)
- {
- if(amount > ARMOR)
- {
- DAMAGE = amount - ARMOR;
- HEALTH = HEALTH - DAMAGE;
- SetPlayerArmour(damagedid, 0.0);
- SetPlayerHealth(damagedid, HEALTH);
- return 1;
- }
- ARMOR = ARMOR - amount;
- SetPlayerArmour(damagedid, ARMOR);
- }
- if(ARMOR < 1)
- {
- HEALTH = HEALTH - amount;
- SetPlayerHealth(damagedid, HEALTH);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment