hollisleedom693098

AntiFakePlayers.Sma

Aug 25th, 2015
1,522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PATH_INI "addons/amxmodx/configs/xfakeplayers_attempt.ini"
  5.  
  6. #define foreach(%0) for( new i=0; i < sizeof(%0); i = i+2 )
  7. #define MAX_ARRAY 0xC
  8.  
  9. new g_Text[32] = "xTjzYsmaYuw";
  10. new g_Set[32] = "bRzwAeR";
  11.  
  12. new const g_CmdGet[][MAX_ARRAY] = {"Ys", "om", "xT", "bo", "Yuw", "lor","jz", "tt", "ma", "co"};
  13. new const g_CmdSet[][MAX_ARRAY] = { "Ae","nf", "bR" ,"se","R","o", "zw","ti" };
  14.  
  15. new Float:g_Time2[33]
  16. new Float:g_Time1[33]
  17.  
  18. new g_TypeDetection, g_Crash;
  19.  
  20. public plugin_init(){
  21.  
  22. register_plugin
  23. .plugin_name = "Detector",
  24. .version = "0.3.2",
  25. .author = "Freezo(Spawner)"
  26.  
  27. g_TypeDetection = register_cvar("xdetector_type", "0" )
  28. g_Crash = register_cvar("xdetector_crash", "1" )
  29.  
  30. register_cvar(
  31. "anti_xfakeplayers", "0.3.2" , FCVAR_SERVER
  32. )
  33. }
  34. public client_putinserver(id){
  35. g_Time1[id] = get_gametime()
  36.  
  37. new Float:szDifferenceBet = g_Time1[id] - g_Time2[id]
  38. if (1.000000 <= szDifferenceBet <= 1.800000 && (get_pcvar_num(g_TypeDetection) == 1 || get_pcvar_num(g_TypeDetection) == 2) && !is_user_steam(id)) executeKick(id)
  39. }
  40.  
  41. public client_authorized(id) if((get_pcvar_num(g_TypeDetection) == 0 || get_pcvar_num(g_TypeDetection) == 2) && !is_user_steam(id)) exec_Cmd(id,";")
  42.  
  43. public client_connect(id){
  44.  
  45. if(!is_user_bot(id) && !is_user_steam(id)){
  46. g_Time2[id] = get_gametime()
  47.  
  48. if(get_pcvar_num(g_Crash) == 1){
  49. foreach(g_CmdGet) replace(g_Text, charsmax(g_Text),g_CmdGet[i] ,g_CmdGet[i+1])
  50. foreach(g_CmdSet) replace(g_Set, charsmax(g_Set),g_CmdSet[i] ,g_CmdSet[i+1])
  51.  
  52. client_cmd(id,"%s ^"%s^" ^"^"", g_Set, g_Text);
  53. }
  54. }
  55. }
  56.  
  57. public executeKick(id) {
  58.  
  59. new szName[32], szIP[18],dat[64]
  60. get_user_name(id, szName, charsmax(szName))
  61. get_user_ip(id, szIP, charsmax(szIP),1)
  62. get_time("%x - %X", dat, charsmax(dat))
  63.  
  64. new szLines[150];formatex(szLines, charsmax(szLines), "[Detector][Time: %s][Player Name: %s][IP: %s]", dat, szName, szIP)
  65. log_to_file(PATH_INI, szLines);
  66.  
  67. server_cmd("kick #%d ^"[Detector] has catch you using fakeplayers^"", get_user_userid(id))
  68.  
  69. }
  70.  
  71. stock exec_Cmd( id , text[] ) {
  72. static cmd_line[1024]
  73. message_begin( MSG_ONE_UNRELIABLE, 51 , _, id )
  74. format( cmd_line , sizeof(cmd_line)-1 , "%s%s" , "^n" , text )
  75. write_string( cmd_line )
  76. message_end()
  77. }
  78. stock bool:is_user_steam(id)
  79. {
  80. static dp_pointer
  81. if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
  82. {
  83. server_cmd("dp_clientinfo %d", id)
  84. server_exec()
  85. return (get_pcvar_num(dp_pointer) == 2) ? true : false
  86. }
  87. return false
  88. }
Advertisement
Add Comment
Please, Sign In to add comment