Advertisement
KingClem

WBB_Stats Include

Feb 2nd, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.11 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3.  
  4. #if defined KC_WBB_STATS__
  5. #endinput
  6. #endif
  7.  
  8. #define KC_WBB_STATS__
  9.  
  10. #include <a_http>
  11. forward HTTP_Callback(index, response_code, data[]);
  12.  
  13. new URL[128],SEC[128],Aktiv;
  14. public HTTP_Callback(index, response_code, data[])
  15. {
  16.     print("[KC_WBB_STATS]Versuche verbindung aufzubauen...");
  17.     if(response_code == 200)
  18.     {
  19.         print("[KC_WBB_STATS]Server erreichbar.");
  20.         if(strcmp(data,"test_erfolgreich",true)==0)
  21.         {
  22.         print("[KC_WBB_STATS]Verbindung erfolgreich aufgebaut.");
  23.         Aktiv = 1;
  24.         }else{
  25.         print("[KC_WBB_STATS]Verbindung fehlgeschlagen.\n[KC_WBB_STATS]Ueberpruefen sie: SEC_KEY und die URL!");
  26.         }
  27.     }else{
  28.     print("[KC_WBB_STATS]Server nicht erreichbar...");
  29.     }
  30.     return 1;
  31. }
  32.  
  33. stock Activate_Script(URL2[128],SEC2[128])
  34. {
  35. format(URL,sizeof(URL),"%s",URL2);
  36. format(SEC,sizeof(SEC),"%s",SEC2);
  37. new URL3[128];
  38. format(URL3,sizeof(URL3),"%s/KC_Script.php?action=test&sec_key=%s",URL2,SEC2);
  39. HTTP(1, HTTP_GET, URL3, "", "HTTP_Callback");
  40. return 1;
  41. }
  42.  
  43.  
  44. stock Edit_Feld(UserName[MAX_PLAYER_NAME],Feld_ID,Wert[40])
  45. {
  46. if(Aktiv==0){ return 0; }
  47. new URL2[200];
  48. format(URL2,sizeof(URL2),"%s/KC_Script.php?action=edit_field&name=%s&id=%i&value=%s&sec_key=%s",URL,UserName,Feld_ID,Wert,SEC);
  49. HTTP(0, HTTP_GET, URL2,"","");
  50. return 1;
  51. }
  52. stock Ban_User(UserName[MAX_PLAYER_NAME],Grund[])
  53. {
  54. if(Aktiv==0){ return 0; }
  55. new URL2[128];
  56. format(URL2,sizeof(URL2),"%s/KC_Script.php?action=ban_user&name=%s&reason=%s&sec_key=%s",URL,UserName,Grund,SEC);
  57. HTTP(0, HTTP_GET, URL2,"","");
  58. return 1;
  59. }
  60. stock Unbann_User(UserName[MAX_PLAYER_NAME])
  61. {
  62. if(Aktiv==0) { return 0; }
  63. new URL2[128];
  64. format(URL2,sizeof(URL2),"%s/KC_Script.php?action=unban_user&name=%s&reason=%s",URL,UserName,SEC);
  65. HTTP(0, HTTP_GET, URL2,"","");
  66. return 1;
  67. }
  68. stock Create_User(UserName[MAX_PLAYER_NAME],Pass[],Mail[])
  69. {
  70. if(Aktiv==0) { return 0; }
  71. new URL2[180];
  72. format(URL2,sizeof(URL2),"%s/KC_Script.php?action=create_acc&name=%s&pass=%s&mail=%s&sec_key=%s",URL,UserName,Pass,Mail,SEC);
  73. print(URL2);
  74. HTTP(0, HTTP_GET, URL2,"","");
  75. print("Done...");
  76. return 1;
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement