Advertisement
Guest User

Untitled

a guest
Aug 9th, 2011
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.40 KB | None | 0 0
  1. #include <a_samp>
  2. #include <OPSP>
  3.  
  4. public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
  5. {
  6.     new Float:health, Float:armour;
  7.     GetPlayerHealth(Target,health);
  8.     GetPlayerArmour(Target,armour);
  9.     if(ArmourLost > 0.0) SetPlayerArmour(Target,floatadd(armour,ArmourLost));
  10.     if(HealthLost > 0.0) SetPlayerHealth(Target,floatadd(health,HealthLost));
  11.     new Damage;
  12.     switch(GetPlayerWeapon(Shooter))
  13.     {
  14.         case 24: Damage = 20;//case [weaponid]: Damage = [damage];
  15.         case 31,28: Damage = 25;//Tec9 & Micru-Uzi
  16.         case 29: Damage = 30;
  17.         case 0: Damage = 7;
  18.         case 22: Damage = 25;
  19.         case 23: Damage = 20;
  20.         case 5,3,6,7,2: Damage = 10;
  21.         case 4: Damage = 30;
  22.         case 25: Damage = 60;
  23.         case 30: Damage = 30;
  24.         case 33,34: Damage = 95;
  25.     }
  26.    
  27.     armour = armour - Damage;
  28.     if(armour < 0.0)
  29.     {
  30.         health += armour;//Health will decrease because armour is negative. (a + (-b) = a - b)
  31.         if(health <= 0.0)
  32.         {
  33.             health = 0.0;
  34.         }
  35.         armour = 0.0;
  36.     }
  37.     SetPlayerHealth(Target, health);
  38.     SetPlayerArmour(Target, armour);
  39.     new msg[128],name1[24],name2[24];
  40.     format(msg,sizeof(msg)," * %s shot %s(Dmg: %f HP and %f Armour)!",name1,name2,HealthLost,ArmourLost);
  41.     SendClientMessage(Target,0xFFFFFFFF,msg);
  42.     SendClientMessage(Shooter,0xFFFFFFFF,msg);
  43.     return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement