Advertisement
Silver_Dragon

GTA_SAMP_Anticheat: Rapidfire

Apr 7th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. //AntiRapid from "xOFxK1LLER" bugfixed by Silver_Dragon.
  2.  
  3. new MyShot[MAX_PLAYERS];
  4. new MyShotTimer[MAX_PLAYERS];
  5.  
  6. public OnPlayerConnect(playerid) //resets on conneting
  7. {
  8. //AntiRapid
  9. MyShotTimer[playerid] = 0;
  10. MyShot[playerid] = 0;
  11. return 1;
  12. }
  13.  
  14. public OnPlayerDisconnect(playerid) //if player leaves server id gets resetet
  15. {
  16. MyShotTimer[playerid] = 0;
  17. MyShot[playerid] = 0;
  18. return 1;
  19. }
  20.  
  21. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  22. {
  23. if(weaponid == 32 || weaponid == 28 || weaponid == 38)//Guns they shot to fast like uzi or minigun
  24. {
  25. return 1;
  26. }
  27. else if(weaponid != 32 || weaponid != 28 || weaponid != 38)
  28. {
  29. if((gettime() - MyShotTimer[playerid]) < 1)//If U shot One Bullet per Second or less
  30. {
  31. MyShot[playerid]+=1;
  32. }
  33. else
  34. {
  35. MyShot[playerid]=0;
  36. }
  37. }
  38. if(MyShot[playerid] >= 15)// If Player Shots 15 Times in A Second.
  39. {
  40. new kickstring[128], hackersname[MAX_PLAYER_NAME];
  41. GetPlayerName(playerid,hackersname,sizeof(hackersname));
  42. format(kickstring,sizeof(kickstring),"{FF8200}[Anti-Cheat]:{DCDCDC} %s was Kicked from the Server for Rapid Fire Hacks.",hackersname);
  43. Kick(playerid);
  44. SendClientMessageToAll(0xFFFFFFF,kickstring);
  45. }
  46. MyShotTimer[playerid] = gettime(); //Times Ur Shot.
  47. return 1;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement