<?php
/*
Created By Darkmagic
Please give proper credits when using this code since
it took me over a month to finish this code.
*/
header('Content-type: image/png');
$char = $_GET['char'];
if($char > 15)
die("Hacking Attempt Found!");
include('../config.php');
$sql = mysql_connect($sql_host, $sql_user, $sql_pass)or die("Error on trying to connect in MySQL: " . mysql_error());
mysql_select_db($sql_db)or die("Error on trying to connect in Database");
$result = mysql_query("SELECT id, skincolor, hair, face FROM characters WHERE name='".$char."'")
or die(mysql_error());
$row = mysql_fetch_array( $result );
if(!$row)
die("Character not found");
$result2 = mysql_query("SELECT itemid, position FROM inventoryitems WHERE characterid='".$row['id']."' AND inventorytype = '-1' ORDER BY position DESC")
or die(mysql_error());
$skin = 2000 + $row['skincolor'];
$face = $row['face'];
$hair = $row['hair'];
while($row2 = mysql_fetch_array( $result2 ))
{
if($row2['position'] == -1 || $row2['position'] == -101)
if($row2['itemid'] != 1002186) //check invisble hat
$hat = $row2['itemid'];
else
$hat = '';
if($row2['position'] == -2 || $row2['position'] == -102)
$mask = $row2['itemid'];
if($row2['position'] == -3 || $row2['position'] == -103)
$eyes = $row2['itemid'];
if($row2['position'] == -4 || $row2['position'] == -104)
$ears = $row2['itemid'];
if($row2['position'] == -5 || $row2['position'] == -105)
$top = $row2['itemid'];
if($row2['position'] == -6 || $row2['position'] == -106)
$pants = $row2['itemid'];
if($row2['position'] == -7 || $row2['position'] == -107)
$shoe = $row2['itemid'];
if($row2['position'] == -8 || $row2['position'] == -108)
$glove = $row2['itemid'];
if($row2['position'] == -9 || $row2['position'] == -109)
$cape = $row2['itemid'];
if($row2['position'] == -10 || $row2['position'] == -110)
$shield = $row2['itemid'];
if($row2['position'] == -11)
$wep = $row2['itemid'];
if($row2['position'] == -111)
$nxwep = $row2['itemid'];
}
if(substr($top, 0, 3) == 105)
{
$overall = $top;
$top = "";
}
$mainx = 44;
$mainy = 34;
$wepnum = 0;
if($wep)
{
$wepType = substr($wep, 0, 3);
if($wepType >= 130 && $wepType <= 138)
{
$stand = 1;
}
elseif($wepType >= 140 && $wepType <= 144)
{
$stand = 2;
}
elseif($wepType == 145)
{
$stand = 1;
}
elseif($wepType == 146)
{
$stand = 2;
}
elseif($wepType == 147)
{
$stand = 1;
}
elseif($wepType == 170)
{
//check number
$found = 0;
$int=29;
while($int<=46 && !$found)
{
$int++;
$location = "Weapon/0".$wep.".img/".$int.".stand";
if(file_exists($location."2.0.weapon.png"))
{
$stand = 2;
$found = 1;
$wepnum = $int;
}
if(file_exists($location."1.0.weapon.png"))
{
$stand = 1;
$found = 1;
$wepnum = $int;
}
}
}
}
else
{
$stand = 1;
}
if($nxwep)
{
$wepnum = 0;
$wepType = substr($nxwep, 0, 3);
if($wepType == 170)
{
//check number
$found = 0;
$int=29;
while($int<=46 && !$found)
{
$int++;
$location = "Weapon/0".$nxwep.".img/".$int.".stand".$stand.".0.weapon.png";
if(file_exists($location))
{
$found = 1;
$wepnum = $int;
}
}
}
}
else
{
$nxwep = $wep;
}
$necky = $mainy+31;
$hairshade = $skin - 2000;
//create blank template
$im = imagecreatetruecolor(96,96);
imagesavealpha($im, true);
$trans=imagecolorallocatealpha($im, 0, 0, 0, 127);
imagefill($im, 0, 0, $trans);
//
//RECIEVE IMAGE DATA
//
$location = "Face/000".$face.".img/index.txt";
if(file_exists($location))
{
$facearray=txt_parse($location);
$facex=-$facearray[blink_0_face_origin_x]-$facearray[blink_0_face_map_brow_x];
$facey=-$facearray[blink_0_face_origin_y]-$facearray[blink_0_face_map_brow_y];
}
$location = "Hair/000".$hair.".img/index.txt";
if(file_exists($location))
{
$hairarray=txt_parse($location);
$backhairx=-$hairarray[default_hairBelowBody_origin_x]-$hairarray[default_hairBelowBody_map_brow_x];
$backhairy=-$hairarray[default_hairBelowBody_origin_y]-$hairarray[default_hairBelowBody_map_brow_y];
$shadehairx=-$hairarray[default_hairShade_0_origin_x]-$hairarray[default_hairShade_0_map_brow_x];
$shadehairy=-$hairarray[default_hairShade_0_origin_y]-$hairarray[default_hairShade_0_map_brow_y];
$hairx=-$hairarray[default_hair_origin_x]-$hairarray[default_hair_map_brow_x];
$hairy=-$hairarray[default_hair_origin_y]-$hairarray[default_hair_map_brow_y];
$overhairx=-$hairarray[default_hairOverHead_origin_x]-$hairarray[default_hairOverHead_map_brow_x];
$overhairy=-$hairarray[default_hairOverHead_origin_y]-$hairarray[default_hairOverHead_map_brow_y];
}
$location = "Accessory/0".$eyes.".img/index.txt";
if(file_exists($location))
{
$eyesarray=txt_parse($location);
$eyesx=-$eyesarray[default_default_origin_x]-$eyesarray[default_default_map_brow_x];
$eyesy=-$eyesarray[default_default_origin_y]-$eyesarray[default_default_map_brow_y];
}
$location = "Accessory/0".$mask.".img/index.txt";
if(file_exists($location))
{
$maskarray=txt_parse($location);
$maskz=$maskarray[default_default_z];
$maskx=-$maskarray[default_default_origin_x]-$maskarray[default_default_map_brow_x];
$masky=-$maskarray[default_default_origin_y]-$maskarray[default_default_map_brow_y];
}
$location = "Accessory/0".$ears.".img/index.txt";
if(file_exists($location))
{
$earsarray=txt_parse($location);
$earsx=-$earsarray[default_default_origin_x]-$earsarray[default_default_map_brow_x];
$earsy=-$earsarray[default_default_origin_y]-$earsarray[default_default_map_brow_y];
}
$location = "Cap/0".$hat.".img/index.txt";
if(file_exists($location))
{
$hatarray=txt_parse($location);
$hatx=-$hatarray[default_default_origin_x]-$hatarray[default_default_map_brow_x];
$haty=-$hatarray[default_default_origin_y]-$hatarray[default_default_map_brow_y];
$zhatx=-$hatarray[default_defaultAc_origin_x]-$hatarray[default_defaultAc_map_brow_x];
$zhaty=-$hatarray[default_defaultAc_origin_y]-$hatarray[default_defaultAc_map_brow_y];
$vslot=$hairarray[info_vslot];
}
$location = "Cape/0".$cape.".img/index.txt";
if(file_exists($location))
{
$capearray=txt_parse($location);
if($stand==2)
{
$cape2x=-$capearray[stand2_0_cape_origin_x]-$capearray[stand2_0_cape_map_navel_x];
$cape2y=-$capearray[stand2_0_cape_origin_y]-$capearray[stand2_0_cape_map_navel_y];
}
$capex=-$capearray[stand1_0_cape_origin_x]-$capearray[stand1_0_cape_map_navel_x];
$capey=-$capearray[stand1_0_cape_origin_y]-$capearray[stand1_0_cape_map_navel_y];
$capez=$capearray[stand1_0_cape_z];
$zcapex=-$capearray[stand2_0_capeArm_origin_x]-$capearray[stand2_0_capeArm_map_navel_x];
$zcapey=-$capearray[stand2_0_capeArm_origin_y]-$capearray[stand2_0_capeArm_map_navel_y];
}
$location = "Shield/0".$shield.".img/index.txt";
if(file_exists($location))
{
$shieldarray=txt_parse($location);
$shieldx=-$shieldarray[stand1_0_shield_origin_x]-$shieldarray[stand1_0_shield_map_navel_x];
$shieldy=-$shieldarray[stand1_0_shield_origin_y]-$shieldarray[stand1_0_shield_map_navel_y];
}
$location = "Shoes/0".$shoe.".img/index.txt";
if(file_exists($location))
{
$shoesarray=txt_parse($location);
$shoesx=-$shoesarray[stand1_0_shoes_origin_x]-$shoesarray[stand1_0_shoes_map_navel_x];
$shoesy=-$shoesarray[stand1_0_shoes_origin_y]-$shoesarray[stand1_0_shoes_map_navel_y];
}
$location = "Glove/0".$glove.".img/index.txt";
if(file_exists($location))
{
$glovearray=txt_parse($location);
$lglove1x=-$glovearray[stand1_0_lGlove_origin_x]-$glovearray[stand1_0_lGlove_map_navel_x];
$lglove1y=-$glovearray[stand1_0_lGlove_origin_y]-$glovearray[stand1_0_lGlove_map_navel_y];
$rglove1x=-$glovearray[stand1_0_rGlove_origin_x]-$glovearray[stand1_0_rGlove_map_navel_x];
$rglove1y=-$glovearray[stand1_0_rGlove_origin_y]-$glovearray[stand1_0_rGlove_map_navel_y];
$lglove2x=-$glovearray[stand2_0_lGlove_origin_x]-$glovearray[stand2_0_lGlove_map_navel_x];
$lglove2y=-$glovearray[stand2_0_lGlove_origin_y]-$glovearray[stand2_0_lGlove_map_navel_y];
$rglove2x=-$glovearray[stand2_0_rGlove_origin_x]-$glovearray[stand2_0_rGlove_map_navel_x];
$rglove2y=-$glovearray[stand2_0_rGlove_origin_y]-$glovearray[stand2_0_rGlove_map_navel_y];
}
$location = "Pants/0".$pants.".img/index.txt";
if(file_exists($location))
{
$pantsarray=txt_parse($location);
if($stand==2)
{
$pants2x=-$pantsarray[stand2_0_pants_origin_x]-$pantsarray[stand2_0_pants_map_navel_x];
$pants2y=-$pantsarray[stand2_0_pants_origin_y]-$pantsarray[stand2_0_pants_map_navel_y];
}
$pantsx=-$pantsarray[stand1_0_pants_origin_x]-$pantsarray[stand1_0_pants_map_navel_x];
$pantsy=-$pantsarray[stand1_0_pants_origin_y]-$pantsarray[stand1_0_pants_map_navel_y];
}
$location = "Coat/0".$top.".img/index.txt";
if(file_exists($location))
{
$mailarray=txt_parse($location);
if($stand==2)
{
$mail2x=-$mailarray[stand2_0_mail_origin_x]-$mailarray[stand2_0_mail_map_navel_x];
$mail2y=-$mailarray[stand2_0_mail_origin_y]-$mailarray[stand2_0_mail_map_navel_y];
$maila2x=-$mailarray[stand2_0_mailArm_origin_x]-$mailarray[stand2_0_mailArm_map_navel_x];
$maila2y=-$mailarray[stand2_0_mailArm_origin_y]-$mailarray[stand2_0_mailArm_map_navel_y];
}
$mailx=-$mailarray[stand1_0_mail_origin_x]-$mailarray[stand1_0_mail_map_navel_x];
$maily=-$mailarray[stand1_0_mail_origin_y]-$mailarray[stand1_0_mail_map_navel_y];
$mailax=-$mailarray[stand1_0_mailArm_origin_x]-$mailarray[stand1_0_mailArm_map_navel_x];
$mailay=-$mailarray[stand1_0_mailArm_origin_y]-$mailarray[stand1_0_mailArm_map_navel_y];
}
$location = "Longcoat/0".$overall.".img/index.txt";
if(file_exists($location))
{
$mailarray=txt_parse($location);
if($stand==2)
{
$mail2x=-$mailarray[stand2_0_mail_origin_x]-$mailarray[stand2_0_mail_map_navel_x];
$mail2y=-$mailarray[stand2_0_mail_origin_y]-$mailarray[stand2_0_mail_map_navel_y];
$maila2x=-$mailarray[stand2_0_mailArm_origin_x]-$mailarray[stand2_0_mailArm_map_navel_x];
$maila2y=-$mailarray[stand2_0_mailArm_origin_y]-$mailarray[stand2_0_mailArm_map_navel_y];
}
$mailx=-$mailarray[stand1_0_mail_origin_x]-$mailarray[stand1_0_mail_map_navel_x];
$maily=-$mailarray[stand1_0_mail_origin_y]-$mailarray[stand1_0_mail_map_navel_y];
$mailax=-$mailarray[stand1_0_mailArm_origin_x]-$mailarray[stand1_0_mailArm_map_navel_x];
$mailay=-$mailarray[stand1_0_mailArm_origin_y]-$mailarray[stand1_0_mailArm_map_navel_y];
}
$location = "Weapon/0".$nxwep.".img/index.txt";
if(file_exists($location))
{
$weaponarray=txt_parse($location);
$wepx = $mainx+12;
$wepy = $necky+6;
if($wepnum)
{
if($weaponarray[$wepnum.'_stand'.$stand.'_0_weapon_map_hand_x'] != NULL)
{
$position='hand';
}
else
{
$position='navel';
$wepx = $mainx;
$wepy = $necky;
}
$weaponz=$weaponarray[$wepnum.'_stand'.$stand.'_0_weapon_z'];
$weaponx=-$weaponarray[$wepnum.'_stand'.$stand.'_0_weapon_origin_x']-$weaponarray[$wepnum.'_stand'.$stand.'_0_weapon_map_'.$position.'_x'];
$weapony=-$weaponarray[$wepnum.'_stand'.$stand.'_0_weapon_origin_y']-$weaponarray[$wepnum.'_stand'.$stand.'_0_weapon_map_'.$position.'_y'];
}
else
{
if($weaponarray['stand'.$stand.'_0_weapon_map_hand_x'] != NULL)
{
$position='hand';
}
else
{
$position='navel';
$wepx = $mainx;
$wepy = $necky;
}
$weaponz=$weaponarray['stand'.$stand.'_0_weapon_z'];
$weaponx=-$weaponarray['stand'.$stand.'_0_weapon_origin_x']-$weaponarray['stand'.$stand.'_0_weapon_map_'.$position.'_x'];
$weapony=-$weaponarray['stand'.$stand.'_0_weapon_origin_y']-$weaponarray['stand'.$stand.'_0_weapon_map_'.$position.'_y'];
}
if($stand == 2 && $position == 'hand')
{
$wepx -= 7;
$wepy -= 7;
}
}
//
//CREATE IMAGE
//
//create weaponBelowBody
if($weaponz == 'weaponBelowBody')
{
if($wepnum)
{
$location = "Weapon/0".$nxwep.".img/".$wepnum.".stand".$stand.".0.weapon.png";
}
else
{
$location = "Weapon/0".$nxwep.".img/stand".$stand.".0.weapon.png";
}
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $wepx+$weaponx, $wepy+$weapony, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create top cap
$location = "Cap/0".$hat.".img/default.defaultAc.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$zhatx, $mainy+$zhaty, 0, 0, imagesx($implace), imagesy($implace));
}
//create back hair and cape
if($capez == 'capeBelowBody')
{
$location = "Hair/000".$hair.".img/default.hairBelowBody.png";
if(file_exists($location))
{
if(substr_count($vslot, 'H1H2H3H4H5H6') == 1){
}
else{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$backhairx, $mainy+$backhairy, 0, 0, imagesx($implace), imagesy($implace));
}
}
if(file_exists("Cape/0".$cape.".img/stand2.0.cape.png") && $stand == 2)
{
$implace = imagecreatefrompng ("Cape/0".$cape.".img/stand2.0.cape.png");
imagecopy($im, $implace, $mainx+$cape2x, $necky+$cape2y, 0, 0, imagesx($implace), imagesy($implace));
}
elseif(file_exists("Cape/0".$cape.".img/stand1.0.cape.png"))
{
$implace = imagecreatefrompng ("Cape/0".$cape.".img/stand1.0.cape.png");
imagecopy($im, $implace, $mainx+$capex, $necky+$capey, 0, 0, imagesx($implace), imagesy($implace));
}
}
else
{
if(file_exists("Cape/0".$cape.".img/stand2.0.cape.png") && $stand == 2)
{
$implace = imagecreatefrompng ("Cape/0".$cape.".img/stand2.0.cape.png");
imagecopy($im, $implace, $mainx+$cape2x, $necky+$cape2y, 0, 0, imagesx($implace), imagesy($implace));
}
elseif(file_exists("Cape/0".$cape.".img/stand1.0.cape.png"))
{
$implace = imagecreatefrompng ("Cape/0".$cape.".img/stand1.0.cape.png");
imagecopy($im, $implace, $mainx+$capex, $necky+$capey, 0, 0, imagesx($implace), imagesy($implace));
}
$location = "Hair/000".$hair.".img/default.hairBelowBody.png";
if(file_exists($location))
{
if(substr_count($vslot, 'H1H2H3H4H5H6') == 1){
}
else{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$backhairx, $mainy+$backhairy, 0, 0, imagesx($implace), imagesy($implace));
}
}
}
//create shield
$location = "Shield/0".$shield.".img/stand1.0.shield.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$shieldx, $necky+$shieldy, 0, 0, imagesx($implace), imagesy($implace));
}
//create body
$implace = imagecreatefrompng ("Skin/0000".$skin.".img/stand".$stand.".0.body.png");
imagecopy($im, $implace, ($mainx+$stand)-9, $mainy+21, 0, 0, imagesx($implace), imagesy($implace));
//create shoes
$location = "Shoes/0".$shoe.".img/stand1.0.shoes.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$shoesx, $necky+$shoesy, 0, 0, imagesx($implace), imagesy($implace));
}
//create stand1 left glove
$location = "Glove/0".$glove.".img/stand1.0.lGlove.png";
if(file_exists($location) && $stand == 1)
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$lglove1x, $necky+$lglove1y, 0, 0, imagesx($implace), imagesy($implace));
}
//create pants
$location = "Pants/0".$pants.".img/stand";
if(file_exists($location."2.0.pants.png") && $stand == 2)
{
$implace = imagecreatefrompng ($location."2.0.pants.png");
imagecopy($im, $implace, $mainx+$pants2x, $necky+$pants2y, 0, 0, imagesx($implace), imagesy($implace));
}
elseif(file_exists($location."1.0.pants.png"))
{
$implace = imagecreatefrompng ($location."1.0.pants.png");
imagecopy($im, $implace, $mainx+$pantsx, $necky+$pantsy, 0, 0, imagesx($implace), imagesy($implace));
}
if(!($pants || $overall))
{
$implace = imagecreatefrompng ("Pants/01060026.img/stand1.0.pants.png");
imagecopy($im, $implace, $mainx-3, $necky+1, 0, 0, imagesx($implace), imagesy($implace));
}
//create top
$location = "Coat/0".$top.".img/stand";
if(file_exists($location."2.0.mail.png") && $stand == 2)
{
$implace = imagecreatefrompng ($location."2.0.mail.png");
imagecopy($im, $implace, $mainx+$mail2x, $necky+$mail2y, 0, 0, imagesx($implace), imagesy($implace));
}
elseif(file_exists($location."1.0.mail.png"))
{
$implace = imagecreatefrompng ($location."1.0.mail.png");
imagecopy($im, $implace, $mainx+$mailx, $necky+$maily, 0, 0, imagesx($implace), imagesy($implace));
}
//create overall
$location = "Longcoat/0".$overall.".img/stand";
if(file_exists($location."2.0.mail.png") && $stand == 2)
{
$implace = imagecreatefrompng ($location."2.0.mail.png");
imagecopy($im, $implace, $mainx+$mail2x, $necky+$mail2y, 0, 0, imagesx($implace), imagesy($implace));
}
elseif(file_exists($location."1.0.mail.png"))
{
$implace = imagecreatefrompng ($location."1.0.mail.png");
imagecopy($im, $implace, $mainx+$mailx, $necky+$maily, 0, 0, imagesx($implace), imagesy($implace));
}
if(!($top || $overall))
{
$implace = imagecreatefrompng ("Coat/01040036.img/stand1.0.mail.png");
imagecopy($im, $implace, $mainx-3, $necky-9, 0, 0, imagesx($implace), imagesy($implace));
}
//create armBelowHeadOverMailChest
if($weaponz == 'armBelowHeadOverMailChest')
{
if($wepnum)
{
$location = "Weapon/0".$nxwep.".img/".$wepnum.".stand".$stand.".0.weapon.png";
}
else
{
$location = "Weapon/0".$nxwep.".img/stand".$stand.".0.weapon.png";
}
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $wepx+$weaponx, $wepy+$weapony, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create head
$implace = imagecreatefrompng ("Skin/0000".$skin.".img/front.head.png");
imagecopy($im, $implace, $mainx-15, $mainy-12, 0, 0, imagesx($implace), imagesy($implace));
//create earring
$location = "Accessory/0".$ears.".img/default.default.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$earsx, $mainy+$earsy, 0, 0, imagesx($implace), imagesy($implace));
}
//create shade hair
$location = "Hair/000".$hair.".img/default.hairShade.".$hairshade.".png";
if(file_exists($location))
{
if(substr_count($vslot, 'H1H2H3H4H5H6') == 1){
}
else{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$shadehairx, $mainy+$shadehairy, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create mask
if($maskz == "accessoryFaceBelowFace")
{
$location = "Accessory/0".$mask.".img/default.default.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$maskx, $mainy+$masky, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create face
$location = "Face/000".$face.".img/default.face.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$facex, $mainy+$facey, 0, 0, imagesx($implace), imagesy($implace));
}
//create mask
if($maskz == "accessoryFace")
{
$location = "Accessory/0".$mask.".img/default.default.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$maskx, $mainy+$masky, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create eyes item
$location = "Accessory/0".$eyes.".img/default.default.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$eyesx, $mainy+$eyesy, 0, 0, imagesx($implace), imagesy($implace));
}
//create hair
$location = "Hair/000".$hair.".img/default.hair.png";
if(file_exists($location))
{
if(substr_count($vslot, 'H1H2H3H4H5H6') == 1){
}
else{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$hairx, $mainy+$hairy, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create hairoverhead or hat
if($hat)
{
if($vslot == "CpH5"){
$location = "hair/000".$hair.".img/default.hairOverHead.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$overhairx, $mainy+$overhairy, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create hat
$location = "Cap/0".$hat.".img/default.default.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$hatx, $mainy+$haty, 0, 0, imagesx($implace), imagesy($implace));
}
}
else
{
//create top hair
$location = "Hair/000".$hair.".img/default.hairOverHead.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$overhairx, $mainy+$overhairy, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create stand2
if($stand == 2)
{
//create arm2
$location = "Skin/0000".$skin.".img/stand2.0.arm.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+4, $mainy+23, 0, 0, imagesx($implace), imagesy($implace));
}
//create coatarm2
$location = "Coat/0".$top.".img/stand2.0.mailArm.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$maila2x, $necky+$maila2y, 0, 0, imagesx($implace), imagesy($implace));
}
$location = "Longcoat/0".$overall.".img/stand2.0.mailArm.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$maila2x, $necky+$maila2y, 0, 0, imagesx($implace), imagesy($implace));
}
//create weaponOverArm
if($weaponz == 'weaponOverArm')
{
if($wepnum)
{
$location = "Weapon/0".$nxwep.".img/".$wepnum.".stand".$stand.".0.weapon.png";
}
else
{
$location = "Weapon/0".$nxwep.".img/stand".$stand.".0.weapon.png";
}
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $wepx+$weaponx, $wepy+$weapony, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create hand2
$location = "Skin/0000".$skin.".img/stand2.0.hand.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx-10, $mainy+26, 0, 0, imagesx($implace), imagesy($implace));
}
//create lglove2
$location = "Glove/0".$glove.".img/stand2.0.lGlove.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$lglove2x, $necky+$lglove2y, 0, 0, imagesx($implace), imagesy($implace));
}
//create rglove2
$location = "Glove/0".$glove.".img/stand2.0.rGlove.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$rglove2x, $necky+$rglove2y, 0, 0, imagesx($implace), imagesy($implace));
}
//create weaponOverGlove
if($weaponz == 'weaponOverGlove')
{
if($wepnum)
{
$location = "Weapon/0".$nxwep.".img/".$wepnum.".stand".$stand.".0.weapon.png";
}
else
{
$location = "Weapon/0".$nxwep.".img/stand".$stand.".0.weapon.png";
}
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $wepx+$weaponx, $wepy+$weapony, 0, 0, imagesx($implace), imagesy($implace));
}
}
}
else
{
//create weapon
if($weaponz == 'weapon')
{
if($wepnum)
{
$location = "Weapon/0".$nxwep.".img/".$wepnum.".stand".$stand.".0.weapon.png";
}
else
{
$location = "Weapon/0".$nxwep.".img/stand".$stand.".0.weapon.png";
}
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $wepx+$weaponx, $wepy+$weapony, 0, 0, imagesx($implace), imagesy($implace));
}
}
//create arm1
$location = "Skin/0000".$skin.".img/stand1.0.arm.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+8, $mainy+23, 0, 0, imagesx($implace), imagesy($implace));
}
//create coatarm1
$location = "Coat/0".$top.".img/stand1.0.mailArm.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$mailax, $necky+$mailay, 0, 0, imagesx($implace), imagesy($implace));
}
$location = "Longcoat/0".$overall.".img/stand1.0.mailArm.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$mailax, $necky+$mailay, 0, 0, imagesx($implace), imagesy($implace));
}
//create rglove1
$location = "Glove/0".$glove.".img/stand1.0.rGlove.png";
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $mainx+$rglove1x, $necky+$rglove1y, 0, 0, imagesx($implace), imagesy($implace));
}
//create weaponOverGlove
if($weaponz == 'weaponOverGlove')
{
if($wepnum)
{
$location = "Weapon/0".$nxwep.".img/".$wepnum.".stand".$stand.".0.weapon.png";
}
else
{
$location = "Weapon/0".$nxwep.".img/stand".$stand.".0.weapon.png";
}
if(file_exists($location))
{
$implace = imagecreatefrompng ($location);
imagecopy($im, $implace, $wepx+$weaponx, $wepy+$weapony, 0, 0, imagesx($implace), imagesy($implace));
}
}
}
imagepng($im);
imagedestroy($im);
//function to pull variables out of txt
function txt_parse($file)
{
$filehandle = fopen($file,"r");
$filecontent = fread($filehandle, filesize($file));
fclose($filehandle);
$filecontent = preg_replace("/ /","=",$filecontent);
$filecontent = preg_replace("/\./","_",$filecontent);
$filecontent = preg_replace("/\s/","&",$filecontent);
parse_str($filecontent,$filearray);
return $filearray;
}
?>