• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Finish troops train full script for travianz v8.3.4

Newbie Spellweaver
Joined
Sep 21, 2018
Messages
17
Reaction score
0
Hello friends of ragezone today I come with a script that I modified due to the need to implement the function of finishing troops instantly from the plus zone or in the menu.tpl, this script I took it from a web where also there are developers of travianz, well let's go to the point, the thing is like this, this script supposedly serves to finish the troops in the village but the problem is that it does not work because it does not deduce the 25 golds that have to be paid and does not end the training of troops in the barracks, so I ask if someone with a good knowledge of structures of travianz clone could help me finish this script so that we can all use it, this script came in German and I translated it into English to make it more understandable, I clarify that I have opened this thread for the reason that none of the scripts of more functions in the plus zone serves in the version TravianZ v8.3.4, please if someone could help me with this code they I would be very grateful °, I await your answers!

This code script have one problem whem is used in php version 5.6 show message saying
[h=2]No database selected[/h]
but whem im used php version 7 dont show me error!

PHP:
<?phpinclude("GameEngine/Village.php");$start = $generator->pageLoadTimeStart();if(isset($_GET['newdid'])) {    $_SESSION['wid'] = $_GET['newdid'];    header("Location: ".$_SERVER['PHP_SELF']);}else {    $building->procBuild($_GET);}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title><?php echo SERVER_NAME ?></title><link REL="shortcut icon" HREF="favicon.ico"/><meta http-equiv="cache-control" content="max-age=0" /><meta http-equiv="pragma" content="no-cache" /><meta http-equiv="expires" content="0" /><meta http-equiv="imagetoolbar" content="no" /><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><script src="mt-full.js?0faaa" type="text/javascript"></script><script src="unx.js?0faaa" type="text/javascript"></script><script src="new.js?0faaa" type="text/javascript"></script><link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel="stylesheet" type="text/css" /><link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel="stylesheet" type="text/css" /><?phpif($session->gpack == null || GP_ENABLE == false) {echo "<link href='".GP_LOCATE."travian.css?e21d2' rel='stylesheet' type='text/css' /><link href='".GP_LOCATE."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";} else {echo "<link href='".$session->gpack."travian.css?e21d2' rel='stylesheet' type='text/css' /><link href='".$session->gpack."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";}?><script type="text/javascript">window.addEvent('domready', start);</script></head><body class="v35 ie ie8"><div class="wrapper"><img style="filter: chroma();" src="img/x.gif" id="msfilter" alt=""><div id="dynamic_header"></div><?php include("Templates/header.tpl"); ?><div id="mid"><?php include("Templates/menu.tpl"); ?><div id="content"  class="village2"><h2 align="center"><table id="member">   <thead>    <tr>        <th>End troop training of this village immediately</th>    </tr></thead><form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <table border="0"><tr><td>Your Player ID:</td><td><input type="text" name="username" maxlength="60" disabled="disabled" value="<?php echo $session->uid; ?>"></td></tr><tr><td>Your Village With The Trainees:</td><td><input type="text" name="village" maxlength="60" disabled="disabled" value="<?php $dorfname = $village->wid;$dorfname2 = str_replace("3856", "Castellum II", $dorfname);$dorfname2 = str_replace("29300", "Castellum", $dorfname2);$dorfname2 = str_replace("90269", "Horus 5", $dorfname2);$dorfname2 = str_replace("81457", "Maxima", $dorfname2);$dorfname2 = str_replace("10699", "Novaesium", $dorfname2);$dorfname2 = str_replace("89631", "Horus 2", $dorfname2);$dorfname2 = str_replace("88662", "Maxima II", $dorfname2);$dorfname2 = str_replace("1786", "Castellum III", $dorfname2);echo $dorfname2; ?>"></td></tr><tr><td>Cost of Immediate Training:</td><td><input type="text" name="username" maxlength="60" disabled="disable" value="25 Gold"></td></tr><tr><td colspan="2" align="center"> <center><input type="submit" name="submit" value="Click Here to Finish Training"></center> </small></td></tr> </table> </form><table id="member">   <thead>    <tr>        <th>Information</th>    </tr></thead><tr><td style="text-align:justify">Hello dear friend, the best way to win the most important war in your life is training the best military weapon, for this you need many trained troops as soon as possible, because in TravianForce we have the solution to your problems, you only need to buy this package that makes your troops train immediately for a comfortable price of 25 gold each time you use it, thank you very much and we hope you enjoy your battles, The TravianForce team!A tactical advantage that should not be ignored.<br><small style="font-weight: bold;">A tacticalAdvantage that should not be ignored. </small></td></tr></table> <?phperror_reporting (E_ALL ^ E_NOTICE);include ("extra_mysql.php");if (isset($_POST['submit'])) { // if form has been submitted// checks it against the database$check = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id  = '".$session->uid."'")or die(mysql_error());//Gives error if user dosen't exist$check2 = mysql_num_rows($check);if ($check2 == 0) {die('Your identity number or village ID is wrong. <a href=dorf1.php>Back to the village</a>');}//Gives error if user dosen't exist$check2 = mysql_num_rows($check);if ($check2 == 0) {die('Your identity number or village ID is wrong. <a href=dorf1.php>Back to the village</a>');}                    $sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id  = '".$session->uid."'")or die(mysql_error());while($row = mysql_fetch_array($sql)){};$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id  = '".$session->uid."'")or die(mysql_error());while($row = mysql_fetch_array($sql)){$gold = $row["gold"];};if ($gold < 25 ) {die('You have too little gold for this project');}else {mysql_query("UPDATE ".TB_PREFIX."users SET `gold` = `gold`- 25 WHERE id ='".$session->uid."'")or die(mysql_error()); mysql_query("UPDATE ".TB_PREFIX."training SET `timestamp2` = 0 WHERE vref ='".$village->wid."'")or die(mysql_error());echo "<p align=\"center\">All troop training of this village was successfully completed.</p>";}}?><br></div><div id="side_info"><?phpinclude("Templates/quest.tpl");include("Templates/multivillage.tpl");include("Templates/news.tpl");include("Templates/links.tpl");?></div><div class="clear"></div></div><div class="footer-stopper"></div><div class="clear"></div><?phpinclude("Templates/res.tpl");include("Templates/footer.tpl"); ?><div id="stime"><div id="ltime"><div id="ltimeWrap">Seitenaufbau in <b><?phpecho round(($generator->pageLoadTimeEnd()-$start)*1000);?></b> ms<br />Serverzeit: <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span></div></div></div><div id="ce"></html>

INSTALLATION:


1. Upload finishtroops.php and extra_mysql.php to the root of your server, change the 3.tpl of templates/plus/3.tpl
 

Attachments

You must be registered for see attachments list
Last edited:
Back
Top