• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior AAC 0.3.8] Show / Hide Function.

Knight God

Member
Joined
Oct 19, 2008
Messages
1,180
Reaction score
21
Well as the title says, I wonder if I can help make my Character Deads and Quests have the function Show / Hide, I searched but still do not understand how to modify the scripts, if I can help?,
and if they can give me a script that displays the killings made ​​by the player, justified and unjustified with the function Show / Hide too.
all in characters.

Quest on characters.php:
PHP:
            //New Quest status// 
            $id = $player->getCustomField("id"); 
            $number_of_quests = 0; 
            $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=2 CLASS=white><B>Quests</B></TD></TD align="right"></TD></TR>';         
        $questCount = 0; 
        foreach ($config["site"]["quests"] as $questName => $questData) { 
            $backgroundColor = is_int($questCount / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"]; 
            $questCount   = $questCount + 1; $questStatus = $SQL->query("SELECT * FROM `player_storage` WHERE `player_id` = ".$id." AND `key` = ".$questData["storageid"].";")->fetch(); 
            $questPercent = (($questStatus["value"] - $questData["startvalue"])/$questData["endvalue"]) * 100; 
            $main_content         .= "<tr bgcolor=\"".$backgroundColor."\"><td width=\"55%\">".$questName."</td><td width=\"45%\" style=\"text-align:center;\">".$questPercent."%<div style=\"background-color:white; margin-top:-14px; width: 100%; height: 12px; border: 1px solid #DDD;\"><div style=\"background: green; width: ".$questPercent."%; height: 12px;\"></div></div></td></tr>";         
        } 
        //New Quest status//

please help me
i thanks you in advance
 
PHP:
	//New Quest status//  
	$id = $player->getCustomField("id");
	$main_content .= '
	<script language="javascript">
	function showMenu(f)
	{
		if(f){visi="block";} else{visi="none";}
		if(document.getElementById){document.getElementById("menu").style.display=visi;}
	}
	</script> 

	<center><input type="button" onclick="showMenu(1)" value="Show Quests" style="width: 100px">
	<input type="button" onclick="showMenu(0)" value="Hide Quests" style="width: 100px"><br><br></center>
	<table id="menu" border="0" cellspacing="1" cellpadding="4" width="100%">
		<tr bgcolor='.$config['site']['vdarkborder'].'>
			<td class="white"><b>Quests</b></td><td class="white"><b>&nbsp;</b></td>
		</tr>';
		foreach($config['site']['quests'] as $questName => $questData)
		{  
			$n++;
			$questStatus = $SQL->query('SELECT * FROM `player_storage` WHERE `player_id` = '.$id.' AND `key` = '.$questData['storageid'].' LIMIT 1')->fetch();  
			$questPercent = (($questStatus['value'] - $questData['startvalue']) / $questData['endvalue']) * 100;  
			$main_content .= '
				<tr class='.(is_int($n/2) ? 'Odd' : 'Even').'>
					<td width="55%">'.$questName.'</td>
					<td width="45%" style="text-align:center;">'.$questPercent.'%<div style="background-color:white; margin-top:-14px; width: 100%; height: 12px; border: 1px solid #DDD;"><div style="background: green; width: '.$questPercent.'%; height: 12px;"></div></div></td>
				</tr>';          
		} 
	$main_content .= '</table>';
	//New Quest status//
 
Last edited:
perfect, you can help me with Character Deads have the function Show / Hide?
i added rep

and is possible add Character Kills, shows kills justified and unjustified of the player?
-------------
You must spread some Reputation around before giving it to VirrageS again.
 
Last edited:
PHP:
if(!$players_deaths_count == 0) 
{ 
    $main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Character Deaths</B></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%>'.$players_rows.'</TABLE>'; 
}

to:
PHP:
if(!$players_deaths_count == 0) 
{ 
    $main_content .= '
	<script language="javascript">
    function showMenu1(f)
    {
        if(f){visi="block";} else{visi="none";}
        if(document.getElementById){document.getElementById("menu1").style.display=visi;}
    }
    </script> 

    <center><input type="button" onclick="showMenu1(1)" value="Show Deaths" style="width: 100px">
    <input type="button" onclick="showMenu1(0)" value="Hide Deaths" style="width: 100px"><br><br></center>
    <table id="menu1" border="0" cellspacing="1" cellpadding="4" width="100%">
		<TR bgcolor="'.$config['site']['vdarkborder'].'"><td class="white"><b>Character Deaths</b></td></tr>
		'.$players_rows.'
	</table>'; 
}




And character kill (paste where ever you want to):
PHP:
				$player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$config['site']['limitVictims'].';');
				if(count($player_frags))
				{
					$frags = 0;
					foreach($player_frags as $frag)
					{
						$frags++;
						if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
						$number_of_rows++;
						$frag_add_content .= '<tr bgcolor='.$bgcolor.'>
							<td width=25% align=left>'.date("d.m.Y, H:i:s", $frag['date']).'</td>
							<td>'.(($player->getSex() == 0) ? 'She' : 'He').' fragged <a href=index.php?subtopic=characters&name='.$frag[name].'>'.$frag[name].'</a> at level '.$frag[level].'';
						$frag_add_content .= ' ('.(($frag['unjustified'] == 0) ? '<font size=2 color=green>Justified</font>' : '<font size=2 color=red>Unjustified</font>').').</td></tr>';
					}
					if($frags >= 1)
						$main_content .= '<br><table BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td>Victims</td><td>Frags: </td></tr>'.$frag_add_content.'</table>';
				}


Not sure that it will work.
 
in character killers script

Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' in C:\xampp\htdocs\characters.php:349 Stack trace: #0 C:\xampp\htdocs\characters.php(349): PDO->query('SELECT `player_...') #1 C:\xampp\htdocs\index.php(99): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\characters.php on line 349
 

Similar threads

Back
Top