Advertisement
Nico65

[WBB4 Connect] code.pwn

Aug 26th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.79 KB | None | 0 0
  1. #include                        <a_samp>
  2. #include                        <a_http>
  3.  
  4. #define WBB4_URL                "url/info.php"
  5.  
  6. forward HTTP_WBB4_CREATE(index, response_code, data[]);
  7.  
  8. stock WBB4_CREATE(playerid, Name[], DBID, EMail[], pass[])
  9. {
  10.     new string[450];
  11.     format(string,sizeof(string),""#WBB4_URL"?funktion=create&sampdbid=%d&sampname=%s&email=%s&pw=%s",DBID,Name,EMail,pass);
  12.     HTTP(playerid, HTTP_GET, string, "", "HTTP_WBB4_CREATE");
  13.     return 1;
  14. }
  15. stock WBB4_UPDATERECHTE(playerid)
  16. {
  17.     if(sInfo[playerid][sEingeloggt] == 1)
  18.     {
  19.         if(strcmp(sInfo[playerid][sWBBID],"-1",true))
  20.         {
  21.             new string[450];
  22.             format(string,sizeof(string),""#WBB4_URL"?funktion=update&sampdbid=%d&sampname=%s",sInfo[playerid][sDBID],sInfo[playerid][sName]);
  23.             HTTP(playerid, HTTP_GET, string, "", "");
  24.         }
  25.     }
  26.     return 1;
  27. }
  28. stock WBB4_BANUSER(playerid, banid, grund[])
  29. {
  30.     if(sInfo[playerid][sEingeloggt] == 1)
  31.     {
  32.         if(strcmp(sInfo[playerid][sWBBID],"-1",true))
  33.         {
  34.             new string[450],name[65];
  35.             if(banid == -1)
  36.             {
  37.                 format(name,sizeof(name),"System");
  38.             }
  39.             else
  40.             {
  41.                 format(name,sizeof(name),"%s",sInfo[banid][sName]);
  42.             }
  43.             format(string,sizeof(string),""#WBB4_URL"?funktion=banuser&sampdbid=%d&sampname=%s&reason=%s&banname=%s",sInfo[playerid][sDBID],sInfo[playerid][sName],grund,name);
  44.             HTTP(playerid, HTTP_GET, string, "", "");
  45.         }
  46.  
  47.     }
  48.     return 1;
  49. }
  50. public HTTP_WBB4_CREATE(index, response_code, data[])
  51. {
  52.     if(response_code == 200)
  53.     {
  54.         new query[265];
  55.         format(query,sizeof(query),"UPDATE accounts SET WBBID='%s' WHERE ID='%d'",data,sInfo[index][sDBID]);
  56.         mysql_query(query);
  57.         mysql_free_result();
  58.         LoadAccount(index);
  59.         SendStartBonusEmail(index);
  60.         SpawnPlayer(index);
  61.     }
  62.     else
  63.     {
  64.         FehlerMeldung(index,"Dein Forumaccount konnte nicht erstellt werden");
  65.         LoadAccount(index);
  66.         SpawnPlayer(index);
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement