Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ¡public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- new Float:damage, Float:health, Float:armour;
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(amount == 2.64)
- {
- if(GetPlayerWeapon(issuerid) > 21 && GetPlayerWeapon(issuerid) < 34)
- {
- damage = 11.5;
- }
- }
- else
- {
- if(weaponid >= 0 && weaponid < 16)
- {
- switch(weaponid)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: damage = 3.0;
- case 4: damage = 4.5;
- case 5..8: damage = 2.0;
- case 9: damage = 4.0;
- }
- }
- case 1:
- {
- switch(bodypart)
- {
- case 3: damage = 4.0;
- case 4: damage = 5.5;
- case 5..8: damage = 3.0;
- case 9: damage = 5.0;
- }
- }
- case 2,3,5,6,7,15:
- {
- switch(bodypart)
- {
- case 3: damage = 6.0;
- case 4: damage = 10.5;
- case 5..8: damage = 5.0;
- case 9: damage = 10.0;
- }
- }
- case 4:
- {
- switch(bodypart)
- {
- case 3: damage = 10.0;
- case 4: damage = 12.5;
- case 5..8: damage = 6.0;
- case 9: damage = 12.0;
- }
- }
- case 8:
- {
- switch(bodypart)
- {
- case 3,4: damage = 15.0;
- case 5..8: damage = 12.0;
- case 9: damage = 200;
- }
- }
- default: damage = amount;
- }
- }
- if(weaponid > 21 && weaponid < 52)
- {
- switch(weaponid)
- {
- case 22,23:
- {
- switch(bodypart)
- {
- case 3,4: damage = 45.0;
- case 5..8: damage = 20.0;
- case 9: damage = 200.0;
- }
- }
- case 24:
- {
- switch(bodypart)
- {
- case 3,4: damage = 70.0;
- case 5..8: damage = 35.0;
- case 9: damage = 200.0;
- }
- }
- case 25..27:
- {
- switch(bodypart)
- {
- case 3,4: damage = 90.0;
- case 5..8: damage = 50.0;
- case 9: damage = 200.0;
- }
- }
- case 28,32:
- {
- switch(bodypart)
- {
- case 3,4: damage = 45.0;
- case 5..8: damage = 20.0;
- case 9: damage = 200.0;
- }
- }
- case 29:
- {
- switch(bodypart)
- {
- case 3,4: damage = 55.0;
- case 5..8: damage = 30.0;
- case 9: damage = 200.0;
- }
- }
- case 30:
- {
- switch(bodypart)
- {
- case 3,4: damage = 65.0;
- case 5..8: damage = 40.0;
- case 9: damage = 200.0;
- }
- }
- case 31:
- {
- switch(bodypart)
- {
- case 3,4: damage = 60.0;
- case 5..8: damage = 35.0;
- case 9: damage = 200.0;
- }
- }
- case 33:
- {
- switch(bodypart)
- {
- case 3,4: damage = 80.0;
- case 5..8: damage = 40.0;
- case 9: damage = 200.0;
- }
- }
- case 34:
- {
- switch(bodypart)
- {
- case 3,4: damage = 100.0;
- case 5..8: damage = 60.0;
- case 9: damage = 200.0;
- }
- }
- default: damage = amount;
- }
- }
- }
- GetPlayerHealth(playerid, health);
- GetPlayerArmour(playerid, armour);
- if(armour)
- {
- if(armour > damage) SetPlayerArmour(playerid, armour-damage);
- else
- {
- SetPlayerArmour(playerid, 0.0);
- armour = damage-armour;
- if(armour >= health)
- {
- SetPlayerHealth(playerid, 0.0);
- }
- else
- {
- SetPlayerHealth(playerid, health-armour);
- }
- }
- }
- else
- {
- if(health > damage)
- {
- SetPlayerHealth(playerid, health-damage);
- }
- else
- {
- SetPlayerHealth(playerid, 0.0);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement