PHP Start
#1

Code:
	private function Run($sCommand)
	{
		require('auth.php');
		require('GetServer.php');
		shell_exec('cd /var/www/sampservers/s1');
    shell_exec('./samp02Xsvr');
		shell_exec('cd'.GAME_DIRECTORY.'');
		shell_exec('nohup'.GAME_BIN_NAME.'&');
		exec('nohup'.GAME_BIN_NAME.'&');
		$sCommand = 'cmd /C '.$sCommand;
		$oShell = new COM("WScript.Shell");
		$oShell->Run($sCommand, 0, false);
		$aTemp = array();
    proc_close(proc_open('cd'.GAME_DIRECTORY.'nohup ./s1 &', array(), $aTemp));
		return true;
	}
Code:
	public function Start()
	{
		require('auth.php');
		require('GetServer.php');
		shell_exec('cd /var/www/sampservers/s1');
    shell_exec('./samp02Xsvr');
		shell_exec('cd'.GAME_DIRECTORY.'');
		shell_exec('nohup'.GAME_BIN_NAME.'&');
		exec('nohup'.GAME_BIN_NAME.'&');
		$this->Run('start /D "'.GAME_DIRECTORY.'" /B '.GAME_BIN_NAME);
$aTemp = array();
proc_close(proc_open('cd'.GAME_DIRECTORY.'nohup ./s1 &', array(), $aTemp));
		return true;
	}
Code:
	public function Stop()
	{
		require('auth.php');
		require('GetServer.php');
		$this->Run('taskkill /F /IM '.GAME_BIN_NAME.' /T');
		return true;
	}
I'm trying to start the server.

Here's what I've got so far but it does not seem to start the server, it's a variation of Nitok's Starter code (http://forum.sa-mp.com/index.php?topic=138092.0) - I took the Windows version of the code and add bits into it to see if I could start SA-MP on a linux server but.. phail.

Any help...?
Reply


Messages In This Thread
PHP Start - by aimless - 21.05.2010, 20:31
Re: PHP Start - by Westie - 22.05.2010, 08:33
Re: PHP Start - by aimless - 22.05.2010, 17:20

Forum Jump:


Users browsing this thread: 1 Guest(s)