Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
- {
- switch(weaponid)
- {
- case 24: amount = 32;
- case 34: amount = 100;
- case 8: amount = 25;
- case 9: amount = 10;
- }
- if(aD[playerid][morreu]) return 1;
- PlayerPlaySound(damagedid,17802,0,0,0);
- new Float:c, Float:d, Float:e; // Vida, colete e dano;
- GetPlayerArmour(damagedid,d);
- GetPlayerHealth(damagedid,c);
- if(d > 0)
- {
- if(amount > d)
- {
- e = amount - d;
- c = c - e;
- SetPlayerArmour(damagedid,0.0);
- SetPlayerHealth(damagedid,c);
- gPlayerArmour[playerid] = 0;
- gPlayerHealth[playerid] = c;
- return 1;
- }
- d = d - amount;
- SetPlayerArmour(damagedid,d);
- gPlayerArmour[playerid] = d;
- }
- if(d < 1)
- {
- c = c - amount;
- SetPlayerHealth(damagedid,c);
- gPlayerHealth[playerid] = c;
- if(c <= 0)
- {
- aD[playerid][morreu] = 1;
- }
- }
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
- {
- new Float:Health, Float:Armour;
- GetPlayerHealth(playerid, Health);
- GetPlayerArmour(playerid, Armour);
- if(GetPlayerTeam(playerid) == GetPlayerTeam(issuerid)) {
- if((Health+amount) > 100) {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, amount);
- } else {
- SetPlayerHealth(playerid, (Health+amount));
- SetPlayerArmour(playerid, 0);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement