• 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!

[Gesior AAC] Commands

Archez

'
Senator
Joined
Jun 26, 2008
Messages
6,589
Solutions
1
Reaction score
70
Location
Mexico
For GESIOR AAC.
Small commands script; yet simple, but useful.

1. go to your index.php and add this:
PHP:
	case "commands";
		$subtopic = "commands";
		$topic = "Commands";
		include("commands.php");
	break;

2. now, create a file called commands.php and paste this code in it:
PHP:
<?php
/* * * * Commands script by Archez * * * */
/* * * * http://otarts.net * * * * * * * */

$main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr bgcolor='.$config['site']['vdarkborder'].'>
<td colspan="2"><b>Commands</b></td>
</td align="right"></td></tr>';
		$number_of_commands = 0;
		$commands = $config['site']['commands'];
		foreach ($commands as $command => $use) {
						if(is_int($number_of_commands / 2))
					$bgcolor = $config['site']['darkborder'];
				else
					$bgcolor = $config['site']['lightborder'];
		$number_of_commands++;
		$main_content .= '<tr bgcolor="'.$bgcolor.'"><td width="'.$config['site']['commands_width'].'%">'.$command.'</td><td>'.$use.'</td></tr>';
		}
		$main_content .= '</table>';
?>

3. now, go to config/config.php and paste this:
PHP:
// PLAYER COMMANDS by  ARCHEZ
$config['site']['commands_width'] = '15'; // from 0% to 100% (recommended: 15)
$config['site']['commands'] = array(
  '!save' => 'Save your character so you avoid items or level loss.',
  '!buypremium' => 'Buy 30 days of premium time.',
  '!hunt' => 'Spend some cash with a nice amount for a frag.'
  ); // 'command' => 'description',
// PLAYER COMMANDS by ARCHEZ

4. now save, close and go to http://localhost/?subtopic=commands


Enjoy!
 
Simple tip, if you wish it to read directly from file:

PHP:
<?PHP
    $path = '/home/users/nsanee' ;
    $xml = simplexml_load_file($path . "/data/talkactions/talkactions.xml") ;
    $main_content .= "Commands available to players: <br /><br />" ;
    
    foreach ($xml as $command) 
    {
        if (!$command['access'] or $command['access'] < 1)
        {
            $main_content .= $command['words'] ;
            $main_content .= '<br /> ' ;
        }
    }
?>
Server owners could also add a 'desc' attribute in every <talkaction> and make this script also list it using $command['desc']
 
Last edited:
Or that
PHP:
<?php
$commands = simplexml_load_file($config['site']['server_path'].'/data/talkactions/talkactions.xml');
foreach($commands->talkaction as $command)
{
	if((int)$command['access'] > 2 || (string)$command['hide'] == "yes")
	{
		continue;
	}
	else
	{
		$main_content .= "<p>".$command['words']."</p>";
	}
}
?>
 
i use this:
PHP:
<?PHP
    $main_content .= '<br><center><font size=4><strong>Players Commands</strong></font></center><br>
<table width="100%" border="0" cellpadding="4" cellspacing="1">
<tr bgcolor="'.$config['site']['vdarkborder'].'"><td><strong><font color=white>Command</font></strong></td><td><strong><font color=white>Vip</font></strong></td><td><strong><center><font color=white>Parameter</font></center></strong></td><td><strong><font color=white>Description</font></strong></td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!frags</a></td><td width="3%"><center><font color=red>no</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Show How Many Players Are Online With Level And Vocation.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!online</a></td><td width="3%"><center><font color=red>no</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Show The Server Information.</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!players</a></td><td width="3%"><center><font color=red>no</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Show How Many Players Are Online With Level And Vocation.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!changersex</a></td><td width="3%"><center><font color=red>no</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Change Your Sex For 3 Vip Days.</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!deathlist</a></td><td width="3%"><center><font color=red>no</font></center></td><td width="15%">!deathlist <font color=red>NICK</font></td><td width="40%">Show The Last Deaths Of The PLayer.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!bless</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Buy all blessings for 50k.</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!guildcast</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%">!guildcast <font color=red>MESSAGE</font></td><td width="40%">Only Leaders/Vice Can Use This Commands.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!aol</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Buy Amullet Of Loss For 10k</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!go</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Change Party Colors.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">/vote-guild</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>/vote-guild <font color=red>NICK</font></center></td><td width="40%">It Is Same At Reputation But For Guilds</td></tr>

</table>

<br><center><font size=4><strong>Banker Commands</strong></font></center><br>
<table width="100%" border="0" cellpadding="4" cellspacing="1">
<tr bgcolor="'.$config['site']['vdarkborder'].'"><td><strong><font color=white>Command</font></strong></td><td><strong><font color=white>Vip</font></strong></td><td><strong><center><font color=white>Parameter</font></center></strong></td><td><strong><font color=white>Description</font></strong></td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!balance</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Show Your Balance.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!deposit</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Deposit Money In The Bank.</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!withdraw</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Remove Money Of The Bank.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!transfer</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Transfer Money To Other Player.</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!depositall</a></td><td width="3%"><center><font color=red>No</font></center><td width="15%"><center>n/d</center></td><td width="40%">Deposit All Your Money in The Bank.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!withdrawall</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Remove All Your Money Of The Bank.</td></tr>
</table>

<br><center><font size=4><strong>House Commands</strong></font></center><br>
<table width="100%" border="0" cellpadding="4" cellspacing="1">
<tr bgcolor="'.$config['site']['vdarkborder'].'"><td><strong><font color=white>Command</font></strong></td><td><strong><font color=white>Vip</font></strong></td><td><strong><center><font color=white>Parameter</font></center></strong></td><td><strong><font color=white>Description</font></strong></td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!buyhouse</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">To Buy A House.</td></tr>
<tr bgcolor="'.$config['site']['darkborder'].'"><td width="15%">!sellhouse</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Sell House To Other Player.</td></tr>
<tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%">!leavehouse</a></td><td width="3%"><center><font color=red>No</font></center></td><td width="15%"><center>n/d</center></td><td width="40%">Leave Of The House.</td></tr>
</table>';

?>
commands.jpg

and it looks nice :D
 
@up

sucks code hehe, i already like the actually code, MAS COMODO :)
 
Back
Top