Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <?php
  2. //SECURITY SITE
  3. include("auth.php");
  4. ?>
  5.  
  6.  
  7.  
  8. <?php error_reporting(E_ALL);
  9.  
  10. $playername = $_SESSION['username'];
  11.  
  12. require_once("WebsenderAPI.php");
  13.  
  14. $wsr = new WebsenderAPI("127.0.0.1","123qwe","9876"); // HOST , PASSWORD , PORT
  15.  
  16.  
  17. $pdo3 = new PDO('mysql:host=localhost;dbname=sql7', 'sql7', 'bhjUJHbuihbuhjwbndu32h8u23hifbn');
  18. $einlesen = "SELECT gsid FROM GS WHERE gsid='1'";
  19. if(($einlesen)==1) //GS VORHANDEN, VERNEINEN
  20. {
  21. echo "Das Grundstück ist bereits vergeben!";
  22. }
  23.  
  24.  
  25. else{
  26. //GS NICHT VORHANDEN WEITER MIT GELDABFRAGE
  27.  
  28.  
  29.  
  30. $pdo = new PDO('mysql:host=localhost;dbname=sql8', 'sql8', 'kjlNIOhouijefhojfeuopjfnihqwfj389hfnjks');
  31. $sql1 = "SELECT SUM(money) AS money FROM moneysql WHERE last_known_name = '$playername'";
  32. foreach ($pdo->query($sql1) as $row1)
  33.  
  34.  
  35.  
  36. if($row1['money'] > 20000){
  37. if($wsr->connect()){
  38.  
  39. $wsr->sendCommand("msg $playername Du hast ein Grundstück erworben!");
  40. $wsr->sendCommand("plot Desert01;-1;-3 setowner $playername");
  41. $wsr->sendCommand("eco take $playername 20000");
  42. $wsr->disconnect();
  43. echo "Grundstück erworben!";
  44.  
  45. $pdo2 = new PDO('mysql:host=localhost;dbname=sql7', 'sql7', 'bhjUJHbuihbuhjwbndu32h8u23hifbn');
  46.  
  47. $statement = $pdo2->prepare("INSERT INTO GS (spielername, gsid, kaufbetrag) VALUES (?, ?, ?)");
  48. $statement->execute(array('comingsoon', '1', '20000'));
  49.  
  50. }else
  51. echo "Verbindungsaufbau fehlgeschlagen";
  52. }else
  53.  
  54. echo "Fehlgeschlagen! Du hast nicht genügend Geld!";
  55. }
  56. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement