document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. new Tiros[MAX_PLAYERS];
  2. new Faleceu[MAX_PLAYERS];
  3.  
  4. public OnPlayerConnect(playerid)
  5. {
  6.     Tiros[playerid] = 0;
  7.     Faleceu[playerid] = 0;
  8. }
  9. public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
  10. {
  11.         new Float:Vida;
  12.         new Float:Colete;
  13.         new Float:Dano;
  14.         new Fala[20];
  15.  
  16.         if(weaponid == 16 || weaponid == 34 || weaponid == 35 || weaponid == 38)
  17.         {
  18.             ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",4.1,0,1,1,0,0,1);
  19.             Tiros[damagedid] = 0;
  20.         }
  21.         if(weaponid == 24 || weaponid == 25 || weaponid == 27)
  22.         {
  23.             Tiros[damagedid]++;
  24.  
  25.             if(Tiros[damagedid] > 4)
  26.             {
  27.                 ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",4.1,0,1,1,0,0,1);
  28.                 Tiros[damagedid] = 0;
  29.             }
  30.         }
  31.         if(weaponid == 29 || weaponid == 30 || weaponid == 31)
  32.         {
  33.             Tiros[damagedid]++;
  34.  
  35.             if(Tiros[damagedid] > 9)
  36.             {
  37.                 ApplyAnimation(damagedid,"PED","DAM_STOMACH_FRMFT",4.1,0,1,1,0,0,1);
  38.                 Tiros[damagedid] = 0;
  39.             }
  40.         }
  41.         GetPlayerArmour(damagedid,Colete);
  42.         GetPlayerHealth(damagedid,Vida);
  43.  
  44.         PlayerPlaySound(playerid,1131,0.0,0.0,0.0);
  45.         PlayerPlaySound(damagedid,17802,0.0,0.0,0.0);
  46.  
  47.         format(Fala,sizeof(Fala),"~r~-%0.0f",amount/2);
  48.         GameTextForPlayer(damagedid,Fala,1000,3);
  49.  
  50.         if(Colete > 0)
  51.         {
  52.             if(amount/2 > Colete)
  53.             {
  54.                 Dano = amount/2 - Colete;
  55.                 Vida = Vida - Dano;
  56.  
  57.                 SetPlayerArmour(damagedid,0.0);
  58.                 SetPlayerHealth(damagedid,Vida);
  59.  
  60.                 return 1;
  61.             }
  62.             Colete = Colete - amount/2;
  63.             SetPlayerArmour(damagedid,Colete);
  64.         }
  65.         if(Colete < 1)
  66.         {
  67.             Vida = Vida - amount/2;
  68.             SetPlayerHealth(damagedid,Vida);
  69.  
  70.             if(Vida < amount/2)
  71.         {
  72.             ChamarDeath(damagedid,playerid,weaponid);
  73.  
  74.                     Faleceu[damagedid] = 1;
  75.                     SetTimerEx("SairFalecer",1000,0,"i",damagedid);
  76.         }
  77.         }
  78.         return 1;
  79. }
  80. SairFalecer(playerid);
  81.  
  82. public SairFalecer(playerid)
  83. {
  84.     Faleceu[playerid] = 0;
  85. }
  86. ChamarDeath(playerid,killerid,reason) // OBS: Colocado aqui para não dar erros com a identação
  87. {
  88.     CallRemoteFunction("OnPlayerDeath","iii",playerid,killerid,reason);
  89.     SetPlayerHealth(playerid,0.0);
  90. }
');