Guest User

Vee AI

a guest
Jun 25th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1.  
  2.  
  3. #include <a_samp>
  4.  
  5. /*-------------------------
  6. HeadShot System by Lucaro2708
  7. -------------------------*/
  8.  
  9. #define TIMER_INTERVAL 150
  10.  
  11. new
  12. maxPlayers, tiro;
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. maxPlayers = GetMaxPlayers();
  17. SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
  18. return 1;
  19. }
  20.  
  21. public OnPlayerDeath(playerid, killerid, reason)
  22. {
  23. if(GetPVarInt(playerid, "Headshotted") == 1)
  24. {
  25. SetPVarInt(playerid, "Headshotted", 0);
  26. GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
  27. GameTextForPlayer(killerid, "~r~Headshott", 3000, 3);
  28. }
  29. return 1;
  30. }
  31. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  32. {
  33. if(gangteam[playerid] == gangteam[damagedid])
  34. {
  35. ClearAnimations(playerid, true);
  36. }
  37. return 0x01;
  38. }
  39. forward CheckHeadShot();
  40. public CheckHeadShot()
  41. {
  42. new
  43. index;
  44. for(new playerid; playerid < maxPlayers; playerid++)
  45. {
  46. if(IsPlayerConnected(playerid))
  47. {
  48. index = GetPlayerAnimationIndex(playerid);
  49. if(index == 1173 || index == 1175 || index == 1177 || index == 1178)
  50. {
  51. SetPVarInt(playerid, "Headshotted", 1);
  52. SetPlayerHealth(playerid, 0);
  53. }
  54. }
  55. }
  56. return 1;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment