mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-15 00:56:09 +00:00
Add 4 tribes for addUser Admin CP
Add 4 tribes for addUser Admin CP
This commit is contained in:
@@ -42,7 +42,7 @@ if(isset($_GET['e'])) {
|
||||
}
|
||||
elseif(isset($_GET['g']) && $_GET['g']=='OK'){
|
||||
$baseName = $_GET['bn']; $mode = $_GET['mo']; $skipped=(int)$_GET['sk']; $bp=(int)$_GET['bp'];
|
||||
$tribe = [0=>RANDOM,1=>TRIBE1,2=>TRIBE2,3=>TRIBE3][$_GET['tr']]??'Unknown';
|
||||
$tribe = [0=>RANDOM,1=>TRIBE1,2=>TRIBE2,3=>TRIBE3,6=>TRIBE6,7=>TRIBE7,8=>TRIBE8,9=>TRIBE9][$_GET['tr']]??'Unknown';
|
||||
|
||||
if($mode==='many_accounts'){
|
||||
$amount=(int)$_GET['am'];
|
||||
@@ -149,6 +149,10 @@ elseif(isset($_GET['g']) && $_GET['g']=='OK'){
|
||||
<label><input type="radio" name="tribe" value="1"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE1;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="2"><span class="tribe-icon">🪓</span><span class="tribe-text"><?php echo TRIBE2;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="3"><span class="tribe-icon">🌾</span><span class="tribe-text"><?php echo TRIBE3;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="6"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE6;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="7"><span class="tribe-icon">🪓</span><span class="tribe-text"><?php echo TRIBE7;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="8"><span class="tribe-icon">🌾</span><span class="tribe-text"><?php echo TRIBE8;?></span></label>
|
||||
<label><input type="radio" name="tribe" value="9"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE9;?></span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -69,8 +69,19 @@ if (strlen($baseName) > 20) {
|
||||
|
||||
// convenience closure: pick tribe once (for a user)
|
||||
$chooseTribe = function(int $postTribe) {
|
||||
if ($postTribe === 0) return rand(1,3);
|
||||
return max(1, min(3, $postTribe));
|
||||
|
||||
// Random doar triburile jucabile
|
||||
if ($postTribe === 0) {
|
||||
$tribes = [1,2,3,6,7,8,9];
|
||||
return $tribes[array_rand($tribes)];
|
||||
}
|
||||
|
||||
// Permite doar triburile jucabile
|
||||
if (!in_array($postTribe, [1,2,3,6,7,8,9])) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return $postTribe;
|
||||
};
|
||||
|
||||
/* ===================== FIX UNIT BUG ===================== */
|
||||
|
||||
Reference in New Issue
Block a user