Advertisement
RiccB

[L'M] Anti Rapid & anti bullet crasher

Aug 21st, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. new pShot[MAX_PLAYERS], pShotTime[MAX_PLAYERS];
  2.  
  3. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  4. {
  5. if (weaponid < 22 || weaponid > 38) return 0;
  6. new gt = gettime(), gtc = GetTickCount(), s, Float:pPos[7], w[3];
  7. GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
  8. if(!(-20000.0 <= pPos[2] <= 20000.0)) return 0;
  9. if(hittype != BULLET_HIT_TYPE_NONE) //
  10. {
  11. if(!(-1000.0 <= fX <= 1000.0) || !(-1000.0 <= fY <= 1000.0) || !(-1000.0 <= fZ <= 1000.0)) // ANTI BULLET CRASHER
  12. {
  13. SendClientMessage(playerid, 0xd36e4aFF, "[kick] Jūs išmestas iš serverio už neleistinų programų naudojimą.);
  14. SendClientMessage(playerid, 0xffffffff, "Atsiprašome jeigu buvote išmestas per klaidą.");
  15. Kick(playerid);
  16. return 0;
  17. }
  18. }
  19.  
  20. if(weaponid != 38)
  21. {
  22. if((gt - pShotTime[playerid]) < 1)
  23. {
  24. pShot[playerid]++;
  25. }
  26. else
  27. {
  28. pShot[playerid] = 0;
  29. }
  30. switch(weaponid)
  31. {
  32. case 28, 29, 32: s = 17;
  33. case 30, 31: s = 13;
  34. default: s = 11;
  35. }
  36. if(pShot[playerid] > s) // ANTI RAPID FIRE
  37. {
  38. SendClientMessage(playerid, 0xd36e4aFF, "[kick] Jūs išmestas iš serverio už neleistinų programų naudojimą.");
  39. SendClientMessage(playerid, 0xffffffff, "Atsiprašome jeigu buvote išmestas per klaidą.");
  40. Kick(playerid);
  41. return 0;
  42. }
  43. pShotTime[playerid] = gt;
  44. }
  45. return 1;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement