Файл: stamina.php
Строк: 41
<?php
$max = $_GET['max'];
if($max <= 0) $max = 1;
$min = $_GET['min'];
if($min <= 0) $min = 1;
$progress = round(100/($max/$min));
header('Content-Type: image/gif');
switch($_GET['type']){
case 'hp':
$full = imagecreatefromgif('img/stamina/hp_full.gif');
$null = imagecreatefromgif('img/stamina/hp_null.gif');
imagecopy($full, $null, $progress, 0, 0, 0, 100, 10);
$color = imagecolorallocate($full, 245, 245, 245);
imagestring($full, 1, 5, 1, "HP $min/$max", $color);
break;
case 'mp':
$full = imagecreatefromgif('img/stamina/mp_full.gif');
$null = imagecreatefromgif('img/stamina/mp_null.gif');
imagecopy($full, $null, $progress, 0, 0, 0, 100, 10);
$color = imagecolorallocate($full, 245, 245, 245);
imagestring($full, 1, 5, 1, "MP $min/$max", $color);
break;
case 'exp':
$full = imagecreatefromgif('img/stamina/exp_full.gif');
$null = imagecreatefromgif('img/stamina/exp_null.gif');
imagecopy($full, $null, $progress, 0, 0, 0, 100, 10);
$color = imagecolorallocate($full, 245, 245, 245);
imagestring($full, 1, 5, 1, "EXP $progress%", $color);
break;
case 'cp':
$full = imagecreatefromgif('data/img/stamina/cp_full.gif');
$null = imagecreatefromgif('data/img/stamina/cp_null.gif');
imagecopy($full, $null, $progress, 0, 0, 0, 100, 10);
$color = imagecolorallocate($full, 245, 245, 245);
imagestring($full, 1, 5, 1, "CP $now/$max", $color);
break;
case 'vp':
$full = imagecreatefromgif('data/img/stamina/vp_full.gif');
$null = imagecreatefromgif('data/img/stamina/vp_null.gif');
imagecopy($full, $null, $progress, 0, 0, 0, 100, 2);
break;
}
imagegif($full);
imagedestroy($full);
?>