Advertisement
Guest User

update

a guest
Jan 4th, 2013
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.17 KB | None | 0 0
  1. #define SCRIPT
  2. #define yDamage
  3. #define by_Yiin
  4.  
  5. #include <a_samp>
  6.  
  7. enum dmg{ issuer, weapon };
  8. new dmgInfo[MAX_PLAYERS][dmg];
  9.  
  10. public OnPlayerConnect(playerid)
  11. {
  12.     dmgInfo[playerid][issuer] = -1;
  13.     dmgInfo[playerid][weapon] = -1;
  14.     return 1;
  15. }
  16.  
  17. public OnPlayerDeath(playerid, killerid, reason)
  18. {   // Į šio callbacko patį viršų rašome:
  19.     killerid = dmgInfo[damagedid][issuer];
  20.     reason = dmgInfo[damagedid][weapon];
  21.     // Visa kas yra šiame callbacke iš anksčiau rašome čia:
  22. }
  23.  
  24. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
  25. {   // Į šio callbaco patį viršų rašome:
  26.     dmgInfo[damagedid][issuer] = playerid;
  27.     dmgInfo[damagedid][weapon] = weaponid;
  28.     switch(weaponid)
  29.     {
  30.         case 0: amount = 5; // Unarmed
  31.         case 1: amount = 5; // Brass Knuckles
  32.         case 2: amount = 5; // Golf
  33.         case 3: amount = 5; // Nite Stick
  34.         case 4: amount = 5; // Knife
  35.         case 5: amount = 5; // BaseBall Bat
  36.         case 6: amount = 5; // Shovel
  37.         case 7: amount = 5; // Pool Cue
  38.         case 8: amount = 5; // Katana
  39.         case 9: amount = 5; // Chainsaw
  40.         case 10: amount = 5; // Purple Dildo
  41.         case 11: amount = 5; // Small White Dildo
  42.         case 12: amount = 5; // Large White Dildo
  43.         case 13: amount = 5; // Silver Vibrator
  44.         case 14: amount = 5; // Flowers
  45.         case 15: amount = 5; // Cane
  46.         case 16: amount = 5; // Grenade
  47.         case 17: amount = 5; // Tear Gas
  48.         case 18: amount = 5; // Molotov
  49.         case 22: amount = 5; // 9mm
  50.         case 23: amount = 5; // Silenced 9mm
  51.         case 24: amount = 5; // Desert Eagle
  52.         case 25: amount = 5; // Shotgun
  53.         case 26: amount = 5; // Sawn-Off
  54.         case 27: amount = 5; // Combat Shotgun
  55.         case 28: amount = 5; // Micro SMG
  56.         case 29: amount = 5; // MP5
  57.         case 30: amount = 5; // AK-47
  58.         case 31: amount = 5; // M4
  59.         case 32: amount = 5; // Tec-9
  60.         case 33: amount = 5; // Country Rifle
  61.         case 34: amount = 5; // Sniper Rifle
  62.         case 38: amount = 5; // Minigun
  63.     }
  64.     new Float:hp, Float:arm;
  65.     GetPlayerHealth(playerid, hp);
  66.     GetPlayerArmour(playerid, arm);
  67.     if(arm > 0)
  68.     {
  69.             arm -= amount;
  70.             if(arm <= 0)
  71.                 hp += arm;
  72.     }
  73.     else
  74.             hp -= amount;
  75.     SetPlayerHealth(playerid, hp);
  76.     SetPlayerArmour(playerid, arm);
  77.     return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement