daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 16th, 2018 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  4. {
  5.     new pname[MAX_PLAYER_NAME];
  6.     GetPlayerName(playerid, pname, sizeof(pname));
  7.     if(!strcmp(pname, "[PTM]MATRIX4057", true))
  8.     {
  9.     if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
  10.     {
  11.         if(damagedid != INVALID_PLAYER_ID)
  12.         {
  13.             new Float:HEALTH;
  14.             new Float:ARMOR;
  15.             new Float:DAMAGE;
  16.             GetPlayerArmour(damagedid, ARMOR);
  17.             GetPlayerHealth(damagedid, HEALTH);
  18.             if(ARMOR > 0)
  19.             {
  20.                 if(amount > ARMOR)
  21.                 {
  22.                     DAMAGE = amount - ARMOR;
  23.                     HEALTH = HEALTH - DAMAGE;
  24.                     SetPlayerArmour(damagedid, 0.0);
  25.                     SetPlayerHealth(damagedid, HEALTH);
  26.                     return 1;
  27.                 }
  28.                 ARMOR = ARMOR - amount;
  29.                 SetPlayerArmour(damagedid, ARMOR);
  30.             }
  31.             if(ARMOR < 1)
  32.             {
  33.                 HEALTH = HEALTH - amount;
  34.                 SetPlayerHealth(damagedid, HEALTH);
  35.             }
  36.         }
  37.     }
  38.     }
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerUpdate(playerid)
  43. {
  44.     SetPlayerTeam(playerid, 124);
  45.     return 1;
  46. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top