i have a static ip, i dont whitelist port. my ip has maybe changed 3 times since last year.
also i still have ssh so wont be locked out, but just wanted to make sure that it would be ok to use it.
Dont know if it has SQL injection protection and stuff
> require("./rcon/q3query.class.php");
> if (isset($_GET['action'])) {
> $action = $_GET['action'];
> $user_id = $_GET['uid'];
> $server_id = $_GET['sid'];
> }
>
> // Check for action in url, imports the variables and do command.
> if($action == "kick") {
>
> foreach ($serverinfo as $server) {
> if($server['0'] == $server_id){
>
> $con = new q3query($server['2'], $server['3'], $success);
> if (!$success) {
> die ("Fehler bei der Verbindungherstellung");
> }
> $con->setRconpassword($server['4']);
> $con->rcon("clientkick $user_id $kickmessage");
> echo "You successfully should have kicked the user with ID $user_id. Redirect after 3 seconds.";
> header( "refresh:3;url=index.php" );
> die();
> }
> }
> } else if ($action == "ban") {
> foreach ($serverinfo as $server) {
> if($server['0'] == $server_id){
> $con = new q3query($server['2'], $server['3'], $success);
> if (!$success) {
> die ("Fehler bei der Verbindungherstellung");
> }
> $con->setRconpassword($server['4']);
> echo $con->rcon("tempbanclient $user_id $banmessage");
> echo "You successfully should have banned the user with ID $user_id. Redirect after 3 seconds.";
> header( "refresh:3;url=index.php" );
> die();
> }
> }
> }
By
require("./rcon/q3query.class.php");
if (isset($_GET['action'])) {
$action = $_GET['action'];
$user_id = $_GET['uid'];
$server_id = $_GET['sid'];
// Check for action in url, imports the variables and do command.
if($action == "kick") {
foreach ($serverinfo as $server) {
if($server['0'] == $server_id){
$con = new q3query($server['2'], $server['3'], $success);
if (!$success) {
die ("Fehler bei der Verbindungherstellung");
}
$con->setRconpassword($server['4']);
$con->rcon("clientkick $user_id $kickmessage");
echo "You successfully should have kicked the user with ID $user_id. Redirect after 3 seconds.";
header( "refresh:3;url=index.php" );
die();
}
}
} else if ($action == "ban") {
foreach ($serverinfo as $server) {
if($server['0'] == $server_id){
$con = new q3query($server['2'], $server['3'], $success);
if (!$success) {
die ("Fehler bei der Verbindungherstellung");
}
$con->setRconpassword($server['4']);
echo $con->rcon("tempbanclient $user_id $banmessage");
echo "You successfully should have banned the user with ID $user_id. Redirect after 3 seconds.";
header( "refresh:3;url=index.php" );
die();
}
}
}
}
Why?
Because the declaration of the action is not cited
In the code of action kick and ban.
So he replies that the action kick or ban is not defined.
else if ($action == "money") {
foreach ($serverinfo as $server) {
if($server['0'] == $server_id){
$con = new q3query($server['2'], $server['3'], $success);
if (!$success) {
die ("Fehler bei der Verbindungherstellung");
}
$con->setRconpassword($server['4']);
echo $con->rcon("setmoney $user_id 1000000");
echo "You successfully should have set 1,000,000 $ to the user with ID $user_id. Redirect after 3 seconds.";
header( "refresh:3;url=index.php" );
die();
}
}
} else if ($action == "money1") {
foreach ($serverinfo as $server) {
if($server['0'] == $server_id){
$con = new q3query($server['2'], $server['3'], $success);
if (!$success) {
die ("Fehler bei der Verbindungherstellung");
}
$con->setRconpassword($server['4']);
echo $con->rcon("setmoney $user_id 10000000");
echo "You successfully should have set 10,000,000 $ to the user with ID $user_id. Redirect after 3 seconds.";
header( "refresh:3;url=index.php" );
die();
}
}
}
<th>MONEY</th>
<td><a href='index.php?action=money&uid=$player_id&sid=$server[0]' class='btn btn-success btn-xs'> Set to 1,000,000$</a> <a href='index.php?action=money1&uid=$player_id&sid=$server[0]' class='btn btn-success btn-xs'> Set to 10,000,000$</a></td></tr>
-- Sets the player money to the specified amount
Player:setMoney(amount)
-- Adds to the current total amount of money
Player:addMoney(amount)
-- Removes from the current amount of money
Player:removeMoney(amount)
I can’t help you guys with any of my projects as my real-life doesn’t give me the time for this anymore.
In a few months I will be back updating, fixing and adding anything you like but it’s not possible for me at the moment. Please share this to anyone who asks.
First test: It looks like it work, I can see my self on my server. But when I try to ‘kick my self’, I get an ‘404 not found’ error.
I try again later, But now I get an ‘http 500’ error, what happent ?? Please help …
Yes, upload your newly named index.php file, along with the rcon folder.
array(“0”,“Name of your server”,“server ip”,“port of server”,“rcon pass”),
Name of your server - this is just listed on the page itself, so if you have more than 1 server, it is listed and organised on the web page.
Server port - Found in your .yml file - open citmp-server.yml - top line, use the ListenPort
RCon Pass - Found also in your .yml file - open citmp-server.yml, find RconPassword - enter your rcon password listed