• 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!

[Modern Acc] Customize Health and Mana in Character View

nardosky

iTibia Online
Joined
Jul 17, 2007
Messages
43
Reaction score
8
Location
Iquieu
Well I wanted to show the work I did in seeing characters | made by me

going to System / application / view
open View_character.php

where
Code:
try {$ created = $ player-> getCreated ();} catch (Exception $ e) {$ created = time () -36000;}

add this:
Code:
$ hp = ($ player-> getHealth () / $ player-> getHealthMax () * 100);
$ mana = ($ player-> getMana () / $ player-> getManaMax () * 100);

and then find it

Code:
<td bgcolor="#D4C0A1" width='30%'> Created </ td> <td bgcolor="#D4C0A1"> <? php echo ago ($ created). "|". UNIX_TIMESTAMP ($ created );?> </ td> </ tr>

add this

Code:
<td bgcolor="#F1E0C6" width='30%'> Player Health </ td> <td bgcolor="#F1E0C6"> <? php echo $ player-> getHealth ();?> / <? php echo $ player-> getHealthMax ();?> 50%; height: <div> 3px; border: 1px solid #000;"> <div style = "background: red; width: <? PHP miss "". $ hp. "%"?>; height: 3px "> </ td> </ tr>
<td bgcolor="#D4C0A1" width='30%'> Player Mana </ td> <td bgcolor="#D4C0A1"> <? php echo $ player-> getMana ();?> / <? php echo $ player-> getManaMax ();?> 50%; height: <div> 3px; border: 1px solid #000;"> <div style = "background: blue; width: <? PHP miss "". $ mana. "%"?>; height: 3px "> </ td> </ tr>

MUST BE AS
Code:
<td bgcolor="#D4C0A1" width='30%'> Created </ td> <td bgcolor="#D4C0A1"> <? php echo ago ($ created). "|". UNIX_TIMESTAMP ($ created );?> </ td> </ tr>
<td bgcolor="#F1E0C6" width='30%'> Player Health </ td> <td bgcolor="#F1E0C6"> <? php echo $ player-> getHealth ();?> / <? php echo $ player-> getHealthMax ();?> 50%; height: <div> 3px; border: 1px solid #000;"> <div style = "background: red; width: <? PHP miss "". $ hp. "%"?>; height: 3px "> </ td> </ tr>
<td bgcolor="#D4C0A1" width='30%'> Player Mana </ td> <td bgcolor="#D4C0A1"> <? php echo $ player-> getMana ();?> / <? php echo $ player-> getManaMax ();?> 50%; height: <div> 3px; border: 1px solid #000;"> <div style = "background: blue; width: <? PHP miss "". $ mana. "%"?>; height: 3px "> </ td> </ tr>
and ready

Demo: ASDASDAADDAS.png
 
Helped a guy because it didn't work, here's the fix.
PHP:
<?php
	list($health, $maxHealth, $mana, $maxMana) = array(
		$player->getHealth(),
		$player->getHealthMax(),
		$player->getMana(),
		$player->getManaMax()
	);

	$healthPercent = (int)(($health / $maxHealth) * 100);
	$manaPercent   = (int)(($mana / $maxMana) * 100);
?>
	<tr>
		<td bgcolor="#F1E0C6" width='30%'>Player Health </td>
		<td bgcolor="#F1E0C6">
			<?php echo $health, '/', $maxHealth;?>
			<div style="background:red; width:<?php echo $healthPercent, '%';?>; height:3px"></div>
		</td>
	</tr>
	<tr>
		<td bgcolor="#D4C0A1" width='30%'>Player Mana </td>
		<td bgcolor="#D4C0A1">
			<?php echo $mana, '/', $maxMana;?>
			<div style="background: blue; width:<?php echo $manaPercent, '%';?>; height:3px"></div>
		</td>
	</tr>
 
Forgot black borders

PHP:
<?php
	list($health, $maxHealth, $mana, $maxMana) = array(
		$player->getHealth(),
		$player->getHealthMax(),
		$player->getMana(),
		$player->getManaMax()
	);

	$healthPercent = (int)(($health / $maxHealth) * 100);
	$manaPercent   = (int)(($mana / $maxMana) * 100);
?>
	<tr>
		<td bgcolor="#F1E0C6" width='30%'>Player Health </td>
		<td bgcolor="#F1E0C6">
			<?php echo $health, '/', $maxHealth;?>
			<div style="background:red; width:<?php echo $healthPercent, '%';?>; height:3px;border: 1px solid #000;"></div>
		</td>
	</tr>
	<tr>
		<td bgcolor="#D4C0A1" width='30%'>Player Mana </td>
		<td bgcolor="#D4C0A1">
			<?php echo $mana, '/', $maxMana;?>
			<div style="background: blue; width:<?php echo $manaPercent, '%';?>; height:3px;border: 1px solid #000;"></div>
		</td>
	</tr>
 
Back
Top