<?php require __DIR__ . '/SourceQuery/SourceQuery.class.php'; // For the sake of this example Header('Content-Type: text/plain'); Header('X-Content-Type-Options: nosniff'); // Edit this -> define('SQ_SERVER_ADDR', 'localhost'); define('SQ_SERVER_PORT', 27015); define('SQ_TIMEOUT', 1); define('SQ_ENGINE', SourceQuery::SOURCE); // Edit this <- $Query = new SourceQuery(); try { $Query->Connect(SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE); $Query->SetRconPassword('my_awesome_password'); var_dump($Query->Rcon('say hello')); } catch (Exception $e) { echo $e->getMessage(); } $Query->Disconnect();
<?php ob_clean(); if ($_GET['cmd'] == "logout") { session_destroy(); exit("<br>" . yes("You are logged out!")); } try { $Query = new SourceQuery(); $Query->Connect($_SESSION['s'], $_SESSION['port'], SQ_TIMEOUT, SQ_ENGINE); $Query->setRconPassword($_SESSION['p']); $r = $Query->Rcon(trim($_GET['cmd'])); $dictionary = array('§9' => '<span class="text-primary">', '§c' => '<span class="text-danger">', '§a' => '<span class="text-success">', '§0' => '', '§o' => '<span style="font-style:italic">', "\n" => '</br>', '§r' => '</span>'); $r = str_replace(array_keys($dictionary), $dictionary, $r); exit($r); } catch (Exception $e) { echo fail($e->getMessage()); }
$interval = date_diff($create, $end1); $days = (int) $interval->format("%a"); $end = strtotime($end); $sql = $dbh->query("UPDATE `amx_amxadmins` SET `expired` = '{$end}' WHERE `steamid` = '" . $row['steamid'] . "'"); if (!$sql) { die("Произошла ошибка, обновите страницу и попробуйте обратиться к администратору."); } } //Удаляем всю инфу о бане (bid прописывается в password) if ($type == 5) { $sql = $dbh->query("DELETE FROM `amx_bans` WHERE `bid` = '" . $row['pasword'] . "'"); $sql = $dbh->query("DELETE FROM `amx_bans_edit` WHERE `bid` = '" . $row['pasword'] . "'"); $sql = $dbh->query("DELETE FROM `amx_bans_log` WHERE `bid` = '" . $row['pasword'] . "'"); } //Посылаем amx_reloadadmins спасибо xPaw //Пока заглушка на unban чтобы не было ошибки if ($type != 5) { $sql_server = $dbh->query("SELECT `address` FROM `amx_serverinfo` WHERE `id` = '{$server_id}'"); if ($sql_server && ($row_server = $sql_server->fetch())) { $row_server = $sql_server->fetch(); $address = explode(":", $row_server['address']); $Query = new SourceQuery(); $Query->Connect($address[0], $address[1], $address[1], SourceQuery::GOLDSOURCE); $Query->SetRconPassword($rcon); $Query->Rcon($cmd); $Query->Disconnect(); } } $f = @fopen("order.txt", "a+") or die("error"); fputs($f, "order_num :{$inv_id};Summ :{$out_summ};Date :{$date}\n"); fclose($f);