mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-23 11:37:14 +00:00
feat: Admins can be attacked, raided and traded with via config option
This commit is contained in:
@@ -14,7 +14,7 @@ var carry = <?php echo $market->maxcarry; ?>;
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
$allres = $_POST['r1']+$_POST['r2']+$_POST['r3']+$_POST['r4'];
|
||||
$allres = (int) $_POST['r1'] + (int) $_POST['r2'] + (int) $_POST['r3'] + (int) $_POST['r4'];
|
||||
if($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
|
||||
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
|
||||
$checkexist = $database->checkVilExist($getwref);
|
||||
@@ -29,7 +29,7 @@ $userAccess = $database->getUserField($villageOwner,'access',0);
|
||||
}
|
||||
$maxcarry = $market->maxcarry;
|
||||
$maxcarry *= $market->merchantAvail();
|
||||
if(isset($_POST['ft'])=='check' && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist && $userAccess == 2){
|
||||
if(isset($_POST['ft'])=='check' && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist && ($userAccess == 2 || (ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == 9))){
|
||||
?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="ft" value="mk1">
|
||||
@@ -213,7 +213,7 @@ if(isset($_POST['ft'])=='check'){
|
||||
$error = '<span class="error"><b>'.NO_COORDINATES_SELECTED.'</b></span>';
|
||||
}elseif($getwref == $village->wid){
|
||||
$error = '<span class="error"><b>'.CANNOT_SEND_RESOURCES.'</b></span>';
|
||||
}elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
|
||||
}elseif($userAccess == '0' or $userAccess == '8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == '9')){
|
||||
$error = '<span class="error"><b>'.BANNED_CANNOT_SEND_RESOURCES.'.</b></span>';
|
||||
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
|
||||
$error = '<span class="error"><b>'.RESOURCES_NO_SELECTED.'.</b></span>';
|
||||
|
||||
@@ -515,7 +515,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
|
||||
if($data2['access']=='0' or $data2['access']=='8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $data2['access']=='9')) {
|
||||
echo "» ".SENDTROOP." (".BAN.")";
|
||||
} else if($data2['vac_mode']=='1') {
|
||||
echo "» Send troops. (Vacation mode on)";
|
||||
@@ -530,7 +530,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
<tr>
|
||||
<td class="none">
|
||||
<?php
|
||||
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
|
||||
if($data2['access']=='0' or $data2['access']=='8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $data2['access']=='9')) {
|
||||
echo "» ".SENDMERC." (".BAN.")";
|
||||
} else if($data2['vac_mode']=='1') {
|
||||
echo "» Send merchant(s). (Vacation mode on)";
|
||||
|
||||
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
|
||||
<td> </td>
|
||||
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr></thead><tbody><tr>
|
||||
<th>Resources</th>
|
||||
<td>
|
||||
|
||||
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
|
||||
<td> </td>
|
||||
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr></thead><tbody><tr>
|
||||
<th>Resources</th>
|
||||
<td>
|
||||
|
||||
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
|
||||
<td> </td>
|
||||
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr></thead><tbody><tr>
|
||||
<th>Resources</th>
|
||||
<td>
|
||||
|
||||
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
|
||||
<td> </td>
|
||||
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr></thead><tbody><tr>
|
||||
<th>Resources</th>
|
||||
<td>
|
||||
|
||||
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
|
||||
<td> </td>
|
||||
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr></thead><tbody><tr>
|
||||
<th>Resources</th>
|
||||
<td>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
$t11 = 0;
|
||||
$villageOwner = $database->getVillageField($wref,'owner');
|
||||
$userAccess = $database->getUserField($villageOwner,'access',0);
|
||||
if($userAccess != '0' && $userAccess != '8' && $userAccess != '9'){
|
||||
if($userAccess != '0' && $userAccess != '8' && ($userAccess != '9' || (ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == '9'))){
|
||||
if($tribe == 1){ $uname = "u"; } elseif($tribe == 2){ $uname = "u1"; } elseif($tribe == 3){ $uname = "u2"; }elseif($tribe == 4){ $uname = "u3"; }else {$uname = "u4"; }
|
||||
if($tribe == 1){ $uname1 = "u1"; } elseif($tribe == 2){ $uname1 = "u2"; } elseif($tribe == 3){ $uname1 = "u3"; }elseif($tribe == 4){ $uname1 = "u4"; }else {$uname1 = "u5"; }
|
||||
if($tribe == 1){ $uname2 = ""; } elseif($tribe == 2){ $uname2 = "1"; } elseif($tribe == 3){ $uname2 = "2"; }elseif($tribe == 4){ $uname2 = "3"; }else {$uname2 = "4"; }
|
||||
|
||||
Reference in New Issue
Block a user