
SmoshySmosh
Members-
Posts
18 -
Joined
-
Last visited
Never
Everything posted by SmoshySmosh
-
Thanks for the information but do you have any info to the topic at hand? making the colors actually work?
-
Yeah I know, I don't have the script fully working yet, and I don't know how to make it not display that error when the variables are changed.
-
<?php $gender = $_GET['gender']; $gender2 = $_GET['gender2']; $hair = $_GET['hair']; $color = $_GET['color']; $imgname = "./hairs/$gender/$hair.gif"; $image = imagecreatefromgif($imgname); $palette_file = fopen("./palette/$gender/".$hair."_".$gender2."_".$color.".pal", "rb"); $contents = fread($palette_file, filesize($imgname)); $i=0; while ($i<=254) { $red = fread($palette_file, 1); $green = fread($palette_file, 1); $blue = fread($palette_file, 1); imagecolorset($image, $i, $red, $green, $blue); $i++; } if($image) { header("Content-Type: image/gif"); ImagePNG($image); imagedestroy($image); } ?> Here is the code now, but it spits out the image as all black http://www.qq-ro.com/images/test.php?hair=1&color=11&gender=M&gender2=m& All I want is for the palette to change the hair color on the image http://www.qq-ro.com/images/hairs/M/1.gif Get it now? Anyone help?
-
Please people I really really really need help on this.
-
Messed up again... my bad and It wont let me edit my post again http://www.qq-ro.com/images/hairs/M/test.php?hair=1&color=9
-
What I am trying to do is get the script to recolor the hair on some images from a palette file, but i am having some issues, I get the script to run with no errors but I don't get any image, Here is the code can I get some help? <?php $hair = $_GET['hair']; $color = $_GET['color']; $imgname = "$hair.gif"; $image = imagecreatefromgif ( $imgname ); $palette_file = fopen("$color.pal", "rb"); $contents = fread($palette_file, filesize($imgname)); $i=0; while ($i<=255) { $red = fread($palette_file, 1); $green = fread($palette_file, 1); $blue = fread($palette_file, 1); imagecolorset($image, $i, $red, $green, $blue); //imagecolorset($palette_file, $i, $red, $green, $blue); $i++; $im = @imagecreatefromgif ($imgname); /* Attempt to open */ if (!$im) { /* See if it failed */ $im = imagecreatetruecolor (150, 30); /* Create a blank image */ $bgc = imagecolorallocate ($im, 255, 255, 255); $tc = imagecolorallocate ($im, 0, 0, 0); magefilledrectangle ($im, 0, 0, 150, 30, $bgc); /* Output an errmsg */ imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; } header("Content-Type: image/gif"); $img = LoadGif("$hair.gif"); imagegif($img); imagedestroy($img); ?> http://www.qq-ro.com/images/hairs/M/1.gif Here is a color hair. http://www.qq-ro.com/images/hairs/M/9.pal Here is color 9 for that hair. I hope this helps, I really need to get this done. Forgot to add a link to the page heh... http://www.qq-ro.com/images/hairs/M/test.php
-
How would I go about making something like this?
SmoshySmosh replied to SmoshySmosh's topic in PHP Coding Help
Any examples? -
How would I go about making something like this?
SmoshySmosh replied to SmoshySmosh's topic in PHP Coding Help
Sorry for the bump but I really need help on this... -
How would I go about making something like this?
SmoshySmosh replied to SmoshySmosh's topic in PHP Coding Help
I have 43 hair styles and 251 palettes for each... So it will take a while, is there any faster way? -
How would I go about making something like this?
SmoshySmosh replied to SmoshySmosh's topic in PHP Coding Help
Any example? the palettes are in .pal files and the sprites are in .spr files. -
I am really trying to get something like this going... http://ratemyserver.net/ro-character-simulator/index.php## I have the sprites and the palette files, but I don't know where to start, and I don't need the body's just the heads and the hair colors and the headgears. Any advise? Here is another view of it http://ratemyserver.net/ro-character-simulator/charsim.php?gender=0&job=0&hair=1&viewid=&location=&direction=0&action=0&hdye=9&dye=430&bg=0&rand=5719301
-
Woot, thank you. It works now. but it says swordsman up top :-\ don't know why hah **** FIXED **** thank you guys sooo much for your help. -Smosh
-
Still spits the same error at me <?php include_once('config.php'); mysql_connect($CONFIG_db_serv, $CONFIG_db_user, $CONFIG_db_pass ); mysql_select_db($CONFIG_rag_db); //$result= mysql_query("SELECT * FROM `login`"); $result = mysql_query("SELECT * FROM `char` WHERE `online` = 1"); //$row = mysql_fetch_array($result); echo " <table width=\"550\"> <tr> <td align=\"right\" class=\"head\">Look</td> <td align=\"center\" class=\"head\">Name</td> <td> </td> <td align=\"left\" class=\"head\">Class</td> <td> </td> <td> </td> <td align=\"left\" class=\"head\">Level</td> </tr>"; while ($row = mysql_fetch_array($result)) { $result2 = mysql_query("SELECT * FROM `login` WHERE `account_id` = ".$row['account_id']." "); $row2 = mysql_fetch_array($result2); $gender = $row2['sex']; echo " <tr> <td align=\"right\"><img src=\"../images/hairs/".$gender."/".$row['hair'].".gif\"></td> <td align=\"center\">".$row['name']."</td> <td> </td> <td align=\"left\">$C[$row['class']]</td> <td> </td> <td> </td> <td align=\"left\">".$row['base_level']."/".$row['job_level']."</td> </tr>"; } echo "</table>"; ?> (part of config.php) //Class $C[0] = 'Novice'; $C[1] = 'Swordman'; $C[2] = 'Mage'; $C[3] = 'Archer'; $C[4] = 'Acolyte'; $C[5] = 'Merchant'; $C[6] = 'Thief'; $C[7] = 'Knight'; $C[8] = 'Priest'; $C[9] = 'Wizard'; $C[10] = 'Blacksmith'; $C[11] = 'Hunter'; $C[12] = 'Assassin'; $C[14] = 'Crusader'; $C[15] = 'Monk'; $C[16] = 'Sage'; $C[17] = 'Rogue'; $C[18] = 'Alchemist'; $C[19] = 'Bard'; $C[20] = 'Dancer'; $C[23] = 'Super Novice'; $C[24] = 'Gunslinger'; $C[25] = 'Ninja'; $C[4001] = 'High Novice'; $C[4002] = 'High Swordman'; $C[4003] = 'High Mage'; $C[4004] = 'High Archer'; $C[4005] = 'High Acolyte'; $C[4006] = 'High Merchant'; $C[4007] = 'High Thief'; $C[4008] = 'Lord Knight'; $C[4009] = 'High Priest'; $C[4010] = 'High Wizard'; $C[4011] = 'Whitesmith'; $C[4012] = 'Sniper'; $C[4013] = 'Assassin Cross'; $C[4015] = 'Paladin'; $C[4016] = 'Champion'; $C[4017] = 'Professor'; $C[4018] = 'Stalker'; $C[4019] = 'Creator'; $C[4020] = 'Clown'; $C[4021] = 'Gypsy'; $C[4023] = 'Baby'; $C[4024] = 'Baby Swordman'; $C[4025] = 'Baby Mage'; $C[4026] = 'Baby Archer'; $C[4027] = 'Baby Acolyte'; $C[4028] = 'Baby Merchant'; $C[4029] = 'Baby Thief'; $C[4030] = 'Baby Knight'; $C[4031] = 'Baby Priest'; $C[4032] = 'Baby Wizard'; $C[4033] = 'Baby Blacksmith'; $C[4034] = 'Baby Hunter'; $C[4035] = 'Baby Assassin'; $C[4037] = 'Baby Crusader'; $C[4038] = 'Baby Monk'; $C[4039] = 'Baby Sage'; $C[4040] = 'Baby Rogue'; $C[4041] = 'Baby Alchemist'; $C[4042] = 'Baby Bard'; $C[4043] = 'Baby Dancer'; $C[4045] = 'Super Baby'; $C[4046] = 'Taekwon'; $C[4047] = 'Star Gladiator'; $C[4049] = 'Soul Linker'; $number['class'] = 1; echo $C[$number['class']]; Parse error: syntax error, unexpected '[', expecting ']' in /mnt/local/home/holoc/qq-ro.com/scripts/whosonline.php on line 29
-
Woot that fixes it!! now for the other part hah. thank you so much!
-
sex is in the login table and the rest of the stuff I am using is in the char table. same error for the class Array ( [0] => 150030 [char_id] => 150030 [1] => 2000028 [account_id] => 2000028 [2] => 0 [char_num] => 0 [3] => Strawberry [name] => Strawberry [4] => 10 [class] => 10 [5] => 95 [base_level] => 95 [6] => 50 [job_level] => 50 [7] => 23133670 [base_exp] => 23133670 [8] => 2083386 [job_exp] => 2083386 [9] => 1299145 [zeny] => 1299145 [10] => 99 [str] => 99 [11] => 9 [agi] => 9 [12] => 70 [vit] => 70 [13] => 1 [int] => 1 [14] => 50 [dex] => 50 [15] => 1 [luk] => 1 [16] => 8129 [max_hp] => 8129 [17] => 8129 [hp] => 8129 [18] => 401 [max_sp] => 401 [19] => 401 [sp] => 401 [20] => 5 [status_point] => 5 [21] => 0 [skill_point] => 0 [22] => 8 [option] => 8 [23] => 0 [karma] => 0 [24] => 0 [manner] => 0 [25] => 34 [party_id] => 34 [26] => 8 [guild_id] => 8 [27] => 0 [pet_id] => 0 [28] => 0 [homun_id] => 0 [29] => 3 [hair] => 3 [30] => 0 [hair_color] => 0 [31] => 0 [clothes_color] => 0 [32] => 7 [weapon] => 7 [33] => 0 [shield] => 0 [34] => 0 [head_top] => 0 [35] => 0 [head_mid] => 0 [36] => 0 [head_bottom] => 0 [37] => pay_fild02 [last_map] => pay_fild02 [38] => 156 [last_x] => 156 [39] => 216 [last_y] => 216 [40] => payon [save_map] => payon [41] => 160 [save_x] => 160 [42] => 58 [save_y] => 58 [43] => 0 [partner_id] => 0 [44] => 1 [online] => 1 [45] => 0 [father] => 0 [46] => 0 [mother] => 0 [47] => 0 [child] => 0 [48] => 0 [fame] => 0 )
-
Calling that gives me an error. Parse error: syntax error, unexpected '[', expecting ']' in /mnt/local/home/holoc/qq-ro.com/scripts/whosonline.php on line 30
-
http://qq-ro.com/images/hairs//3.png is what I get with while ($row = mysql_fetch_array($result)) { $result2 = mysql_query("SELECT * FROM `login` WHERE `account_id` = ".$row['account_id']." "); $row2 = mysql_fetch_array($result2); $gender = $row['sex']; echo " <tr> <td align=\"right\"><img src=\"../images/hairs/".$gender."/".$row['hair'].".png\"></td> when it should show up as http://qq-ro.com/images/hairs/F/3.png And I want the Classes to not show up as the numbers but show up as the actual class name. <td align=\"left\">$C".$row['class']."</td> //Class $C0 = 'Novice'; $C1 = 'Swordman'; $C2 = 'Mage'; $C3 = 'Archer'; $C4 = 'Acolyte'; $C5 = 'Merchant'; $C6 = 'Thief'; $C7 = 'Knight'; $C8 = 'Priest'; $C9 = 'Wizard'; $C10 = 'Blacksmith'; $C11 = 'Hunter'; $C12 = 'Assassin'; $C14 = 'Crusader'; $C15 = 'Monk'; $C16 = 'Sage'; $C17 = 'Rogue'; $C18 = 'Alchemist'; $C19 = 'Bard'; $C20 = 'Dancer'; $C23 = 'Super Novice'; $C24 = 'Gunslinger'; $C25 = 'Ninja'; $C4001 = 'High Novice'; $C4002 = 'High Swordman'; $C4003 = 'High Mage'; $C4004 = 'High Archer'; $C4005 = 'High Acolyte'; $C4006 = 'High Merchant'; $C4007 = 'High Thief'; $C4008 = 'Lord Knight'; $C4009 = 'High Priest'; $C4010 = 'High Wizard'; $C4011 = 'Whitesmith'; $C4012 = 'Sniper'; $C4013 = 'Assassin Cross'; $C4015 = 'Paladin'; $C4016 = 'Champion'; $C4017 = 'Professor'; $C4018 = 'Stalker'; $C4019 = 'Creator'; $C4020 = 'Clown'; $C4021 = 'Gypsy'; $C4023 = 'Baby'; $C4024 = 'Baby Swordman'; $C4025 = 'Baby Mage'; $C4026 = 'Baby Archer'; $C4027 = 'Baby Acolyte'; $C4028 = 'Baby Merchant'; $C4029 = 'Baby Thief'; $C4030 = 'Baby Knight'; $C4031 = 'Baby Priest'; $C4032 = 'Baby Wizard'; $C4033 = 'Baby Blacksmith'; $C4034 = 'Baby Hunter'; $C4035 = 'Baby Assassin'; $C4037 = 'Baby Crusader'; $C4038 = 'Baby Monk'; $C4039 = 'Baby Sage'; $C4040 = 'Baby Rogue'; $C4041 = 'Baby Alchemist'; $C4042 = 'Baby Bard'; $C4043 = 'Baby Dancer'; $C4045 = 'Super Baby'; $C4046 = 'Taekwon'; $C4047 = 'Star Gladiator'; $C4049 = 'Soul Linker'; but they just show as the number... -Smosh
-
Here is my code, and here is the output http://qq-ro.com/scripts/whosonline.php What i am trying to do is make the images load from the correct folders, the DB is setup so it has the character level information and almost everything else besides the gender in the char table, and the gender of the character is in the login table. I am trying to make it so it loads the correct image that corresponds to the gender of the character, as I think you can see in my code yet I cannot get it to work.... I have tried like 10 different work arounds but nothing seems to work for me... Another problem i am having is I need it to tell the character class, but the DB only gives me the class number. In config.php i set it up so the number that it spits out gives the character name if it is like $C4047 for example, yet I cannot get it to turn into that... Any help is much appreciated, sorry if i did not follow the guidelines, This is my first post here and I am in such a big hurry to get this script done. :-X -Smosh