SHARE
TWEET

Untitled

a guest May 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. new LewoPrawo[200];
  4. new GoraDol[200];
  5. new Float:nx[200];
  6. new Float:ny[200];
  7. new Float:nz[200];
  8. new Float:sx[200];
  9. new Float:sy[200];
  10. new Float:sz[200];
  11. new Float:NHP[200];
  12. new Float:SHP[200];
  13. new Float:RHP[200];
  14. new Float:NARM[200];
  15. new Float:SARM[200];
  16. new Float:RARM[200];
  17. new bool:Ochrona[200];
  18. new OchronaT[200];
  19. new zal;
  20.  
  21. public OnFilterScriptInit()
  22. {
  23.     SetTimer("HeadShot", 100, 1);
  24.     print("\n----------------------------------");
  25.     print("   Zjebane Head Shot'y by Przemcio  ");
  26.     print("--------------Loaded--------------\n");
  27.     return 1;
  28. }
  29.  
  30. public OnPlayerSpawn(playerid)
  31. {
  32.     Ochrona[playerid] = true;
  33.     OchronaT[playerid] = SetTimerEx("OchronaOff", 500, 0, "d", playerid);
  34.     return 1;
  35. }
  36.  
  37. forward HeadShot();
  38. public HeadShot()
  39. {
  40.     for(new i; i<=200; i++)
  41.     {
  42.         if(IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_NONE)
  43.         {
  44.             if(!IsPlayerInAnyVehicle(i))
  45.             {
  46.                 GetPlayerKeys(i, zal, GoraDol[i], LewoPrawo[i]);
  47.                 GetPlayerPos(i, nx[i], ny[i], nz[i]);
  48.                 GetPlayerHealth(i, NHP[i]);
  49.                 RHP[i] = NHP[i] - SHP[i];
  50.                 GetPlayerArmour(i, NARM[i]);
  51.                 RARM[i] = NARM[i] - SARM[i];
  52.                 if(nx[i] != sx[i] && ny[i] != sy[i] && nz[i] == sz[i] && LewoPrawo[i] == 0 && GoraDol[i] == 0 && (RHP[i] <= -20) || (RARM[i] <= -20) && Ochrona[i] == false)
  53.                 {
  54.                     SetPlayerHealth(i, 0);
  55.                     GameTextForAll("~r~Boom ~b~Head ~g~Shot!", 2000, 5);
  56.                 }
  57.                 GetPlayerPos(i, sx[i], sy[i], sz[i]);
  58.                 GetPlayerHealth(i, SHP[i]);
  59.                 GetPlayerArmour(i, SARM[i]);
  60.             }
  61.             else if(IsPlayerInAnyVehicle(i) && !IsPlayerOnBike(i) && !IsPlayerInBoat(i) && !IsPlayerOnBicycle(i))
  62.             {
  63.                 GetPlayerHealth(i, NHP[i]);
  64.                 GetPlayerArmour(i, NARM[i]);
  65.                 if((NHP[i] < SHP[i]) || (NARM[i] < SARM[i]) && Ochrona[i] == false)
  66.                 {
  67.                     SetPlayerHealth(i, 0);
  68.                     GameTextForAll("~r~Boom ~b~Head ~g~Shot!", 2000, 5);
  69.                 }
  70.                 GetPlayerHealth(i, SHP[i]);
  71.                 GetPlayerArmour(i, SARM[i]);
  72.             }
  73.         }
  74.     }
  75. }
  76.  
  77. forward OchronaOff(playerid);
  78. public OchronaOff(playerid)
  79. {
  80.     Ochrona[playerid] = false;
  81.     KillTimer(OchronaT[playerid]);
  82.     return 1;
  83. }
  84.  
  85. IsPlayerOnBike(playerid)
  86. {
  87.  if(IsPlayerInAnyVehicle(playerid))
  88.  {
  89.   new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid));
  90.   switch(vehicleclass)
  91.   {
  92.    case 448:return 1;
  93.    case 461:return 1;
  94.    case 462:return 1;
  95.    case 463:return 1;
  96.    case 468:return 1;
  97.    case 521:return 1;
  98.    case 522:return 1;
  99.    case 523:return 1;
  100.    case 581:return 1;
  101.    case 586:return 1;
  102.    case 471:return 1;
  103.   }
  104.  }
  105.  return 0;
  106. }
  107.  
  108. IsPlayerInBoat(playerid)
  109. {
  110.  if(IsPlayerInAnyVehicle(playerid))
  111.  {
  112.   new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid));
  113.   switch(vehicleclass)
  114.   {
  115.    case 430:return 1;
  116.    case 446:return 1;
  117.    case 452:return 1;
  118.    case 453:return 1;
  119.    case 454:return 1;
  120.    case 472:return 1;
  121.    case 473:return 1;
  122.    case 484:return 1;
  123.    case 493:return 1;
  124.    case 595:return 1;
  125.   }
  126.  }
  127.  return 0;
  128. }
  129.  
  130. IsPlayerOnBicycle(playerid)
  131. {
  132.  if(IsPlayerInAnyVehicle(playerid))
  133.  {
  134.   new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid));
  135.   switch(vehicleclass)
  136.   {
  137.    case 481:return 1;
  138.    case 509:return 1;
  139.    case 510:return 1;
  140.   }
  141.  }
  142.  return 0;
  143. }
RAW Paste Data
Top