• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problems with Modern AAC

Djivar

AKA Wickedviruz
Joined
Sep 28, 2009
Messages
1,641
Reaction score
19
Location
Sweden,edsbyn
Can anyone help me, this is from http://otland.net/f118/releasing-auto-restart-ot-script-via-modern-aac-111124/ and i get errors. when i post this in my SQL :
Code:
CREATE TABLE IF NOT EXISTS `z_shut` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `shutdown` INT(11) NOT NULL DEFAULT '1',
  `long` INT(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
 
 
INSERT INTO `z_shut` (`id`, `shutdown`, `long`) VALUES
(1, 0, 1);


I get this error:
Code:
SQL query:

INSERT INTO  `z_shut` (  `id` ,  `shutdown` ,  `long` ) 
VALUES ( 1, 0, 1 ) ;


MySQL said: 

#1062 - Duplicate entry '1' for key 'PRIMARY'

Help?

- - - Updated - - -

Sorry for dubble post but i cant find where to Edit my old post, i also get this error :
Code:
Parse error: syntax error, unexpected 'else' (T_ELSE) in E:\xampp\htdocs\index.php on line 206
When i add this:
PHP:
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]');
under this
PHP:
if($ide->isAdmin())
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
¨

So it's looks like this:
PHP:
if($ide->isAdmin())
	$smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
	$smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]');
else
	$smarty->assign('admin', '');
 
denna:
Code:
Parse error: syntax error, unexpected 'else' (T_ELSE) in E:\xampp\htdocs\index.php on line 206
För man skall söka på detta:
PHP:
if($ide->isAdmin())
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
sedan lägga till detta under:
PHP:
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]');

när man lägger till det så blir de såhär:
PHP:
if($ide->isAdmin())
	$smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
	$smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]');
else
	$smarty->assign('admin', '');
Och det är de där "else" som gör errorn av någon anledning :S
 
Du har glömt måsvingarna på else :)

else {

}

samma sak på if.

Menar du såhär?
PHP:
if($ide->isAdmin())
	$smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
	$smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]'); 

	else {

	}
	$smarty->assign('admin', '');

För isf så säger den förtfarande unexpected 'else' (T_ELSE)
 
Nope.

såhär.
PHP:
if($ide->isAdmin()) {
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]'); 
}
    else {
            $smarty->assign('admin', ''); 
    }
 
Nope.

såhär.
PHP:
if($ide->isAdmin()) {
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]');
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]'); 
}
    else {
            $smarty->assign('admin', ''); 
    }

But now the Administration dont show :s


And now i got this error:
Code:
Parse error: syntax error, unexpected '=' in E:\xampp\htdocs\system\pages\restarter.php on line 8



And here is line 8, i think it's the first "="
PHP:
    if($action == "")
    {
        echo = '<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
        <tr><td width="150"><font color="red"><b>Option</b></font></td><td><font color="red"><b>Description</b></font></td></tr>
        <tr bgcolor="#cccccc"><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=restart\">Restart</a></b></td><td><b>Kills server process and starts new one.</b></td></tr>
        <tr><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=kill\">Kill process</a></b></td><td><b>Kills server process.</b></td></tr>
        <tr bgcolor="#cccccc"><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=start\">Start server</a></b></td><td><b>Starts server.</b></td></tr>
        <tr><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=shutdown\">Shutdown server instantly</a></b></td><td><b>Allows you to safe shutdown server(using servers own shutdown function).</b></td></tr>
        <tr bgcolor="#cccccc"><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=shutdownlong\">Player-friendly shutdown</a></b></td><td><b>Performs safe shutdown after broadcast warning and 5 minutes delay.</b></td></tr>
        <tr><td width="150"><b><a href="'.$website.'/index.php/admin">Back to Administration</a></b></td><td><b>Go back to admin panel.</b></td></tr>
        </table>';
    }
 
Last edited:
Remove the = after echo.

I did and removed rest of the = after echo and when i had done that so it looks like this:
PHP:
<?PHP
$path = "C:\Users\johan\Desktop\REAL EVO 8.60";
$exename = "ots.exe";
if($ide->isAdmin())
{
    if($action == "")
    {
        echo  '<table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
        <tr><td width="150"><font color="red"><b>Option</b></font></td><td><font color="red"><b>Description</b></font></td></tr>
        <tr bgcolor="#cccccc"><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=restart\">Restart</a></b></td><td><b>Kills server process and starts new one.</b></td></tr>
        <tr><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=kill\">Kill process</a></b></td><td><b>Kills server process.</b></td></tr>
        <tr bgcolor="#cccccc"><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=start\">Start server</a></b></td><td><b>Starts server.</b></td></tr>
        <tr><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=shutdown\">Shutdown server instantly</a></b></td><td><b>Allows you to safe shutdown server(using servers own shutdown function).</b></td></tr>
        <tr bgcolor="#cccccc"><td width="150"><b><a href=\"'.$website.'/index.php/p/v/restart&action=shutdownlong\">Player-friendly shutdown</a></b></td><td><b>Performs safe shutdown after broadcast warning and 5 minutes delay.</b></td></tr>
        <tr><td width="150"><b><a href="'.$website.'/index.php/admin">Back to Administration</a></b></td><td><b>Go back to admin panel.</b></td></tr>
        </table>';
    }
    getcwd();  
    chdir($path);
    if($action == "restart")
    {
        exec('TASKKILL /F /IM ".$exename."');
        $command = 'START/HIGH '.$exename;
        $tmpnam = "temp.bat";
        $fp = fopen ($tmpnam, "w");
        fwrite($fp, $command);
        fclose ($fp);
        $foo = @popen($tmpnam, 'r');
        echo '<center>Server restarted.<br><b><a href="?subtopic=restarter">Back</a></center>';
    }
    if($action == "kill"){exec('TASKKILL /F /IM "'.$exename.'"'); echo '<center>Server closed.<br><b><a href="?subtopic=restarter">Back</a></center>';}
    if($action == "start")
    {
        $command = 'START/HIGH '.$exename;
        $tmpnam = "temp.bat";
        $fp = fopen ($tmpnam, "w");
        fwrite($fp, $command);
        fclose ($fp);
        $foo = @popen($tmpnam, 'r');
        echo '<center>Server started. <br><b><a href="?subtopic=restarter">Back</a></center>';
    }
    if($action == "shutdown")
    {  
        $SQL->query('UPDATE '.$SQL->tableName('z_shut').' SET `shutdown`="1", `long`="0" WHERE id = "1";');
        echo '<center>Server will shut down soon. <br><b><a href="?subtopic=restarter">Back</a></center>';
    }
    if($action == "shutdownlong")
    {  
        $SQL->query('UPDATE '.$SQL->tableName('z_shut').' SET `shutdown`="1", `long`="1" WHERE `id` = "1";');
        echo '<center>Server will shut down soon. <br><b><a href="?subtopic=restarter">Back</a></center>';
    }
}
else
{
    $title = $GLOBALS['config']['server']["serverName"]." - OTS";
    echo 'Invalid subtopic. Can\'t load page.';
}
?>

Then i got this error
Code:
Fatal error: Uncaught exception 'Exception' with message 'Unable to load template file 'index.tpl'' in E:\xampp\htdocs\system\application\libraries\sysplugins\smarty_internal_template.php:169 Stack trace: #0 E:\xampp\htdocs\system\application\libraries\sysplugins\smarty_internal_template.php(521): Smarty_Internal_Template->isExisting(true) #1 E:\xampp\htdocs\system\application\libraries\Smarty.class.php(336): Smarty_Internal_Template->getRenderedTemplate() #2 E:\xampp\htdocs\system\application\libraries\Smarty.class.php(380): Smarty->fetch('index.tpl', NULL, NULL, NULL, true) #3 E:\xampp\htdocs\index.php(215): Smarty->display('index.tpl') #4 {main} thrown in E:\xampp\htdocs\system\application\libraries\sysplugins\smarty_internal_template.php on line 169


And still how do i make the administration come back because when i added this:
PHP:
if($ide->isAdmin()) { 
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/admin">Administration</a>]'); 
    $smarty->assign('admin', '[<a href="'.$website.'/index.php/p/v/restart">Restarter</a>]');  
} 
    else { 
            $smarty->assign('admin', '');  
    }
it's just shows the restarter, not the administration
 
Is it the newset rev of modern aac? Its smth with smarty, Mby a bad script or dosent work for your rev. Try updating the files the bug said is wrong.
Or take a look at the newest gesior :)
WibbenZ
 
Modern aac was good even the best at a point. But for me I feel more attracted to the new gesior aac, mainly since he is active and afasik no one is working on modern aac atm.
And one more thing is that almost all the scripts/layouts you can find for the old gesiors work, mainly by just updating a few lines, insted of remaking almost all of the code to be more to modern aac.
WibbenZ
 
Back
Top