Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #if defined KC_WBB_STATS__
- #endinput
- #endif
- #define KC_WBB_STATS__
- #include <a_http>
- forward HTTP_Callback(index, response_code, data[]);
- new URL[128],SEC[128],Aktiv;
- public HTTP_Callback(index, response_code, data[])
- {
- print("[KC_WBB_STATS]Versuche verbindung aufzubauen...");
- if(response_code == 200)
- {
- print("[KC_WBB_STATS]Server erreichbar.");
- if(strcmp(data,"test_erfolgreich",true)==0)
- {
- print("[KC_WBB_STATS]Verbindung erfolgreich aufgebaut.");
- Aktiv = 1;
- }else{
- print("[KC_WBB_STATS]Verbindung fehlgeschlagen.\n[KC_WBB_STATS]Ueberpruefen sie: SEC_KEY und die URL!");
- }
- }else{
- print("[KC_WBB_STATS]Server nicht erreichbar...");
- }
- return 1;
- }
- stock Activate_Script(URL2[128],SEC2[128])
- {
- format(URL,sizeof(URL),"%s",URL2);
- format(SEC,sizeof(SEC),"%s",SEC2);
- new URL3[128];
- format(URL3,sizeof(URL3),"%s/KC_Script.php?action=test&sec_key=%s",URL2,SEC2);
- HTTP(1, HTTP_GET, URL3, "", "HTTP_Callback");
- return 1;
- }
- stock Edit_Feld(UserName[MAX_PLAYER_NAME],Feld_ID,Wert[40])
- {
- if(Aktiv==0){ return 0; }
- new URL2[200];
- 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);
- HTTP(0, HTTP_GET, URL2,"","");
- return 1;
- }
- stock Ban_User(UserName[MAX_PLAYER_NAME],Grund[])
- {
- if(Aktiv==0){ return 0; }
- new URL2[128];
- format(URL2,sizeof(URL2),"%s/KC_Script.php?action=ban_user&name=%s&reason=%s&sec_key=%s",URL,UserName,Grund,SEC);
- HTTP(0, HTTP_GET, URL2,"","");
- return 1;
- }
- stock Unbann_User(UserName[MAX_PLAYER_NAME])
- {
- if(Aktiv==0) { return 0; }
- new URL2[128];
- format(URL2,sizeof(URL2),"%s/KC_Script.php?action=unban_user&name=%s&reason=%s",URL,UserName,SEC);
- HTTP(0, HTTP_GET, URL2,"","");
- return 1;
- }
- stock Create_User(UserName[MAX_PLAYER_NAME],Pass[],Mail[])
- {
- if(Aktiv==0) { return 0; }
- new URL2[180];
- 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);
- print(URL2);
- HTTP(0, HTTP_GET, URL2,"","");
- print("Done...");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement