Advertisement
Guest User

[FILTERSCRIPT] Vanter's anti speed hack

a guest
Jul 18th, 2013
1,349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. //Easy, look you use OnPlayerUpdate(playerid)
  2. //So mine is like this, It's kinda simple and easy
  3.  
  4. new SpeedHacking[MAX_PLAYERS];
  5. #define SpeedCheck(%0,%1,%2,%3,%4) floatround(floatsqroot(%4?(%0*%0+%1*%1+%2*%2):(%0*%0+%1*%1) ) *%3*1.6)
  6. //=================================================================================================//
  7. #define COLOR_GREY 0xAFAFAFAA
  8. #define COLOR_GREEN 0x33AA33AA //{00FF00}
  9. #define COLOR_RED 0xFF0000AA //{FF0000}
  10. #define COLOR_YELLOW 0xFFFF00AA
  11. #define COLOR_WHITE 0xFFFFFFAA //{FFFFFF}
  12. #define COLOR_VIOLETBLUE 0x8A2BE2AA
  13. #define COLOR_DEADCONNECT 0x808080AA
  14. #define COLOR_BLUE 0x0000FFAA
  15. #define COLOR_FORESTGREEN 0x228B22AA
  16. #define COLOR_DODGERBLUE 0x1E90FFAA
  17. #define COLOR_DARKOLIVEGREEN 0x556B2FAA
  18. #define COLOR_ORANGE 0xFFA500AA
  19. #define COLOR_PURPLE 0x800080AA
  20. #define COLOR_ROYALBLUE 0x4169FFAA
  21. #define COLOR_ERROR 0xD2691EAA
  22. #define COLOR_PINK 0xFF0080FF
  23. #define COLOR_SEXYGREEN 0x00FF00FF
  24. #define COLOR_LIGHTBLUE 0x33CCFFAA
  25. #define COLOR_LIME 0x10F441AA
  26. #define COLOR_CYAN 0x40FFFFFF
  27. #define COLOR_ORANGERED 0xFF4500AA
  28. //=================================================================================================//
  29. //Under OnPlayerUpdate
  30. public OnPlayerUpdate(playerid)
  31. {
  32. //Anti SpeedHack
  33. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  34. {
  35. if(GetPlayerVehicleID(playerid) != 578 || GetPlayerVehicleID(playerid) != 520 || GetPlayerVehicleID(playerid) != 578) //You can add more vehicle exceptions here
  36. {
  37. if(GetVehicleSpeed(GetPlayerVehicleID(playerid), 0) > 250)
  38. {
  39. new Float:x, Float:y, Float:z;
  40. GetPlayerPos(playerid, x, y, z);
  41. SetPlayerPos(playerid, x, y, z+5);
  42. SpeedHacking[playerid] =1;
  43. CheatsDetected(playerid);
  44. return 1;
  45. }
  46. }
  47. }
  48. //OTHER CODES
  49. return 1;
  50. }
  51. //=================================================================================================//
  52. //Now lets go to the stock CheatsDetected
  53. //Stock CheatsDeteceed
  54. stock CheatsDetected(playerid)
  55. {
  56. new string[128];
  57. if(SpeedHacking[playerid] == 1)
  58. {
  59. new pName[MAX_PLAYER_NAME];
  60. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  61. format(string,sizeof(string),"[ANTI CHEAT] Anti-Cheat has banned %s(%d). [Reason: Cheats Detected]",pName,playerid);
  62. SendClientMessageToAll(COLOR_PINK,string);
  63.  
  64.  
  65. format(string, sizeof(string), "~r~BANNED!");
  66. GameTextForPlayer(playerid, string, 3000, 1);
  67.  
  68. new INI:File = INI_Open(UserPath(playerid));
  69. INI_SetTag(File,"Player's Data");
  70. INI_WriteString(File,"BanReason","Cheats Detected");
  71. INI_WriteString(File,"Reason","Speed Hacks");
  72. INI_Close(File);
  73. PlayerInfo[playerid][pBanned] =1;
  74.  
  75. SetTimerEx("KickPlayer",1000,false,"i",playerid);
  76. return 1;
  77. }
  78. return 1;
  79. }
  80. //=================================================================================================//
  81. //In o.3x Kick(playerid); has proirity over all codes, so you have to make a timer for it
  82. //like this so it posts all the codes needed before the kick
  83.  
  84. forward KickPlayer(ID);
  85. public KickPlayer(ID)
  86. {
  87. Kick(ID);
  88. return 1;
  89. }
  90. //=================================================================================================//
  91. //Now lets come to OnPlayerConnect part
  92. //So I'm using Y_INI as you see
  93. if(fexist(UserPath(playerid)))
  94. {
  95. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  96. if(PlayerInfo[playerid][pBanned] == 1)
  97. {
  98. format(string,sizeof(string),"[BANNED] You are currently banned from the server. [Reason: %s]",PlayerInfo[playerid][pBanReason]);
  99. SendClientMessage(playerid, COLOR_RED,string);
  100. SendClientMessage(playerid, COLOR_RED,"[BANNED] Please Ban Appeal on our forums at www.SERVER.net");
  101. SetTimerEx("KickPlayer",1000,false,"i",playerid);
  102. return 1;
  103. }
  104. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FF0000}SERVER","{FFFFFF}Welcome back to the server! \n Type your password below to login.","Login","Quit");
  105. }
  106. //=================================================================================================//
  107. //Vehicle speed
  108. stock GetVehicleSpeed(vehicleid, get3d)
  109. {
  110. new Float:x, Float:y, Float:z;
  111. GetVehicleVelocity(vehicleid, x, y, z);
  112. return SpeedCheck(x, y, z, 100.0, get3d);
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement