Well done, this script is very nice, thank you sk89q.
Probably someone know my project: leezerz.com. We want to build a huge DP-Community, there you can upload videos, can join groups and clans, chat via IRC or just connect to our teamspeakserver. But there is a 2nd big part of leezerz.com: We have got many DP-Servers and you rent them. To enable this, I have to edit your script, so that the players just can rent them, if nobody is on the server. My PHP-Skills are not very good, so I tried follow code, but it doenst work:
<?php
$test = ("pbConsole.send('listuserid')");
if strlen($test)== 0
{
$DMENU = array(
'Console' => array(
array('Toggle log display', "pbConsole.showLog=!pbConsole.showLog;pbConsole.readjustWindow()"),
array('----', ""),
array('Close console', "window.close()"),
),
'Server' => array(
array('Game version', "pbConsole.send('version')"),
array('Server information', "pbConsole.send('serverinfo')"),
array('Send a heartbeat', "pbConsole.send('heartbeat')"),
array('Execute a config/script file...', "pbConsole.askSend('exec ', '', ['Script filename?'])"),
array('Set server list master servers...', "pbConsole.askSend('setmaster ', '', ['Space separated list of server hosts?'])"),
array('----', ""),
array('Get a variable...', "pbConsole.askSend('get ', '', ['Name of variable?'])"),
array('Set a variable...', "pbConsole.askSend('set ', '', ['Name of variable?', 'Value?'])"),
array('Clear a variable...', "pbConsole.askSend('sv cvar_clear ', '', ['Name of variable?'])"),
array('Reset server variables...', "pbConsole.send('!resetvars')"),
array('----', ""),
array('List maps in rotation', "pbConsole.send('sv maplist')"),
array('Add map to rotation...', "pbConsole.askSend('sv rotation add ', '', ['Map name?'])"),
array('Remove map from rotation...', "pbConsole.askSend('sv rotation remove ', '', ['Map name?'])"),
),
'Game' => array(
array('Change to a new map...', "pbConsole.askSend('sv newmap ', '', ['Map name?'])"),
array('Select random map from rotation', "pbConsole.send('!randommap')"),
array('----', ""),
array('Expert mode...', "pbConsole.send('sv expert');pbConsole.askSend('sv expert ', '', ['ID # for gun?'])"),
array('----', ""),
array('Shuffle teams randomly', "pbConsole.send('!shuffleteams')"),
array('Shuffle teams by kills', "pbConsole.send('!shuffleteams kills')"),
array('Shuffle teams by flag captures', "pbConsole.send('!shuffleteams caps')"),
array('----', ""),
array('Record a demo...', "pbConsole.askSend('serverrecord ', '', ['Name of demo?'])"),
array('End recording of demo', "pbConsole.send('serverstop')"),
),
'Users' => array(
array('Players information', "pbConsole.send('status')"),
array('List player IP information', "pbConsole.send('sv listuserip')"),
array('----', ""),
array('Dump player information...', "pbConsole.askSend('dumpuser ', '', ['User ID #?'])"),
array('Kick a player...', "pbConsole.askSend('kick ', '', ['User ID #?'])"),
array('----', ""),
array('Kick all players?', "pbConsole.confirmSend('!kickallplayers', 'Kick all players?')"),
array('Kick all players and bots?', "pbConsole.confirmSend('!kickallplayersbots', 'Kick all players and bots?')"),
array('----', ""),
array('Add an ACEBot', "pbConsole.send('sv addbot')"),
array('Add a custom named ACEBot...', "pbConsole.askSend('sv addbot ', '', ['Name of bot?'])"),
array('Remove a bot...', "pbConsole.askSend('sv removebot ', '', ['Name of bot?'])"),
array('Remove all bots', "pbConsole.send('sv removebot all')"),
array('Bot command...', "pbConsole.askSend('sv botcommand ', '', ['Command to execute?'])"),
array('Save nodes', "pbConsole.send('sv savenodes')"),
),
'Administration' => array(
array('Talk into game from console...', "pbConsole.askSend('say ', '', ['Message?'])"),
array('----', ""),
array('List banned IP addresses', "pbConsole.send('sv listip')"),
array('Add IP to ban list', "pbConsole.askSend('sv addip ', '', ['IP address/mask?'])"),
array('Save ban list to disk', "pbConsole.send('sv writeip')"),
array('----', ""),
array('Remove all temporary bans?', "pbConsole.confirmSend('sv removetbans', 'Remove temporary bans?')"),
array('----', ""),
array('Kill server?', "pbConsole.confirmSend('quit', 'Are you sure you wish to KILL THE SERVER?')"),
),
'Password and Login' => array(
array('----', ""),
array('Set the password', "pbConsole.askSend('password ', '', ['Password?'])"),
array('Set the login', "pbConsole.askSend('oppass1 ', '', ['Login?'])"),
array('----', ""),
);
}
else
{
$DMENU = array(
'Sorry, Server already in use!' => array( 'Nothing to use'
),
);
}
?>
Somewhere in this code are bugs, but i cant find them. Can someone help me?