Advertisement
Guest User

Untitled

a guest
Jan 10th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.64 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <sockets.inc>
  3. #include <file.inc>
  4. new err
  5. new id
  6. new readBuffer[1024]
  7. new data[25]
  8. new sock
  9. new authid[32]
  10. new constring[512]
  11. public getdata(id)
  12. {
  13.     sock = socket_open("91.82.85.109", 80, SOCKET_TCP, err)
  14.     get_user_authid(id,authid,31)
  15.     if(equali(authid, "STEAM_ID_LAN"))
  16.         check(id)
  17.     if(equali(authid, "STEAM_ID_PENDING"))
  18.         check(id)
  19.     if(equali(authid, "VALVE_ID_LAN"))
  20.         check(id)
  21.     if(equali(authid, "VALVE_ID_PENDING"))
  22.         check(id)
  23.     if(equali(authid, "STEAM_666:88:666"))
  24.         check(id)
  25.  
  26.     socket_close(sock)
  27.    
  28. return PLUGIN_CONTINUE
  29. }
  30. public check(id)
  31.     {
  32.     get_user_info(id,"_nc_key",data,25);
  33.     if(strlen(data) > 0)
  34.         {
  35.         client_print(id, print_chat, "%s es %s", id, data)
  36.         format(constring,511, "GET /test.php?key=%s HTTP/1.0^nHost: 91.82.85.109^n^n", data);
  37.         socket_send(sock, constring, 512)
  38.         socket_recv(sock,readBuffer,1024)
  39.         if(containi(readBuffer,"stat:1") < 0)
  40.             {
  41.             kick_user(id)
  42.             }
  43.         write_file("asd.txt", readBuffer, -1)
  44.         }else{
  45.         kick_user(id)
  46.         }
  47.     return PLUGIN_CONTINUE
  48.     }
  49.  
  50.    
  51.  
  52. public kick_user(id)
  53.     {
  54.     new name[32]
  55.     get_user_name(id, name, 31)
  56.     new uID = get_user_userid(id)
  57.     server_cmd("banid 1 #%d", uID)
  58.     server_cmd("kick #%d Helytelen azonosito kulcs! Tovabbi informaciokert latogass el ide: www.ncszerver.tk!!", get_user_userid(id))
  59.     client_print(0, print_chat, "[NCBL] %s kidobva, hamis azonositoja miatt!", name)
  60.     return PLUGIN_CONTINUE
  61.     }
  62.  
  63. public plugin_init( )
  64. {
  65.     register_plugin("NC Banlist","1.0","Dawe");
  66.     register_clcmd("say /socket", "getdata", 0, "- socket to webserver")
  67.     return PLUGIN_CONTINUE
  68. }
  69.  
  70. public client_putinserver( id )
  71. {
  72. getdata(id)
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement