Advertisement
rdsedmundo

Old lag-0

Feb 13th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.47 KB | None | 0 0
  1. public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
  2. {  
  3.     switch(weaponid)
  4.     {
  5.         case 24: amount = 32;
  6.         case 34: amount = 100;
  7.         case 8: amount = 25;
  8.         case 9: amount = 10;
  9.     }
  10.    
  11.     if(aD[playerid][morreu]) return 1;
  12.    
  13.     PlayerPlaySound(damagedid,17802,0,0,0);
  14.    
  15.     new Float:c, Float:d, Float:e; // Vida, colete e dano;
  16.    
  17.     GetPlayerArmour(damagedid,d);
  18.     GetPlayerHealth(damagedid,c);
  19.    
  20.     if(d > 0)
  21.     {
  22.         if(amount > d)
  23.         {
  24.             e = amount - d;
  25.             c = c - e;
  26.             SetPlayerArmour(damagedid,0.0);
  27.             SetPlayerHealth(damagedid,c);
  28.             gPlayerArmour[playerid] = 0;
  29.             gPlayerHealth[playerid] = c;
  30.             return 1;
  31.         }
  32.         d = d - amount;
  33.         SetPlayerArmour(damagedid,d);
  34.         gPlayerArmour[playerid] = d;
  35.     }
  36.     if(d < 1)
  37.     {
  38.         c = c - amount;
  39.         SetPlayerHealth(damagedid,c);
  40.         gPlayerHealth[playerid] = c;
  41.         if(c <= 0)
  42.         {
  43.             aD[playerid][morreu] = 1;
  44.         }
  45.     }
  46.     return 1;
  47. }
  48.  
  49. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  50. {
  51.     new Float:Health, Float:Armour;
  52.    
  53.     GetPlayerHealth(playerid, Health);
  54.     GetPlayerArmour(playerid, Armour);
  55.    
  56.     if(GetPlayerTeam(playerid) == GetPlayerTeam(issuerid)) {
  57.    
  58.     if((Health+amount) > 100) {
  59.         SetPlayerHealth(playerid, 100);
  60.         SetPlayerArmour(playerid, amount);
  61.     } else {
  62.         SetPlayerHealth(playerid, (Health+amount));
  63.         SetPlayerArmour(playerid, 0);
  64.     }
  65. }
  66.    
  67.     return true;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement