Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward DamagePlayer(playerid, Float:amount, weaponid, Float:hp, Float:armour);
- public DamagePlayer(playerid, Float:amount, weaponid, Float:hp, Float:armour)
- {
- if(!GetPVarInt(playerid,"aduty") && !GetPVarInt(playerid,"Spawned"))
- {
- if(weaponid != 54 && weaponid != 53)
- {
- if(armour > 0.0)
- {
- new Float:tmp = armour;
- tmp -= amount;
- if(tmp < 0.0)
- {
- amount -= armour;
- armour = 0.0;
- }
- else
- {
- armour = tmp;
- amount = 0;
- }
- SetPlayerArmourEx(playerid, armour);
- }
- hp = (hp - amount);
- SetPlayerHealthEx(playerid, hp);
- }
- else
- {
- hp = (hp - amount);
- SetPlayerHealthEx(playerid, hp);
- }
- }
- else
- {
- SetPlayerHealthEx(playerid, hp);
- SetPlayerArmourEx(playerid, hp);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment