<?php //Get list of updates $text = file_get_contents('https://404rq.com/update-list/mtasa.txt'); //Return updates list include "php-sdk/mta_sdk.php"; mta::doReturn($text);
public static function convertFromObjects($item) { if (is_array($item)) { foreach ($item as &$value) { $value = mta::convertFromObjects($value); } } elseif (is_object($item)) { if (get_class($item) == "Element" || get_class($item) == "Resource") { $item = $item->toString(); } } return $item; }
<?php $conn = mysql_pconnect($mysql_host, $mysql_user, $mysql_pass); $userid = $_GET["id"]; mysql_select_db("mta", $conn); $result = mysql_query("SELECT username, banned FROM accounts WHERE id='" . $userid . "' LIMIT 1", $conn); if (!$result || mysql_num_rows($result) == 0) { echo "<p>Account with ID: " . $userid . " was not found.</p>"; } else { $tusername = mysql_result($result, 0, 0); $banned = mysql_result($result, 0, 1); if ($banned != 1) { echo "<p>This account is not banned.</p>"; } else { include "sdk/mta_sdk.php"; try { $mtaServer = new mta("87.238.173.138", 22005, "debugger", "98b803d4b4ec0916397d7f508cdc8964"); if ($mtaServer) { $resource = $mtaServer->getResource("admin-system"); $resource->call("remoteUnban", $username, $tusername); mysql_query("UPDATE accounts SET banned=0 WHERE id='" . $userid . "' LIMIT 1", $conn); echo "<p>'<strong>" . $tusername . "</strong>' is now unbanned.</p>"; } else { echo "<p>The server is currently unavailable to unban someone.</p>"; } } catch (Exception $e) { //echo $e; echo "<p>The server is currently unavailable to unban someone.</p>"; } } } ?>
$servermessage = "Your zip file was uploaded to the mta server. Testing loading now..."; ftp_mkdir($ftp_conn, $folder_path); $zip->open($zip_file["tmp_name"]); for ($i = 0; $i < $zip->numFiles; $i++) { $iname = $zip->getNameIndex($i); // var_dump($iname,"zip://".$zip_file["tmp_name"]."#".$iname, is_dir("zip://".$zip_file["tmp_name"]."#".$iname), pathinfo($iname)); echo "."; if (substr($iname, -1) == "/") { ftp_mkdir($ftp_conn, $folder_path . $iname); } else { ftp_put($ftp_conn, $folder_path . $iname, "zip://" . $zip_file["tmp_name"] . "#" . $iname, FTP_BINARY); } } $zip->close(); // Notify the server a new mta map was uploaded $returns = false; $mtaServer = new mta($mta_host, $http_port); try { $returns = $mtaServer->getResource("maptools")->call("newMap", $filename, $_SESSION['forumid'], $_SESSION['user']); } catch (Exception $e) { } $mta_error = $returns[0]; $status = $returns[1]; // Check the response from the mta server, if something is wrong then remove the folder again if (!$returns) { // Couldn't connect to mta $servermessage = "Could not connect with the MTA server, check if it is online and try again"; ftp_rdel($ftp_conn, $folder_path); } elseif (strlen($mta_error) > 1) { // MTA server reported an error $servermessage = "Error while loading map: " . $mta_error; ftp_rdel($ftp_conn, $folder_path);
<?php // ============================= // (Config) HTTP Username / Password // ============================= $http_username = ''; $http_password = ''; // ============================= // No need to edit below this line // ============================= $host = $_POST['host']; $port = intval($_POST['port']); $resource = $_POST['resource']; $function = $_POST['func']; $val = $_POST['val']; try { include 'mta_sdk.php'; $mtaSDK = new mta(); if ($http_username && $http_password) { $mtaSDK->http_username = $http_username; $mtaSDK->http_password = $http_password; } $val = explode(",", $val); $json_data = json_encode($val); echo $mtaSDK->do_post_request($host, $port, "/" . $resource . "/call/" . $function, $json_data); } catch (Exception $e) { @header("HTTP/1.0 500 Internal Server Error"); echo $e->getMessage(); }
<?php /* Project: SourceMode Version: 1.0 Last Edited: 26/10/2014 (Jack) Authors: Jack */ include "mta_sdk.php"; //Make sure you put this in the same directory of your recovery.php file. $input = mta::getInput(); //Get the input from the server $username = $input[0]; $email = $input[1]; $newPass = $input[2]; if ($username && $email && $newPass) { mail($email, "SourceMode: Password Recovery", "Dear " + $username + ",\nAccording to our system, you have requested a password recovery. Below you'll find your new login details.\n\nUsername: "******"\nPassword: "******"\n\nPlease change your password information when you log in to prevent anyone guessing the new pass and gaining access.\nSourceMode."); mta::doReturn(true); //Return true to the script to display "Sent" on the GUI return true; } else { mta::doReturn(false); //ERROR! return false; }
if (isset($r['_c'])) { $res[] = ary2xml($r['_c'], $d + 1); } elseif (isset($r['_v'])) { $res[] = $r['_v']; } $res[] = (isset($r['_c']) ? $sp : '') . "</{$tag}>\n"; } } return implode('', $res); } // Insert element into array function ins2ary(&$ary, $element, $pos) { $ar1 = array_slice($ary, 0, $pos); $ar1[] = $element; $ary = array_merge($ar1, array_slice($ary, $pos)); } $html = file_get_contents("http://san.mta.vg/blog/feed/"); $rss = xml2ary($html); $items = $rss["rss"]["_c"]["channel"]["_c"]["item"]; $array = array(); foreach ($items as $article) { $item["title"] = utf8_decode($article["_c"]["title"]["_v"]); $item["url"] = $article["_c"]["link"]["_v"]; $item["autor"] = $article["_c"]["dc:creator"]["_v"]; $item["date"] = date("F j, Y", strtotime($article["_c"]["pubDate"]["_v"])); $array[] = $item; } //print_r($array); mta::doReturn($array);
<?php require_once "mta_sdk.php"; require_once "mysql_init.php"; $input = mta::getInput(); $playerCount = $input[0]; mysqli_query($handler, "UPDATE `your_stat_table` SET `value` = '" . $playerCount . "' WHERE `key` = '1'"); mta::doReturn(true);