Ir para conteúdo

Mostra Player Hp + Mana + Um Monte De Coisa


Zorzin

Posts Recomendados

Oi galera.. vou falar um script que o Rizz fez.. Num tive tempo de testar ainda.. mas na hora que eu voltar da aula vou testar ^^

-----------------------------

Zorzin, o que esse script faz?

É o seguinte.. com ele vc pode ver a Exp, Lvl, hp, mp, max mp, max e hp dos chars que tem no seu server.. Para fazer, siga as orientações:

-----------------------------

1. Criem um arquivo qualquer .php

Por exemplo: algumacoisa.php

2. Ai, abram o arquivo com o bloco de notas e colocam isso:

 

<? // Exp, Lvl, hp, mp, max mp, max hp in Image Formate.  //100% Done by Rizz  // Version 3.2.2.8 if (($_GET['name']) or $_REQUEST['name'])  { $name = $_GET['name']; $name = $_REQUEST['name']; $folderplayer = "D:\\DevLand\\Server\\data\\players\\$name.xml"; if(file_exists($folderplayer)) { $iWidth = 500; $iHeight = 150; $myImage = imagecreate($iWidth, $iHeight); $white = imagecolorallocate($myImage, 255, 255, 255); $black = imagecolorallocate($myImage, 0, 0, 0); $red = imagecolorallocate($myImage, 255, 0, 0); $green = imagecolorallocate($myImage, 0, 255, 0); $blue = imagecolorallocate($myImage, 0, 0, 255); $playerXML = simplexml_load_string(file_get_contents($folderplayer)); $health = $playerXML->health['now']; $healthmax = $playerXML->health['max']; $mana = $playerXML->mana['now']; $manamax = $playerXML->mana['max']; $lvl = $playerXML['level']; $exp = $playerXML['exp']; imagerectangle($myImage, 0, 0 , $iWidth - 1, $iHeight - 101, $black); $threshold = intval((($healthmax - $health) / $healthmax) * ($iWidth-2)) + 1; imagefilledrectangle($myImage, 1, 1, ($iWidth-2), ($iHeight-102), $red); imagefilledrectangle($myImage, 1, 1, ($iWidth - $threshold), ($iHeight-102), $green); imagerectangle($myImage, 0, 0 , $iWidth - 1, $iHeight - 51, $black); $threshold = intval((($manamax - $mana) / $manamax) * ($iWidth-2)) + 1; imagefilledrectangle($myImage, 1, 50, ($iWidth-2), ($iHeight-52), $red); imagefilledrectangle($myImage, 1, 50, ($iWidth - $threshold), ($iHeight-52), $green); imagerectangle($myImage, 0, 0 , $iWidth - 1, $iHeight - 1, $black); $threshold = intval((($exp - $lvl) / $exp) * ($iWidth-2)) + 1; imagefilledrectangle($myImage, 1, 100, ($iWidth-2), ($iHeight-2), $red); imagefilledrectangle($myImage, 1, 100, ($iWidth - $threshold), ($iHeight-2), $green); imagefttext($myImage, 20, 0 ,410 , 45, $blue, "C:\Windows\fonts\arial.ttf", "$healthmax"); imagefttext($myImage, 20, 0 ,310 , 45, $blue, "C:\Windows\fonts\arial.ttf", "Max Hp:"); imagefttext($myImage, 20, 0 ,150 , 45, $blue, "C:\Windows\fonts\arial.ttf", "$health"); imagefttext($myImage, 20, 0 ,10 , 45, $blue, "C:\Windows\fonts\arial.ttf", "Current Hp:"); imagefttext($myImage, 20, 0 ,10 , 145, $blue, "C:\Windows\fonts\arial.ttf", "Level:"); imagefttext($myImage, 20, 0 ,80 , 145, $blue, "C:\Windows\fonts\arial.ttf", "$lvl"); imagefttext($myImage, 20, 0 ,310 , 145, $blue, "C:\Windows\fonts\arial.ttf", "Exp:"); imagefttext($myImage, 20, 0 ,360 , 145, $blue, "C:\Windows\fonts\arial.ttf", "$exp"); imagefttext($myImage, 20, 0 ,410 , 95, $blue, "C:\Windows\fonts\arial.ttf", "$manamax"); imagefttext($myImage, 20, 0 ,310 , 95, $blue, "C:\Windows\fonts\arial.ttf", "Max Mp:"); imagefttext($myImage, 20, 0 ,150 , 95, $blue, "C:\Windows\fonts\arial.ttf", "$mana"); imagefttext($myImage, 20, 0 ,10 , 95, $blue, "C:\Windows\fonts\arial.ttf", "Current Mp:"); header("Content-type: image/png"); imagepng($myImage); imagedestroy($myImage); } else { echo "Character does not exists"; } } ?> <form method="GET" action="<?=$PHP_SELF?>">  <p><font face="Arial Black">Character Name:    </font>  <input type="text" name="name">  <input type="submit" value="Show Hp and Mp">  </p> </form> <font size="2"> © by Rizz 2006 Version : 3.2.2.8 </font>

 

3. depois não se esquece de trocar isso:

$folderplayer = "D:\\DevLand\\Server\\data\\players\\$name.xml";

pela pasta do seu ot..

Zorzin

Link para o comentário
Compartilhar em outros sites

  • 1 year later...
×
×
  • Criar Novo...