Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(isset($_SESSION['username']))
- {
- $name = $_SESSION['username'];
- mysql_connect("localhost", "root", "");
- mysql_select_db("storm");
- $query1 = mysql_query("SELECT * FROM host WHERE Status='Running' AND ServiceName='SAMP Server' AND Username='$name'");
- $rows = mysql_num_rows($query1);
- $assoc = mysql_fetch_assoc($query1);
- $directory = $assoc['Directory'];
- if($rows > 0)
- {
- $name = $_POST['name'];
- $slots = $_POST['slots'];
- $rcon = $_POST['rcon'];
- $web = $_POST['web'];
- $filterscripts = $_POST['filterscripts'];
- $plugins = $_POST['plugins'];
- $game1 = $_POST['game1'];
- $game2 = $_POST['game2'];
- $game3 = $_POST['game3'];
- $password = $_POST['password'];
- $npc = $_POST['npc'];
- $File = $directory."\server.cfg";
- $text = "echo Executing Server Config...
- lanmode 0
- rcon_password $rcon
- maxplayers $slots
- port 7777
- hostname $name
- gamemode0 $game1
- gamemode1 $game2
- gamemode2 $game3
- filterscripts $filterscripts
- plugins $plugins
- announce 1
- query 1
- weburl $web
- maxnpc $npc
- onfoot_rate 40
- incar_rate 40
- weapon_rate 40
- stream_distance 300.0
- stream_rate 1000";
- $handle = fopen($File, 'w+');
- if(fwrite($handle, $text))
- {
- echo "<b>Your server has been succesfully updated. You'll have to restart your server to update becames visible.</b><br><br>";
- }
- else
- {
- echo "<b>Your server couldn't be setted up. Please contact online administrator as soon as possible.</b>";
- }
- }
- else
- {
- echo "You dont own any SAMP Server so you cant access this page.";
- echo "<p></p>";
- }
- }
- else
- {
- echo "Please login to access this site.";
- echo "<p></p>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement