Файл: system/mobhp.php
Строк: 25
<?php
// Подключаемся к БД
$dbhost="localhost";
$dbname="db1355926987";
$dbuser="db1355926987";
$dbpass="overlord";
$lin=mysql_connect($dbhost,$dbuser,$dbpass) or die("Не могу подключиться к серверу БД");
mysql_select_db($dbname,$lin) or die("Не могу подключиться к БД");
mysql_query("SET NAMES utf8");
mysql_query("set character_set_client='utf8'");
mysql_query("set character_set_results='utf8'");
mysql_query("set collation_connection='utf8'");
$as = mysql_query("SELECT * FROM `bishopl2_monstr` WHERE `id`='$id'");
$mobs = mysql_fetch_array($as);
$max = $mobs[maxhp];
$now = $mobs[mhp];
$health = 150 / ($max / $now);
header('Content-Type: image/gif');
$img = imagecreatetruecolor(150, 2);
imagecolorallocate($img, 0, 0, 0);
$red = imagecolorallocate($img, 225, 0, 0);
$white = imagecolorallocate($img, 205, 133, 63);
imagefilledpolygon($img, array(0,0, 0,10, $health,10, $health,0), 4, $red);
$fon = imagecolorallocate($img, 255, 0, 0);
imagestring($img, 1, 40, 2, "HP: ".number_format($now)." | ".number_format($max)."", $white);
imagepolygon($img, array(0,0, 0,12, 0,12, 0,0), 4, $fon);
imagegif($img);
?>SET NAMES utf8