Guest User

Untitled

a guest
Mar 10th, 2014
854
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3.  
  4. forward public OnMGBullDetected(playerid);
  5.  
  6. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  7. {
  8. new bool:detected;
  9. detected = false;
  10. if(weaponid == 0)
  11. {
  12. detected = true;
  13. CallLocalFunction("OnMGBullDetected","i",playerid);
  14. }
  15. else if(weaponid != 38)
  16. {
  17. new tempTime = gettime();
  18. SetPVarInt(playerid,"NewShot",tempTime);
  19. if(GetPVarInt(playerid,"OldShot") == GetPVarInt(playerid,"NewShot"))
  20. {
  21. new warnings = GetPVarInt(playerid,"SusCount");
  22. warnings += 1;
  23. SetPVarInt(playerid,"SusCount",warnings);
  24. if(GetPVarInt(playerid,"SusCount") >= 9)
  25. {
  26. detected = true;
  27. CallLocalFunction("OnMGBullDetected","i",playerid);
  28. }
  29. }
  30. else
  31. {
  32. if(detected == false)
  33. {
  34. SetPVarInt(playerid,"SusCount",0);
  35. }
  36. }
  37. SetPVarInt(playerid,"OldShot",tempTime);
  38. if(detected) return 0;
  39. }
  40. return 1;
  41. }
  42. #if defined _ALS_OnPlayerWeaponShot
  43. #undef OnPlayerWeaponShot
  44. #else
  45. #define _ALS_OnPlayerWeaponShot
  46. #endif
  47. #define OnPlayerWeaponShot antiMGB_OnPlayerWeaponShot
  48. forward antiMGB_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
Advertisement
Add Comment
Please, Sign In to add comment