Advertisement
v0VExxx

anitcheat

Dec 4th, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.87 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fakemeta>
  4. #include <engine>
  5. #include <colorchat>
  6.  
  7. #define PLUGIN "Anti KzH"
  8. #define VERSION "1.0"
  9. #define AUTHOR "anderseN"
  10. new bhopg[33],bhopf[33],in_check[33],checked[33],type[33][128]
  11. new LOG[ 200 ];
  12.  
  13. public plugin_init() {
  14. register_plugin(PLUGIN, VERSION, AUTHOR)
  15. register_cvar( "nsc_kz_punish", "2" );
  16. register_cvar( "nsc_kz_btime", "0" );
  17. register_cvar( "nsc_kz_bhop", "0" );
  18. register_cvar( "nsc_kz_log", "1" );
  19.  
  20. register_forward(FM_PlayerPreThink, "Forward")
  21.  
  22. set_task(50.0, "reset",0,"",0,"b")
  23. }
  24.  
  25. public reset()
  26. {
  27. new p[32],num
  28. get_players(p,num)
  29. for(new i=0;i<num;i++)
  30. {
  31. if (!is_user_connected(p[i]) && !is_user_alive(p[i]) && !in_check[p[i]])
  32. continue
  33. bhopg[p[i]] = 0
  34. bhopf[p[i]] = 0
  35. checked[p[i]] = false
  36. }
  37. }
  38.  
  39. public Forward(id)
  40. {
  41. if(is_user_alive(id) && get_cvar_num("nsc_kz_bhop") > 0 && pev(id,pev_button) & IN_JUMP)
  42. {
  43. if(pev(id,pev_flags) & FL_ONGROUND)
  44. {
  45. bhopg[id]++
  46.  
  47. switch(get_cvar_num("nsc_kz_bhop")){
  48. case 1: if(bhopg[id] > 8 && bhopf[id] == 0){
  49. in_check[id] = true
  50. }
  51. case 2: if(bhopg[id] > 15 && bhopf[id] == 0){
  52. in_check[id] = true
  53. }
  54. }
  55. }
  56. else
  57. {
  58. bhopf[id]++
  59. }
  60. }
  61. if(pev(id,pev_flags) & FL_ONGROUND && in_check[id] && !checked[id])
  62. {
  63. client_cmd(id, "+jump;wait;wait;+jump;wait;wait;+jump;wait;wait;+jump;wait;wait;+jump")
  64. set_task( 0.6, "check", id)
  65. checked[id] = true
  66. }
  67.  
  68. }
  69. public check(id)
  70. {
  71. if(bhopf[id] == 0){
  72. type[id] = "Auto Bhop"
  73. wywal(id)
  74. }
  75. else
  76. {
  77. client_cmd(id, "-jump")
  78. in_check[id] = false
  79. }
  80. }
  81. public plugin_cfg()
  82. {
  83. static sciezka[64];
  84. get_localinfo("amxx_datadir", sciezka, 63);
  85.  
  86. formatex(LOG, 199, "%s/KzHackers.txt", sciezka);
  87. }
  88.  
  89. public client_putinserver( id )
  90. {
  91. remove_task( id );
  92. new sid[32]
  93. get_user_authid(id, sid, 31)
  94. if (equali(sid, "STEAM_ID_PENDING") ||
  95. equali(sid, "STEAM_ID_LAN") ||
  96. equali(sid, "HLTV") ||
  97. equali(sid, "4294967295") ||
  98. equali(sid, "VALVE_ID_LAN") ||
  99. equali(sid, "VALVE_ID_PENDING"))
  100. {
  101. client_print(id,print_console,"AntiKZH - Clean!")
  102. }
  103. else
  104. {
  105. set_task( 0.5, "test", id );
  106. }
  107.  
  108. bhopg[id] = 0
  109. bhopf[id] = 0
  110. in_check[id] = false
  111. checked[id] = false
  112. }
  113. public client_disconnect(id)
  114. {
  115. bhopf[id] = 0
  116. bhopg[id] = 0
  117. in_check[id] = false
  118. checked[id] = false
  119. }
  120. public test( id ) {
  121. if( is_user_connected( id ) )
  122. {
  123. query_client_cvar( id, "kzh_bhop", "kzh" );
  124. set_task( 0.5, "test2", id );
  125. }
  126. }
  127. public test2( id ) {
  128. if( is_user_connected( id ) )
  129. {
  130. query_client_cvar( id, "kyk_bhop", "kyk" );
  131. set_task( 0.5, "test3", id );
  132. }
  133. }
  134. public test3( id ) {
  135. if( is_user_connected( id ) )
  136. {
  137. query_client_cvar( id, "001_bhop", "trawka" );
  138. query_client_cvar( id, "002_bhop", "trawka" );
  139. query_client_cvar( id, "Trk_bhop", "trawka" );
  140. query_client_cvar( id, "m3c_bhop", "trawka" );
  141. query_client_cvar( id, "m4c_bhop", "trawka" );
  142. set_task( 0.5, "test4", id );
  143. }
  144. }
  145. public test4( id ) {
  146. if( is_user_connected( id ) )
  147. {
  148. query_client_cvar( id, "zhy_bhop", "zhyk" );
  149. query_client_cvar( id, "zhe_bhop", "zhyk" );
  150. set_task( 0.5, "test5", id );
  151. }
  152. }
  153. public test5( id ) {
  154. if( is_user_connected( id ) )
  155. {
  156. query_client_cvar( id, "^^_^^<bhop", "n1kzh" );
  157. query_client_cvar( id, "n1k<bhop", "n1kzh" );
  158. query_client_cvar( id, "nkz_bhop", "n1kzh" );
  159. query_client_cvar( id, "nik_bhop", "n1kzh" );
  160. set_task( 0.5, "test6", id );
  161. }
  162. }
  163. public test6( id ) {
  164. if( is_user_connected( id ) )
  165. {
  166. query_client_cvar( id, "fpt_bhop", "kzcustom" );
  167. query_client_cvar( id, "str_bhop", "kzcustom" );
  168. query_client_cvar( id, "fuh_bhop", "kzcustom" );
  169. query_client_cvar( id, "vip_bhop", "kzcustom" );
  170. query_client_cvar( id, "p7x_bhop", "kzcustom" );
  171. query_client_cvar( id, "p7x_xtd", "kzcustom" );
  172. query_client_cvar( id, "p7x_loopx", "kzcustom" );
  173. query_client_cvar( id, "p7x_bunny", "kzcustom" );
  174. query_client_cvar( id, "p7x_left", "kzcustom" );
  175. query_client_cvar( id, "p7x_exec", "kzcustom" );
  176. set_task( 0.5, "test7", id );
  177. }
  178. }
  179. public test7( id ) {
  180. if( is_user_connected( id ) )
  181. {
  182. query_client_cvar( id, "xhack_bhop", "xhack" );
  183. query_client_cvar( id, "xhz_bhop", "xhack" );
  184. query_client_cvar( id, "xkz_bhop", "xhack" );
  185. }
  186. }
  187.  
  188. public kzh( id, const cvar[ ], const value[ ] ) {
  189. if( value[0] != 'B' ) {
  190. type[id] = "KZHack"
  191. wywal( id )
  192. }
  193.  
  194. return PLUGIN_HANDLED;
  195. }
  196. public kyk( id, const cvar[ ], const value[ ] ) {
  197. if( value[0] != 'B' ) {
  198. type[id] = "KykHack"
  199. wywal( id )
  200. }
  201.  
  202. return PLUGIN_HANDLED;
  203. }
  204. public trawka( id, const cvar[ ], const value[ ] ) {
  205. if( value[0] != 'B' ) {
  206. type[id] = "TrawkaHack"
  207. wywal( id )
  208. }
  209.  
  210. return PLUGIN_HANDLED;
  211. }
  212. public zhyk( id, const cvar[ ], const value[ ] ) {
  213. if( value[0] != 'B' ) {
  214. type[id] = "ZhykHack"
  215. wywal( id )
  216. }
  217.  
  218. return PLUGIN_HANDLED;
  219. }
  220. public n1kzh( id, const cvar[ ], const value[ ] ) {
  221. if( value[0] != 'B' ) {
  222. type[id] = "N1kZHack"
  223. wywal( id )
  224. }
  225.  
  226. return PLUGIN_HANDLED;
  227. }
  228. public kzcustom( id, const cvar[ ], const value[ ] ) {
  229. if( value[0] != 'B' ) {
  230. type[id] = "KZHack."
  231. wywal( id )
  232. }
  233.  
  234. return PLUGIN_HANDLED;
  235. }
  236. public xhack( id, const cvar[ ], const value[ ] ) {
  237. if( value[0] != 'B' ) {
  238. type[id] = "xHack"
  239. wywal( id )
  240. }
  241.  
  242. return PLUGIN_HANDLED;
  243. }
  244.  
  245. public wywal( id )
  246. {
  247. if(is_user_connected(id))
  248. {
  249. static LogFile[ 64 ];
  250. static Data[ 128 ];
  251.  
  252.  
  253. static Name[32], authid[32], ip[32], uid;
  254. get_user_name(id, Name, sizeof Name - 1);
  255. get_user_authid(id,authid,sizeof authid - 1);
  256. get_user_ip(id,ip,sizeof ip - 1);
  257. uid = get_user_userid(id);
  258.  
  259. ColorChat( 0, BLUE, " %s is using KzHack!!!", Name );
  260.  
  261. switch(get_cvar_num( "nsc_kz_punish"))
  262. {
  263. case 0 :
  264. {
  265. if ( get_cvar_num( "nsc_kz_log") > 0 )
  266. {
  267. get_localinfo( "amxx_datadir" , LogFile , 63 );
  268. format( LogFile , 63 , "/%s/KzHackers.txt" , LogFile );
  269. }
  270. log_amx( "Name: ^"%s^" STEAMID: ^"%s^" IP: ^"%s^" Reason: ^"%s^"" , Name , authid, ip, type[id] );
  271. formatex( Data , 127 , "Name: ^"%s^" STEAMID: ^"%s^" IP: ^"%s^" Reason: ^"%s^"" , Name , authid, ip, type[id] );
  272. write_file( LogFile , Data );
  273. }
  274. case 1 :
  275. {
  276. if ( get_cvar_num( "nsc_kz_log") > 0 )
  277. {
  278. get_localinfo( "amxx_datadir" , LogFile , 63 );
  279. format( LogFile , 63 , "/%s/KzHackers.txt" , LogFile );
  280. }
  281. log_amx( "Name: ^"%s^" STEAMID: ^"%s^" IP: ^"%s^" Reason: ^"%s^"" , Name , authid, ip, type[id] );
  282. formatex( Data , 127 , "Name: ^"%s^" STEAMID: ^"%s^" IP: ^"%s^" Reason: ^"%s^"" , Name , authid, ip, type[id] );
  283. write_file( LogFile , Data );
  284.  
  285. server_cmd( "kick #%d ^"%s Detected^"", get_user_userid( id ), type[id]);
  286. }
  287. case 2 :
  288. {
  289. if ( get_cvar_num( "nsc_kz_log") > 0 )
  290. {
  291. get_localinfo( "amxx_datadir" , LogFile , 63 );
  292. format( LogFile , 63 , "/%s/KzHackers.txt" , LogFile );
  293. }
  294.  
  295. log_amx( "Name: ^"%s^" STEAMID: ^"%s^" IP: ^"%s^" Reason: ^"%s^"" , Name , authid, ip, type[id] );
  296. formatex( Data , 127 , "Name: ^"%s^" STEAMID: ^"%s^" IP: ^"%s^" Reason: ^"%s^"" , Name , authid, ip, type[id] );
  297. write_file( LogFile , Data );
  298.  
  299. server_cmd("amx_ban %d #%d ^"%s Detected. Please unload your cheat in order to join our server^"",get_cvar_num( "nsc_kz_btime"), uid, type[id]);
  300. }
  301. }
  302. }
  303. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement