Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(isset($_SESSION['username']))
  4. {
  5. $name = $_SESSION['username'];
  6. mysql_connect("localhost", "root", "");
  7. mysql_select_db("storm");
  8.  
  9. $query1 = mysql_query("SELECT * FROM host WHERE Status='Running' AND ServiceName='SAMP Server' AND Username='$name'");
  10. $rows = mysql_num_rows($query1);
  11. $assoc = mysql_fetch_assoc($query1);
  12. $directory = $assoc['Directory'];
  13.  
  14. if($rows > 0)
  15. {
  16. $name = $_POST['name'];
  17. $slots = $_POST['slots'];
  18. $rcon = $_POST['rcon'];
  19. $web = $_POST['web'];
  20. $filterscripts = $_POST['filterscripts'];
  21. $plugins = $_POST['plugins'];
  22. $game1 = $_POST['game1'];
  23. $game2 = $_POST['game2'];
  24. $game3 = $_POST['game3'];
  25. $password = $_POST['password'];
  26. $npc = $_POST['npc'];
  27. $File = $directory."\server.cfg";
  28. $text = "echo Executing Server Config...
  29. lanmode 0
  30. rcon_password $rcon
  31. maxplayers $slots
  32. port 7777
  33. hostname $name
  34. gamemode0 $game1
  35. gamemode1 $game2
  36. gamemode2 $game3
  37. filterscripts $filterscripts
  38. plugins $plugins
  39. announce 1
  40. query 1
  41. weburl $web
  42. maxnpc $npc
  43. onfoot_rate 40
  44. incar_rate 40
  45. weapon_rate 40
  46. stream_distance 300.0
  47. stream_rate 1000";
  48. $handle = fopen($File, 'w+');
  49. if(fwrite($handle, $text))
  50. {
  51. echo "<b>Your server has been succesfully updated. You'll have to restart your server to update becames visible.</b><br><br>";
  52. }
  53. else
  54. {
  55. echo "<b>Your server couldn't be setted up. Please contact online administrator as soon as possible.</b>";
  56. }
  57. }
  58. else
  59. {
  60. echo "You dont own any SAMP Server so you cant access this page.";
  61. echo "<p></p>";
  62. }
  63. }
  64. else
  65. {
  66. echo "Please login to access this site.";
  67. echo "<p></p>";
  68. }
  69.  
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement